mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-10 06:51:54 +00:00
Add MIDI channel mapping to audio dry output
This commit is contained in:
parent
565002f34f
commit
0b0e5dd2a1
4 changed files with 12 additions and 1 deletions
Binary file not shown.
|
@ -70,6 +70,11 @@ fluid_channel_init(fluid_channel_t *chan)
|
|||
int i, prognum, banknum;
|
||||
|
||||
chan->sostenuto_orderid = 0;
|
||||
|
||||
/* Init default channel mapping variables ---------------------------------*/
|
||||
/* Channel default mapping to audio dry output index */
|
||||
chan->mapping_to_out = chan->channum % chan->synth->audio_groups;
|
||||
|
||||
/*--- Init poly/mono modes variables --------------------------------------*/
|
||||
chan->mode = 0;
|
||||
chan->mode_val = 0;
|
||||
|
|
|
@ -80,6 +80,9 @@ struct _fluid_channel_t
|
|||
fluid_synth_t *synth; /**< Parent synthesizer instance */
|
||||
int channum; /**< MIDI channel number */
|
||||
|
||||
/* MIDI channel mapping to audio dry output */
|
||||
int mapping_to_out;
|
||||
|
||||
/* Poly Mono variables see macro access description */
|
||||
int mode; /**< Poly Mono mode */
|
||||
int mode_val; /**< number of channel in basic channel group */
|
||||
|
|
|
@ -357,8 +357,11 @@ fluid_voice_init(fluid_voice_t *voice, fluid_sample_t *sample,
|
|||
UPDATE_RVOICE_GENERIC_I2(fluid_rvoice_buffers_set_mapping, &voice->rvoice->buffers, 2, i + SYNTH_REVERB_CHANNEL);
|
||||
UPDATE_RVOICE_GENERIC_I2(fluid_rvoice_buffers_set_mapping, &voice->rvoice->buffers, 3, i + SYNTH_CHORUS_CHANNEL);
|
||||
|
||||
i = 2 * (voice->chan % channel->synth->audio_groups);
|
||||
/* MIDI channel mapping to dry buffers */
|
||||
i = 2 * channel->mapping_to_out;
|
||||
/* set index of audio dry left buffer */
|
||||
UPDATE_RVOICE_GENERIC_I2(fluid_rvoice_buffers_set_mapping, &voice->rvoice->buffers, 0, i);
|
||||
/* set index of audio dry right buffer */
|
||||
UPDATE_RVOICE_GENERIC_I2(fluid_rvoice_buffers_set_mapping, &voice->rvoice->buffers, 1, i + 1);
|
||||
|
||||
return FLUID_OK;
|
||||
|
|
Loading…
Reference in a new issue