[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [iiwusynth-devel] API function to change voice parameters at play ti
From: |
Josh Green |
Subject: |
Re: [iiwusynth-devel] API function to change voice parameters at play time |
Date: |
12 May 2002 22:51:16 -0600 |
On Sun, 2002-05-12 at 12:38, M. Nentwig wrote:
> > Since Swami uses the sfloader all generators/modulators will be loaded
>
> > at note-on time. It appears from the current version of
> > iiwusynth that I
> > have that there isn't a way to load modulators yet via the
> > sfloader API.
>
> I'm not too deep into the sfloader stuff yet, but I thought that Swami
> simply replaces the functionality in iiwu_defsfont.c?
> In this case, it can add modulators with
> iiwu_voice_add_mod(voice, mod, IIWU_VOICE_ADD);
>
Found that routine. It just needs to be declared in iiwusynth.h instead
of iiwu_voice.h.
> Changing -modulators- of an already running voice doesn't look too
> attractive to me (in terms of 'headache per usefulness'). Generators,
> yes.
>
Yeah, I really don't see any reason to change modulators of an already
running voice.
>
> I see a way:
> Again, in iiwu_defsfont.c, a new voice is created with
> voice = iiwu_synth_alloc_voice(synth, sample, chan, key, vel);
>
> At this time, the unique ID of the voice is set. So you can store the
> voice and its unique ID.
> When referring to it later, use 'voice', and check, if the ID is still
> the same (and it is not off).
>
So the voice will never be de-allocated (possibility of invalid pointer
reference)? I guess that makes sense since it is desirable to stay away
from malloc/free with real time apps.
> > I see that there is already a routine called 'iiwu_voice_gen_incr' and
>
> > the *_set routine of course. These aren't real time though, but the
> > routines would look the same at least from the callers perspective.
>
> iiwu_voice_gen_incr should in fact do the job. The only drawback is,
> that the caller has to remember the amount, that it has already added to
> the generator.
>
Would iiwu_voice_gen_set also work then? That might be even better. Are
there any consequences to be had by changing a generator in the middle
of the synthesis thread processing a buffer?
> >
> > Do you think that a real time generator control API could be created
> > with relatively little effort? :)
>
> I think so. Maybe we don't need any additional functions.
>
Way cool. I'll hack around a bit and see what happens :)
>
> Try
> http://prdownloads.sourceforge.net/millisampler/iiwu_17_tar.bz2
> I was unable to test it (no MIDI interface at hand to start the synth).
> Anyway, at the moment pitch wheel sensitivity can only be accessed
> through the API function (no MIDI response, no command line equivalent).
>
I'll get to it when it comes down via CVS, i.e. too lazy.
>
> > Keep up the excellent work! Cheers.
> > Josh Green
>
> You too!
> Cheers
>
> Markus
>
Lates.
Josh Green