[linux-audio-dev] XAP: Pitch control

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: [linux-audio-dev] XAP: Pitch control
From: David Olofson (david_AT_olofson.net)
Date: Mon Dec 09 2002 - 14:45:22 EET


I was in this long thread about pitch control on the VST list, and I
think I learned a few things. (For a change! ;-D)

There are times when continous, linear pitch (what I have in
Audiality) is perfectly fine - and in those cases, it's by far, the
simplest possibly way you can control pitch of a synth. You get note
pitch, pitch bend, continous pitch control over the whole range,
whatever scales you like and all that, using *only a single
pitch->frequency conversion* somewhere in your synth code.

I will bet almost anything that there simply cannot be an easier way
of dealing with this.

*However*, in some cases, you may not be all that interested in the
actual pitch, but rather just want to deal with the notes in whatever
scale the user wants to deal with. One example would be a simple,
basic arpeggiator. Sure, you *could* do that with linear pitch, but
then the plugin would have to either assume that you want 12tET (or
whatever), or you need a way to tell it what scale you want to use
for the output. (Note that the kind of arpeggiator I'm thinking about
here may be expected to generate a full, modulated chord from a
single note, so it can't just look at a full input chord and pick the
exact pitches from that.)

In that case, you'd much rather have input more similar to integer
MIDI pitch, and *possibly* pitch bend to go with that. This could
indeed be expressed as "linear pitch" as well (float; 1.0 per
octave), but with one very important difference: it would actually be
1.0 per *note* - where what a "note" is is not strictly defined or
known to the plugin. The plugin just assumes that the user knows what
0-4-7 means, if he/she enters that for "arpeggio offsets". The plugin
also assumes that the user will put a suitable note_pitch to
linear_pitch pitch converter in between the output and the synth, or
that the synth understands note_pitch events.

Note that linear_pitch = note_pitch * (1.0/12.0) for 12teT, so these
"conerters" (or note_pitch support) can be very trivial to implement.
If you want "weird" scales, it gets slightly more complicated, but
the *major* point here is that no synth plugin is required to do this
- and still, every synth plugin can use any scale!

(How many VSTi plugins actually support non-12tET scales? ;-)

Hmm... As to having a synth support *both* note_pitch and
linear_pitch controls, I suppose that would effectively just be a
dual interface to a single internal control value. Send something to
linear_pitch, and it goes directly into the internal pitch variable.
Send it as note_pitch, and it gets multiplied by (1.0/12.0) or is
passed through an interpolated "weird scale" table first. Makes sense?

//David Olofson - Programmer, Composer, Open Source Advocate

.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. |
| RT and off-line synth. Scripting. Sample accurate timing. |
`---------------------------> http://olofson.net/audiality -'
.- M A I A -------------------------------------------------.
| The Multimedia Application Integration Architecture |
`----------------------------> http://www.linuxdj.com/maia -'
   --- http://olofson.net --- http://www.reologica.se ---


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Mon Dec 09 2002 - 14:53:26 EET