I’ve added a new program to the repository: LunaMod, a sequence tone generator.
LunaMod started as a project for Make Magazine by Brian McNamara. It is a sampler with a twist: instead of audio, it samples the positions of a knob and assigns them to the frequencies of a series of tones generated internally.
I found out about LunaMod a while ago through a hackaday’s article on a version by Rob Miles, who ported the program, originally for PICAXE, to an ATtiny45. miniMO runs on an ATtiny85, so I thought it should be straightforward to adapt the program, and hopefully add something of my own to it. I ended up changing a few things:
- miniMO only has one knob, so it can’t have simultaneous independent control over both the notes’ frequencies and the tempo; instead, the knob controls the tempo if the button is not pressed, and the notes if it is.
- Rob’s project generates square waves alternating HIGH and LOW levels of an output pin. I use PWM to generate three different wave shapes: triangle, square, and saw, like I do in the DCO.
- I thought it would be cool to be able to change the wave shape during program execution, but miniMO only has one button, and in this particular program I couldn’t use multiple-click detection to change parameters. Since I had one free input, I wondered if I could use it as a button of sorts: miniMO’s inputs and outputs all use “exposed” male pins, so placing a finger over both pins should produce a change in the readings that I could use as a trigger. Indeed it does! I only need to detect if a finger is touching the input or not, so all that was left was figuring out a boundary value between both states, which I did by trial and error.
- The program scans this “secondary button” once every other beat, so if you keep the finger over the input, the wave changes in sync with the tempo 🙂
In all, I think this is a really fun program, great for making glitch tones and sound effects of all kinds, from sample-and-hold “classic” computer sounds to robot utterances and quasi-white noise; I particularly enjoy sampling a gesture at one extreme of the tempo range, then checking what it translates to at the other extreme.