[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [fluid-dev] How to change the instrument:channel assignment when pla

From: David Henningsson
Subject: Re: [fluid-dev] How to change the instrument:channel assignment when playing a MIDI file
Date: Thu, 11 Jul 2013 10:12:00 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130623 Thunderbird/17.0.7

On 07/10/2013 04:05 AM, Dave wrote:

Fluidsynth newbie here. But thanks to some help from the wonderful folks
in this group (especially GrahamG), and thanks to the excellent software
design, I’ve been able to programmatically create mp3’s.

I’m stuck on what is probably a trivial task, but I haven’t found the
solution. I can play a midi file using a standard Soundfont from the
command line, as follows:

“fluidsynth fluidr3_gm2-2.sf2 mymidi.mid”

But this uses the default channel:instrument assignments, which for this
particular soundfont is “Yamaha Grand Piano” for all channels except the
drum channel 9. I am trying to figure out how to programmatically change
the instrument assignment.

I created a simple configuration file, as follows:

“load fluidr3_gm2-2.sf2

prog 0 10”

This assigns the “Music Box” instrument to channel 0. If I execute the
following command: “fluidsynth –f fluidconfig.txt”,  I can see that
channel 0 is in fact changed (by using the “channels” command.

But if I try to BOTH change the instrument assignment AND play the midi
file from the command line, i.e. “fluidsynth –f fluidconfig.txt
mymidi.mid”, the midi file plays but the instrument assignment doesn’t
occur, it still uses the default Yamaha Piano for channel 0.

Is there a way to do both?

First, check the player.reset-synth setting, you might want to turn it off because it resets everything back to piano (and drums) every time you load start playing a midi file.

Second, you need to make sure mymidi.mid does not contain instrument/channel commands in itself. If both you and the midi file try to set the instrument for a channel, whoever does it later in time will override the former.

// David

reply via email to

[Prev in Thread] Current Thread [Next in Thread]