PICAXE as Arpeggiator
The purpose of this exercise was to try out the sound command really.
With the sound command you can put out a sound at a pitch to any of the output pins. Its just a square wave. Unforturnatly its not very asynchronous so when you kick off a 100ms note you lose control of everything else. Lets face it…a 1 second note is an ETERNITY to a micro processor. However, the way the PICAXE works is that you are trading having to deal with interrupts for a simple command. From what I can tell, there is no way around this (except for using an external source to trigger an interrupt..but thats another test).
ya, the Picaxe is not the best sound source. Well it is kinda, but you just gotta be creative. This particular exercise did not explore much beyond creating simple sounds and reading from the ADC.
The program is as follows:
Nothing too special. Two pots control the speed and the starting note.
The sound command puts out a sound for a specified amount of time. Values from 0 to 127 (or so) are notes and from 128 to 255 are a pitched noise. This program picks values that are within the sound range so I divide the number by 4 to give me a range from 1 to 63 or so.
Basically it reads the tempo and pitch and uses those values to kick off a three note arpeggio.
The synchronous nature of the chip can be felt by selecting a slow rate and cranking it to a fast one. You have to wait for the whole slow sequence to finish before the fast one kicks off.
so anyway….this works. Not well…but it works.
Back to PICAXE projects
