back to list

subverting 12-edo open source synth tuning -- an experiment

🔗Aaron Krister Johnson <aaron@...>

1/6/2007 9:50:33 PM

Hey all,

It occured to me to try to 'retune' a softsynth tuning-table, one that
hadn't been designed for microtonality. In this case, it was
'whysynth', a DSSI-softsynth for Linux.

After looking at the source code, I was able to glean where in the
code the pitch factor arrays were filled, and I was able to for
instance change the '12.0f' in this code, to the number '17.0f' to get
17-edo: (the 'f' in the C language indicates a floating-point number,
in case you wonder)

/* MIDI note to pitch */
for (i = 0; i <= 128; ++i) {
pexp = (float)(i - 69) / 12.0f;
y_pitch[i] = powf(2.0f, pexp);
}

In this case, the 'y_pitch' variable is an array, being filled element
by element (the '[i]' is the array index) with pitch factors that
correspond to MIDI note numbers. The '69' is A above middle-C, so this
table is A440-centric, clearly.

One could even, for non-edos, write a script in Python (or pick your
scripting language of choice) and fill this source code with someting
like this

float y_pitch[127] = {
0.0000, 0.whatever, 0.whatever......
}

Which could hard-codewise predefine a JI, a well-temperament, or
whatever, that one could calculate pitch factors for, from MIDI-note 0
to MIDI-note 127. Then you recompile, and boom, you have some
subverted software for our particular fetish...

This is I know a rool-up-your-sleeves-and-get-dirty approach to
getting more MMM software, but it's better than nothing, or waiting
for a developer to do your bidding, and it shows an certain advantage
of the open source software paradigm, at least for those
do-it-yourselfers who have no fear to learn a little code and want to
enable more cool instruments to do our work!

At least, it's no more or less challenging than doing a homemade
decent acoustic instrument...

-A.