fluid-dev
[Top][All Lists]
Advanced

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

Re: [fluid-dev] Percussion Channel


From: dave
Subject: Re: [fluid-dev] Percussion Channel
Date: Thu, 10 Dec 2020 18:34:49 -0000

Hi Tom,

Thanks for your further help.

>... 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.

I've now included the bank select, so that my setting up procedure is now:

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

        // create the synthesizer
        // with percussion channel = 64

        synth = new_fluid_synth( settings );
        nFsResult = fluid_synth_set_channel_type( synth, 64, CHANNEL_TYPE_DRUM 
);

        // Set channel 9 to melodic:
        
        nFsResult = fluid_synth_set_channel_type(synth, 9, 
CHANNEL_TYPE_MELODIC);
        nFsResult = fluid_synth_bank_select(synth, 9, 0); 

        nFsResult =  fluid_synth_system_reset( synth );

        // create the audio driver:

        adriver = new_fluid_audio_driver( settings, synth );                    
     
===

And when the music is sent to the synth, the first event sent, on all melodic 
channels including 9, is a program change to the desired voice.

I'm afraid I'm still getting percussion sounds on channel 9.
[But interestingly setting channel 64 to percussion *does* work.]

[ I can't use fluid_synth_program_select() at this stage as it needs a font ID, 
and I am only loading the font with

        nFsResult = fluid_synth_sfload(  synth, pszSoundFontPath, TRUE );

after all the above setting up.]    And I am now monitoring the return values 
and they're all FLUID_OK.

So still puzzled ☹

Dave

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







reply via email to

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