To send generated MIDI from Magenta to FluidSynth, we'll take one of the first examples we wrote in Chapter 2, Generating Drum Sequences with the DrumsRNN, and add some code to send the MIDI messages directly to the software synthesizer.
This is similar to what we did in the previous chapter when we used the Web MIDI API to send MIDI notes to FluidSynth from the browser:
- First, we'll start FluidSynth using one of the following:
- Linux: fluidsynth -a pulseaudio -g 1 PATH_TO_SF2
- macOS: fluidsynth -a coreaudio -g 1 PATH_TO_SF2 ...