[LAD] making 'whysynth' microtonal/tuning-table capable

Aaron Johnson aaron at akjmusic.com
Tue Apr 28 13:36:54 UTC 2009


Jens,

Hi, thanks for the reply....your proposal gets us halfway there, but I'm
thinking more being able to load SCALA files at runtime, have them parsed,
and then load the array...this is what I meant by 'dynamic'...a finite
number of fixed scales > 1 is better than 1, but still, ideally, we'd want
some flexibility, no?

Best,
AKJ


>
> On Mon, Apr 27, 2009 at 11:09 PM, Jens M Andreasen <
> jens.andreasen at comhem.se> wrote:
>
>>
>> On Mon, 2009-04-27 at 21:39 -0700, Aaron Johnson wrote:
>> > Hi all,
>> -<snip>.
>> > here's the code snippet from 'whysynth_voice_render.c'
>> >
>> >    /* MIDI note to pitch */
>> >     for (i = 0; i <= 128; ++i) {
>> >         pexp = (float)(i - 69) / 12.0f;
>> >         y_pitch[i] = powf(2.0f, pexp);
>> >     }
>> >
>>
>> You'll need to find the declaration of y_pitch[MAX_NOTES] first and
>> change that to say y_pitch[MAX_SCALES][MAX_NOTES] and then also change
>> every access from y_pitch[NOTE] to y_pitch[current_scale][NOTE] where
>> current_scale is a new (possibly global) variable initially set to zero
>> and NOTE is the original indexing variable. Don't worry ... GCC will
>> tell you where if you missed something :)
>>
>> Say MAX_SCALES == 2 you can then
>> 1) implement the second scale. For now setting everything to A440 will
>> do as proof of concept, and then later you can calculate or load
>> something sensible from a file.
>> 2) make a single button that will set the value of current_scale to 1 or
>> 0, thus changing between the two scales. Radiobuttons might be a better
>> choice for more scales, but then you'd need to read more GTK docs up
>> front.
>>
>>
>>
>>
>>
>
>
> --
>
> Aaron Krister Johnson
> http://www.akjmusic.com
> http://www.untwelve.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20090428/488d3bd7/attachment.html>


More information about the Linux-audio-dev mailing list