Here’s the first prototype sequencer. Just a proof-of-principal really. It only has 4 slots so can only play a repeating sequence of 4 notes. The input is via 2 buttons (pin0,pin2) and a pot on adc0. There are 4 LEDs (pins 2,3,4,5) that indicate the currently playing note, another LED on pin0 to indicate the mode, and the sound comes from a piezo connected to pin1.
When first run, it’s in play mode and the LEDs light in sequence, one LED on at a time. The speed is controlled via the pot. No note’s are programmed, so no sound is heard. Pressing the mode button once changes to program mode. LEDs stop sequencing and the Prog LED comes on. A tone can be heard and it’s frequency is changed using the pot. Half of the pots travel is tones, the other half noise (as indicated in the docs under SOUND command).
This is the note that will be programmed into the currently indicated slot. To store the note, press and hold the slot button for about half a second. The slot button also advances the slot indicator. To change slots, press the slot button briefly.
Program the sequence of notes, then press the mode button to change back to play mode. Now the LEDs will start to light in sequence again, but as each LED comes on, it’s corresponding note is heard.
During programming, a silence can be programmed by turning the pot all the way to zero before storing the note.
I could use the 4 LEDs as a binary display and with just a small change to the code, have a 16 slot sequence. I’m currently exploring the possibility of getting 8 LEDs/slots to work. In theory the 14M could have upto 48 slots, but I don’t know how the display would work. I’d prolly need to add more components, like a 7seg LED driver maybe.
As published here, this sequencer can be constructed using just a 14M, 5 LEDs, 2 buttons with 4K7 pullups, 1 pot and a Piezo disk.
When first run, it’s in play mode and the LEDs light in sequence, one LED on at a time. The speed is controlled via the pot. No note’s are programmed, so no sound is heard. Pressing the mode button once changes to program mode. LEDs stop sequencing and the Prog LED comes on. A tone can be heard and it’s frequency is changed using the pot. Half of the pots travel is tones, the other half noise (as indicated in the docs under SOUND command).
This is the note that will be programmed into the currently indicated slot. To store the note, press and hold the slot button for about half a second. The slot button also advances the slot indicator. To change slots, press the slot button briefly.
Program the sequence of notes, then press the mode button to change back to play mode. Now the LEDs will start to light in sequence again, but as each LED comes on, it’s corresponding note is heard.
During programming, a silence can be programmed by turning the pot all the way to zero before storing the note.
I could use the 4 LEDs as a binary display and with just a small change to the code, have a 16 slot sequence. I’m currently exploring the possibility of getting 8 LEDs/slots to work. In theory the 14M could have upto 48 slots, but I don’t know how the display would work. I’d prolly need to add more components, like a 7seg LED driver maybe.
As published here, this sequencer can be constructed using just a 14M, 5 LEDs, 2 buttons with 4K7 pullups, 1 pot and a Piezo disk.
Code:
#picaxe 14m
low 2,3,4,5
pla:
do
readadc 0,b1:b1=b1/10
gosub adv
b2=b2+$50:peek b2,b0:b2=b2-$50
sound 1,(b0,b1)
if pin1=0 then
high 0
pause 300
goto prg
endif
loop
prg:
do
readadc 0,b0
sound 1,(b0,5)
if pin1=0 then
low 0
pause 300
goto pla
elseif pin2=0 then
pause 300
if pin2=0 then
b2=b2+$50
poke b2,b0
b2=b2-$50
else
gosub adv
endif
endif
loop
adv:
low b2
inc b2
if b2=6 then
b2=2
endif
high b2
if pin2=0 then
pause 300
endif
return
Last edited: