iiwusynth-devel
[Top][All Lists]
Advanced

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

[iiwusynth-devel] Multi channel output and number of midi channels


From: Peter Hanappe
Subject: [iiwusynth-devel] Multi channel output and number of midi channels
Date: Tue, 26 Nov 2002 19:04:08 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020623 Debian/1.0.0-0.woody.1

Hi all,

I'd like to propose two changes:

- set the number of midi channels
- multi track audio output

I have a test implementation of both in my local CVS copy.

The first one is pretty simple, there's an additional field in
iiwu_synth_settings (midi_channels) and a new API function
'iiwu_synth_count_midi_channels'. The number of midi channels should
be at least 16.

The second is fairly trivial, too. Two new fields in
iiwu_synth_settings (audio_channels and effects_channels). In
addition, three new API functions: 'iiwu_synth_count_audio_channels',
'iiwu_synth_count_effects_channels'

int iiwu_synth_nwrite_float(iiwu_synth_t* synth, int len,
                            float** left, float** right,
                            float** fx_left, float** fx_right);

Only the last function needs some explanation, I guess. The function
expects two arrays of buffers for the left output and right output of
the midi channels, and two arrays of buffers for the output of the
reverb and chorus.

The number of buffers for left/right output should be equal to the
number of audio channels. The number of buffers for the effects should
be equal to the number of effects channels.

By default, the number of audio channels is 1 and the number of
effects channels is 2. The master left output is stored in the buffer
left[0].  The master right output is stored in right[0]. Reverb is
written to fx_left/right[0], and chorus to fx_left/right[1].

Important: the number of effects channels is currently not used, yet,
but is for future use. It is currently always equal to 2.

MIDI channel 0 outputs audio to left/right[0], midi channel 1 to
left/right[1],... When the number of midi channels is bigger than the
number of audio channels, it simply wraps around. For example, if the
number of audio channels is 4, midi channel 4 ouputs to left/right[0],
midi channel 5 to left/right[1], ...

All channels write the reverb and chorus output to the same fx buffer,
i.e. the effects output of all channels are mixed. The rationale is
that that is how a mixing console works: the 'Aux' channels on a
console mix all the input channels according to the 'aux send'.  This
strategy also limits the number of buffers used.

I decided to keep the left/right output and didn't restrict the output
to mono. This would mean more important changes to the code. With the
current proposition, applications can still use the pan, chorus and
reverb of the synth, but do more complex mixing if it wants to.

I have implemented the above scheme, but haven't done much testing,
yet, especially of the multi channel output. All I can say is that
both applications still work as before!

Cheers!

Peter





reply via email to

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