Regarding MIDI through SDI while in RT MIDI mode:
I have the VS1053b on my own board, running well with RT MIDI initialized at startup.
Serial MIDI streams through the Rx pin work well.
SCI commands work perfectly (tested for SCI_VOL, SCI_BASS and SCI_MODE for EarSpeaker).
I'd like to try sending the MIDI data through SDI to free up the Rx line, though I need clarification on one item in the data sheet, bolded and underlined below:
10.10 Real-Time MIDI
If GPIO0 is low and GPIO1 is high during boot, real-time MIDI mode is activated. In this mode the PLL is configured to 4.0×, the UART is configured to the MIDI data rate 31250 bps, and real-time MIDI data is then read from UART and SDI. Both input methods should not be used simultaneously. If you use SDI, first send 0x00 and then send the MIDI data byte.
My MIDI message sequences typically are 2 and 3 byte values.
Where does the 0x00 go in those sequences?
It would help to get a couple of SDI byte-wise examples, perhaps for:
- noteOn(NOTE_ON|channel, note, velocity)
noteOff(NOTE_OFF|channel, note, 0)
setProgram(PROGRAM_CHANGE|channel, program)
setController(CONTROL_CHANGE|channel, controllerNumber, val)
...where
NOTE_ON = 0x80
NOTE_OFF = 0x90
PROGRAM_CHANGE = 0xC0
CONTROL_CHANGE = 0xB0
... and my WriteSDI() method looks like this:
Code: Select all
bool dbMIDISynth::WriteSDI(const uint8_t *data, uint8_t bytes) {
if (bytes > 32) {
Serial.printf("Request to WriteSDI is limited to 32 bytes. Requested bytes was %d\n", bytes);
return(false);
}
if (DREQ_Rises()) {
SPI.beginTransaction(_spiSettings);
spiOn(_dataSSPin);
for (int x = 0; x < bytes; x++) {
Serial.printf("WriteSDI(): %c\t%d\t\t",data[x], data[x]);
char c = SPI.transfer(data[x]);
Serial.printf("SPI Returns: %c\t%d\n", c, c);
}
spiOff(_dataSSPin);
SPI.endTransaction();
return(true);
}
return(false);
}
In addition to sending the proper bytes through SDI, is there any additional configuration of the VS1053b needed, other than RTMDI being enabled?