Ah, chiptunes. One of the few remaining human endeavours where less RAM, less storage space, and fewer capabilities are actually considered an improvement. [dop3joe] over at the Stuttgart hackerspace Shackspace sent in a tiny chiptune playing circuit using the most bare-bones hardware we’ve ever seen.
The Noiseplug, as [dop3joe] calls it, is based on a very, very small 6 pin ATtiny9. With 1 kB of Flash memory and only 32 bytes of RAM [dop3joe] was able to create a small device inside an RCA jack that plays chiptunes whenever it is powered by a battery.
If you’d like to make your own noise plug, [dop3j0e] put all the code up in his Git. There are two relevant pieces of software for this build: a Windows app to create the chiptunes, and the ATtiny9 firmware itself. Of course to program the tiny, you’ll have to deal with the Atmel TPI, so here’s the application note (PDF).
Oh, [dop3joe] won third place at the Evoke demoscene party last weekend with the Noiseplug. Awesome.
Why don’t you phantom power it?
How would you fit a DC/DC converter into that tiny plug? :-)
At 200uA power consumption for the Attiny, I guess it should be quite easy to fit a zener “DC/DC converter” ;)
Giving lft a run for his money :)
I was at Evoke and this was rather exciting at the compo. A well deserved 3rd place. I entered too, but unsurprisingly only placed 9th (somewhat drunk coding).
To see the rest of the entries go to http://www.pouet.net/party.php?which=18&when=2012
Very nice, makes me think of keygens with accompany music and animation and the .exe is only a few kb.
Reminds me of Bit banger
Also of The Swan
Demoscene for hardware geeks? Me gusta.
Virgin platform? I don’t think I’ve ever seen a demo on an ATTiny before, congrats!
Pixelj.am (which happens at Notacon every spring) saw a few virgin platforms broken in this year, including the Vectrex. It was a few years ago that I first saw Milkymist, another hardware demo platform but pretty much the polar opposite in terms of raw power. ;)
Vectrex wasn’t a virgin platform (although that was a cool demo).
3 voices in 32 bytes? Flippin’ awesome.
And still about 8ish bytes of RAM left ;) Could have fit another one or two voices, but ran out of ideas.
How hard would it be to add midi controll into the program, and have a super-barebones midi synth?
This specific microcontroller has no UART, which makes MIDI a little tricky — you’d have to receive MIDI data in software. Also, I’m not sure whether the necessary code would fit into Flash next to the sound generation. Plus, you probably need extra parts to be electrically compatible to the MIDI cable.
Bottom line — it might work, and a MIDI plug probably has enough space for the extra parts. With a somewhat larger controller (like ATtiny25), I’m sure it’ll be possible.
Thanks for the reply. I’d have a go at doing it, but my coding probably isn’t up to it yet (I’m currently trying to work my way on from picaxe)
PS; as for a use for another voice or two, what about percussion?
Right, percussion was top on my list of “would have been cool” features, so scratch “no ideas”, actually, and replace by “no time” — I finished the asm code one hour before the competition deadline ;)
Very nice :
What a great post! For the windows app you can smooth out the playback by loading the buffer while waiting for the previous buffer to play. Something like this:
while (!(GetAsyncKeyState(VK_ESCAPE) & 1))
{
waveOutPrepareHeader(out, &bufs[i], sizeof(WAVEHDR));
waveOutWrite(out, &bufs[i], sizeof(WAVEHDR));
i ^= 1;
j = 0;
max = 0;
data = (uint8_t *)bufs[i].lpData;
while(waveOutUnprepareHeader(out,&bufs[i],sizeof(WAVEHDR)) == WAVERR_STILLPLAYING)
{
if (j max)
{
max = data[j];
// printf(“%x\n”, max);
}
j++;
}
}
}
It’s smooth for me; that’s why I’m using two buffers. I wait for a buffer to finish playing, then fill it while the other buffer plays and start waiting for that buffer.
Schön!
I’m surprised Tristan Perich doesn’t get a mention here… granted, this has some smooth voices and he’s gone one up (or, 2 pins down) on 1 bit symphony… still.
http://www.1bitsymphony.com/ http://www.1bitmusic.com/
I have gone through the attiny program and am having trouble figuring out how to change the song. I think I can get the song on the windows program but then is it simply a matter of copy and pasting into the attiny program? Thanks for your time and have a great day,
-Alan
The data formats are mostly the same between the win and avr versions — I just copy-pasted most of the data myself.
darthrake made a unix version of the win program that has some details about decoding and encoding the tune, maybe that helps, too: https://github.com/darthrake/noiseplug/tree/master/unix
Oh, and there are some constants regarding song length, loop point, bass rhythm and such in the code. These might be harder to change.