6581
11-17-2010, 02:00 PM
Hi,
I have some trouble using a UART at 31250 baud (the baud rate using
by MIDI. The Data (NoteOn, NoteOff, etc.) seems to be received
correctly about 98% of the time, but something about 2% gets
discarded for some reason. I'm using the FullDuplexSerial object.
This seems only to appear when I'm using more cogs - e.g.
SIDCog (modified version), ADC objects and FullDuplexSerial.
It has worked without any problems previously.
This is some snippet to show how the data is processed:
repeat
note := -1
if ( b := midi.rxcheck ) <> -1
midi.tx(b)
if b & $80
runningStatus := b
b := midi.rx
if ( runningStatus ) == $90
note := b
vel := midi.rx
if vel == 0
note := -1
elseif ( runningStatus ) == $80
' Do something (CH0 note off)
midi.rx ' Ignore velocity.
if note <> -1
' Do something (NoteOn)
I have some trouble using a UART at 31250 baud (the baud rate using
by MIDI. The Data (NoteOn, NoteOff, etc.) seems to be received
correctly about 98% of the time, but something about 2% gets
discarded for some reason. I'm using the FullDuplexSerial object.
This seems only to appear when I'm using more cogs - e.g.
SIDCog (modified version), ADC objects and FullDuplexSerial.
It has worked without any problems previously.
This is some snippet to show how the data is processed:
repeat
note := -1
if ( b := midi.rxcheck ) <> -1
midi.tx(b)
if b & $80
runningStatus := b
b := midi.rx
if ( runningStatus ) == $90
note := b
vel := midi.rx
if vel == 0
note := -1
elseif ( runningStatus ) == $80
' Do something (CH0 note off)
midi.rx ' Ignore velocity.
if note <> -1
' Do something (NoteOn)