Simply replace fnbuf with a valid type 0 Midi file name, (in my case the file is on an SD card, hence the SD.open command), so modify that line as required for your application. You could rewrite the attached to start the at the line In my system I did not plug the Fluxamasynth shield directly into the DUE because I have a Cold tears display shield on the DUE, and that would interfere mechanically, so I run power and ground to the board separately, along with the Serial1 TX out to pin 4.
Serial1.begin(31250) // Fluxamasynth MIDI board Serial port Set the baud rate on second serial port like this: Simply set up a second serial port on the DUE to connect to pin 4 of the fluxamasynth board (you only need the DUE TX pin to the Flux board pin 4 because the Flux does not talk back. You can also remove the power on and destination (PlayDest code bits), as those are to control the external amplifiers. In fact you'll need to take the display stuff out of it (myGLCD calls). txt above is really all you need to add a midi file play in your own. I don't want to re-invent the wheel here!!!! I'm hoping to find a used wheel that will work.
I am using a DUE, and have no problem finding and opening and reading the files, I just need to parse them to determine the "dividers" and breaks between the commands.Īny assistance on this wold be appreciated. Most of the MIDI libraries I have found work on serial data arriving, and going out again to an external sequencer or other device. I use a serial port for the fluxamasynth (Modern Devices, very nice shield). I can create manual commands, and make the Fluxamasynth operate, but i need to be able to play. Then, I need to parse the commands (they are of various lengths, depending on the command) so that they are sent to the Fluxamasynth board at the proper time.
I am working on a project that reads a type 0 midi file from an SD card, and parses the commands.įirst, to play it to the sound generator in the proper timing, I need to calculate the timing of the commands (tempo and other commands buried in the file provide the info to do this).