iiwusynth-devel
[Top][All Lists]
Advanced

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

[iiwusynth-devel] Re: Swami: No sound in iiwusynth


From: Josh Green
Subject: [iiwusynth-devel] Re: Swami: No sound in iiwusynth
Date: 19 Jun 2002 11:02:23 -0600

On Wed, 2002-06-19 at 01:17, M. Nentwig wrote:
> Hei,
> 
> I found the problem, why Swami doesn't produce any sound with Iiwusynth.
> It is indeed related to the default modulators: Swami creates two
> modulators for MIDI controller 7 and 11, which have the wrong polarity.
> So each of them adds 96 dB of attenuation. Setting their amount to 0 in
> Swami fixed the problem temporarily.
> There is no need to create default modulators, Iiwusynth will add them
> by itself.
> Probably it's more interesting to turn them off: Create an identical
> modulator with negative amount. The definitions are in iiwu_synth.c, for
> example
> 
>  /* SF2.01 page 55 section 8.4.5: MIDI continuous controller 7 to
> initial attenuation*/
>   iiwu_mod_set_source1(&default_att_mod, 7,                     /*
> index=7 */
>                        IIWU_MOD_CC                              /* CC=1
> */
>                        | IIWU_MOD_CONCAVE                       /*
> type=1 */
>                        | IIWU_MOD_UNIPOLAR                      /* P=0
> */
>                        | IIWU_MOD_NEGATIVE                      /* D=1
> */
>                        );
>   iiwu_mod_set_source2(&default_att_mod, 0, 0);                 /* No
> second source */
>   iiwu_mod_set_dest(&default_att_mod, GEN_ATTENUATION);         /*
> Target: Initial attenuation */
>   iiwu_mod_set_amount(&default_att_mod, 960.0);                 /*
> Amount: 960 */
> 
> To debug modulators, edit iiwusynth and uncomment the dump_modulators
> line in iiwu_voice.c:
> 
>  for (i = 0; i < voice->mod_count; i++) {
>     iiwu_mod_t* mod = &voice->mod[i];
>     iiwu_real_t modval = iiwu_mod_get_value(mod, voice->channel, voice);
> 
>     int dest_gen_index = mod->dest;
>     iiwu_gen_t* dest_gen = &voice->gen[dest_gen_index];
>     dest_gen->mod += modval;
>     /*      iiwu_dump_modulator(mod); */
>   };
> 
> Or put some printfs there, that's what I did.
> Warning: dump_modulator is a bit buggy (some source names are muddled up
> with CCs); will be fixed soon.
> 
> Cheers
> 
> Markus

Thanks for spotting this. I figured out the problem with Swami. When
converting libInstPatch modulators to iiwusynth modulators I was |'ing
the value of a ?: construct for the CC flag. I didn't have parentheses
around the whole ?: construct so the test was being or'ed. Oops, this
was messing up all the flag fields.
Something I was wondering about. To split out the controller and flags
fields for iiwusynth I'm not using the enumerations directly, but
instead shifting the flags by 8 and then or'ing the CC flag in, I'm
assuming the iiwusynth modulator enumerations probably wont change,
right?
Concerning not requiring the default modulators. I don't see how this is
going to work right. What happens if there is a generator at the preset
level that is identical to a default modulator? In this case it should
be combined with the default modulator and the amount fields added. I
guess I could use IIWU_VOICE_ADD for preset modulators but I would then
need to put this in my generic layering routine (calls a callback
routine for each voice in a SoundFont item) which doesn't make sense. I
suppose if this makes the most sense for iiwusynth, I could ditch my
generic foreach layer routine and just write a custom one with
IIWU_VOICE_ADD for presets, but this seems messy.
I guess just doing things the way they are just means that there is the
added overhead of setting the default modulators twice, perhaps this
isn't really an issue then. Cheers!
        Josh

P.S My changes aren't in CVS yet, and I don't think they will be for a
couple days (until I get internet access again).




reply via email to

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