Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

From what I know, typically people would use a pre-bend to achieve microtonalism in MIDI. In MIDI, like in most strictly-musical encodings, notes are specified in terms of semitones, with cents modifying those values. A cent is defined as 1% of a semitone. With a tuning reference (f), like 432 Hz, we can calculate the frequency a number of steps away with this handy function:

  f' = f * 2 ^ (i / 12)
where f' = frequency to be solved, f = reference frequency i = steps/interval (semitone distance from reference)

This works with micro-semitones, and/or negative values. So for example, if we want to know what 1.5 steps above 432 Hz is we would plug in the variables:

  f' = 432 Hz * 2 ^ (1.5 / 12) ~= 471.0993 Hz
In the case where you know frequencies, and want to get the semitone steps, you're taking the base 2 log. So,

  i = log2(f' / f) * 12
Now you'll have the note value of the exact frequency, and you can use the decimal part to set your pre-bend.

With the two directions' functions defined it's not so hard to go between frequencies and "notes". And no, you won't be in tune with most gear unless you're using 12TET A5=440Hz



That is a most thorough answer and I appreciate it very much :-)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: