I've been trying to play different tracks using different instruments, but all tracks play the same instrument.
When I execute the example below, the only thing I can hear is the Acoustic Grand Piano playing both tracks.
instrument = MidiInstrument("Acoustic Grand Piano")
instrument2 = MidiInstrument("Oboe")
track_container = Track(instrument)
track_container_2 = Track(instrument2)
track_container.add_notes(['C-6', 'E-6', 'G-6', 'B-6'])
track_container_2.add_notes(['E-6', 'G#-6', 'B-6', 'D-6'])
composition = Composition()
composition.add_track(track_container)
composition.add_track(track_container_2)
fluidsynth.play_Composition(composition, bpm=60)
If I switch the composition.add_track methods, as in the example below, the Oboe becomes the only audible instrument.
instrument = MidiInstrument("Acoustic Grand Piano")
instrument2 = MidiInstrument("Oboe")
track_container = Track(instrument)
track_container_2 = Track(instrument2)
track_container.add_notes(['C-6', 'E-6', 'G-6', 'B-6'])
track_container_2.add_notes(['E-6', 'G#-6', 'B-6', 'D-6'])
composition = Composition()
composition.add_track(track_container_2)
composition.add_track(track_container)
fluidsynth.play_Composition(composition, bpm=60)
If I pass the channels parameter to the fluidsynth.play_Composition method, nothing changes.
What is wrong with my codes? A composition should be able to play multiple instruments, right?
I've been trying to play different tracks using different instruments, but all tracks play the same instrument.
When I execute the example below, the only thing I can hear is the Acoustic Grand Piano playing both tracks.
If I switch the
composition.add_trackmethods, as in the example below, the Oboe becomes the only audible instrument.If I pass the
channelsparameter to thefluidsynth.play_Compositionmethod, nothing changes.What is wrong with my codes? A composition should be able to play multiple instruments, right?