When I loaded the stereo firmware for the first time, the LED went from green to flashing blue before releasing the user button, indicating that the procedure had finished.
That’s what I expected because it’s what I had read in
forum.
What he does now
Although it is different, can it be equivalent?
thank you for your time.
Greetings Rodolfo
The following corresponds to MIDI:
–pin 10 leonardo micro connected to pin 4 midi in Wav triguer
–pin GND leonardo micro connected to pin 5 midi in Wav Triguer
The following is the program, which I obtained from the forum, but changing the notes (01 to 0F were placed) and using only bank 0
#include <SoftwareSerial.h>
SoftwareSerial mySerial(1, 10); // RX, TX
void setup() {
// Set MIDI baud rate:
mySerial.begin(31250);
Serial.begin(57600);
}
int CurrentMidiBank = 1;
int CurrentMidiChannel = 0;
byte note = 0;
void loop() {
// Play notes in banks 0
// (all on channel 0)
//
for ( int bank = 0; bank < 1; bank ++ )
{
CurrentMidiBank = bank;
midiBank( CurrentMidiChannel, CurrentMidiBank );********++++++++
// for (int note = 0x01; note < 0x0F; note ++)
for (int note = 0x01; note < 0x0F; note ++)
{
noteOn( CurrentMidiChannel, note, 0x45);
Serial.print(“N:”);
Serial.println(note, DEC);
delay(1000);
noteOn( CurrentMidiChannel, note, 0x00);
delay(1000);
}
delay( 1500 );
}
}
// plays a MIDI note. Doesn’t check to see that cmd is greater than 127, or that
// data values are less than 127:
void midirelease ( byte channel, byte release)
{
midiMsg( (0xB0 | channel ), 0x48, release);
mySerial.write(release );
}
void midiattack ( byte channel, byte attack)
{
midiMsg( (0xB0 | channel ), 0x49, attack);
mySerial.write( attack);
}
void midiBank( byte channel, byte bank )
{
// Program Change, Bank select LSB = bank
midiMsg( (0xB0 | channel ), 0x20, bank );
// Program Change, program 0
mySerial.write( (0xC0 | channel) );
mySerial.write( bank );
}
// Send a MIDI note-on message.
void noteOn(byte channel, byte note, byte volume)
{
midiMsg( (0x90 | channel), note, volume);
}
// Send a MIDI note-off message.
void noteOff(byte channel, byte note, byte volume)
{
midiMsg( (0x80 | channel), note, volume );
}
// Send a general MIDI message
//
void midiMsg(byte cmd, byte data1, byte data2 )
{
mySerial.write(cmd);
mySerial.write(data1);
mySerial.write(data2);
}