;****************************************************************** ;* * ;* Luna Mod by Brian McNamara * ;* V 1.0 06/08/2010 First release Beta * ;* V 1.1 29/08/2010 Add better tempo system * ;* * '****************************************************************** ;------- Switches -------- symbol Sw_Write = pin3 ;write switch ;------- Variables ------- symbol Tempo = b0 symbol ADCFreq = b2 symbol i = b3 symbol MemPos = b5 symbol MemFreq = b7 symbol MemFreq2 = b8 ;------------------------------ Setup ------------------------------------ Setup: setfreq m8 ;----------------------------------------------------------------------------------------- ;------------------------------- Main ---------------------------------------------------- Main: readadc 2,ADCFreq ;read frequency pot readadc 1,Tempo ;read temp pot tempo = tempo /6 ;cut the tempo range low 4 ;Tempo LED on for MemPos = 80 to 127 if SW_Write = 0 then ;check to see if the write switch has been pressed readadc 2,ADCFreq ;read the freq pot value 0 to 255 poke MemPos,ADCFreq ;write freq pot value if it has endif peek MemPos,MemFreq ;read the freq from memory MemFreq2 = MEmfreq+128 if memfreq=0 then :memfreq2=0:endif ;rest when freq knob in ccw pos sound 0,(MemFreq,1) 'make sound sound 0,(MemFreq2,1) ;make sound for i = 1 to Tempo ;tempo control next i next MemPos high 4 ;LED off goto Main ;-----------------------------------------------------------------------------------------