octal-dev
[Top][All Lists]
Advanced

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

[Octal-dev] possible API cleanup: opinions, please?


From: Dave O'Toole
Subject: [Octal-dev] possible API cleanup: opinions, please?
Date: Tue, 20 Jun 2000 15:50:11 -0400

Avelino wrote:

> void ox_update(machine *m) {
>         svfilter_state *s;
>         float cut, res;
> 
>         s = (svfilter_state *) m->state;
>         cut = (float) m->params[0][ix_cutoff];
>         res = (float) m->params[0][ix_resonance];
>         /*  Scale [0..255] to [0..1]. */
>         cut /= 255.0;
>         res /= 255.0;
>         s->freq = cut;
>         s->reso = res;
>         s->filter_type = (int) m->params[0][ix_filter_type];
>         return;
>         }


According to the OX_API Developer's Guide (hereafter referred to as
"TDG") in the section on ox_update, Octal is going to send the value
"nochange" whenever the value of a column/parameter has not changed.
(the above code will break on blank parameter cells in the sequence, for
which OCTAL would send the value -1 for nochange.) 

At the time this seemed like a good way to avoid having to recalculate
things when the param hasn't changed. However, I am starting to think
that this is more trouble than it's worth, for both the machine coder
and for the host. The additional comparison probably doesn't save much
over just performing the multiply. 

So from now on, I suspect that we can just pass the parameters to the
machine again even though they haven't changed. Can anyone offer some
opinions on this? 

BTW, however, the one place where this still **must** happen is in note
values. That is, we must be able to distinguish the start of a note from
the start of a new note with the same value. Recieveing the value "D-4"
over and over again should make you *start the note* again and again.
Therefore we need a "no change" value, which is, conveniently, the enum
constant "nochange." 

My current proposal is to use "nochange" only for notes and triggers,
which are not semantically the same thing as parameter changes.
Otherwise, you'll just keep recieving the same value until it changes.
Any thoughts? 


-- 
@@@ david o'toole
@@@ address@hidden
@@@ www.gnu.org/software/octal


reply via email to

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