iiwusynth-devel
[Top][All Lists]
Advanced

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

Re: [iiwusynth-devel] Puzzle involving multiple soundfonts


From: Peter Hanappe
Subject: Re: [iiwusynth-devel] Puzzle involving multiple soundfonts
Date: Wed, 11 Dec 2002 10:14:07 +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,

I think the synthesizer should, by default, behave as the CreativeLabs
sound cards. If that's not convenient, we'll add an option to make it
work the way we think it should. So first, how does a SBLive do it?

Cheers,
Peter


M. Nentwig wrote:
Hi,

In my understanding the 'feature' is a bug, I have encountered the same
problem.

When you load a sound font, instrument 0 is automagically assigned to
channel 0, instrument 1 to 1 etc. Convenient for lazy
single-soundfont-users like me. But it's practically impossible to use
several soundfonts at once: 'prog' or 'select' always tries to look up
the desired program from the last soundfont loaded. Only if the preset
does not exist there, then the previously loaded soundfont is tried,
etc (sound font stack).

If your two sound fonts use different bank IDs, then you can use the
'select' command:
select 0 1 2 puts instrument 2 from bank 1 into channel 0. But you said,
both are bank 0, so that doesn't work.

Here is a workaround / hack / one-line-patch (based on the latest CVS
version):
- Edit iiwusynth/src/iiwu_synth.c
- Find the following routine:

* iiwu_synth_program_reset
 *
 * Resend a bank select and a program change for every channel. This
 * function is called mainly after a soundfont has been loaded,
 * unloaded or reloaded.  */
int
iiwu_synth_program_reset(iiwu_synth_t* synth)
{
  int i;
  /* try to set the correct presets */
  for (i = 0; i < synth->settings.midi_channels; i++){
    iiwu_synth_program_change(synth, i,
iiwu_channel_get_prognum(synth->channel[i]));
  }
  return IIWU_OK;
}

- comment out one line and make install:
/* iiwu_synth_program_change(synth, i,
iiwu_channel_get_prognum(synth->channel[i])); */

That's what I did when I faced the same problem. Now you'll have to load
the programs by hand after loading a soundfont, as in
load somesoundfont.sf2
prog 0 0
load someothersoundfont.sf2
prog 1 0

Please let me know, if you have problems finding the right lines in your
version (send your iiwu_synth.c).




As a permanent solution we could limit iiwu_synth_program_reset to the
first sound font on the stack (automatic program assignment will not
happen for the 2nd, 3rd etc sound font). But maybe there are better ways
to handle this. Ideas?

-Markus








reply via email to

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