Dave,
There's a bit of a problem with this sectionIf porta.0 = 1 the program will GOTO sw1off. It will then proceed to sw2on, sw2off and finally go off into LaLa land as there's no way to go back to the main Loop. The last thing you'll see before it dies is the portamento command (assuming conditions are right)Code:If porta.0 = 0 Then sw1on ' check sustain pedal If porta.0 = 1 Then sw1off If porta.1 = 0 Then sw2on ' check portamento pedal If porta.1 = 1 Then sw2off If porta.2 = 0 Then Hserout [255] ' reset all controllers Endif Goto Loop ' go back to continuous monitoring sw1on: If sw1 = 0 Then ' check to see if sustain is off sw1 = 127 Hserout [176,64,sw1] ' turn on sustain Endif sw1off: If sw1 = 127 Then ' check to see if sustain is on sw1 = 0 Hserout [176,64,sw1] ' turn off sustain Endif sw2on: If sw2 = 0 Then ' check to see if portamento is off sw2 = 127 Hserout [176,65,sw2] ' turn on portamento Endif sw2off: If sw2 = 127 Then ' check to see if portamento is on sw2 = 0 Hserout [176,65,sw2] ' turn off portamento Endif
You could changed each of the sw1on: sw1off: sw2on: sw2off: sections to a subroutine ending with RETURN. Then, for the tests...
If porta.0 = 0 Then GOSUB sw1on ' check sustain pedal
Best regards,
Darrel




Bookmarks