fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] Percussion Channel


From: Tom M.
Subject: Re: [fluid-dev] Percussion Channel
Date: Thu, 10 Dec 2020 17:39:04 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0

Please make sure to include the mailing list when replying.


On 10.12.20 15:10, dave@mozart.co.uk wrote:
Hi Tom,


fluid_synth_set_channel_type() changes the type only. It does not assign new 
presets. To do this, either add a call to fluid_synth_program_reset() or send 
some fluid_synth_program_change() messages afterwards.

 >And make sure to implement proper error handling by checking the return 
values of those functions.


Thanks for the suggestion.   I was already sending a program change to all 
channels (except the one where I actually want percussion)  and the voices were 
coming out fine on all but channel 9.   So I’ve included a reset:

        settings = new_fluid_settings();

        fluid_settings_setint( settings, "synth.midi-channels", 65 );

// create the synthesizer

// with percussion channel = 64

        synth = new_fluid_synth( settings );

        fluid_synth_set_channel_type( synth, 64, CHANNEL_TYPE_DRUM);

// Set the standard MIDI percussion channel to melodic:

        fluid_synth_set_channel_type( synth, 9, CHANNEL_TYPE_MELODIC);

// Reset:

        fluid_synth_system_reset( synth );

And it hasn’t changed:  I’m still getting percussion sounds on channel 9.

As a work-around I’ve gone over to using channel 9 as my percussion channel, 
and that works fine.

[I have to admit I wasn’t checking error returns but I’ll do that next.]

Dave

David Webber
Mozart Music Software
https://www.mozart.co.uk


I forgot that you have to set the bank as well:

fluid_synth_set_channel_type( synth, 9, CHANNEL_TYPE_MELODIC);
fluid_synth_bank_select(synth, 9, 0); // bank 0
fluid_synth_program_reset();

Alternatively, use fluid_synth_program_select() right away.


Tom



reply via email to

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