Frequency to Midi WITH pitch-bend?

donundeen's icon

Hi,
I've been looking at ftom for converting frequency numbers to midi note numbers, but I'd also like to get more discrete pitch control of my synthesizer, using pitch bend messages as well.
Assuming I can set the pitch wheel width on my Novation to 1/2 step, what's the best way to convert frequency into midi note, and pitch-bend values? The equation for ftom ( expr log10($f1/8.175798) / log10(1.0594633) ) sort of blows my mind, so I'm thinking calculating the pitch-bend would be some sort of similar type of equation.
Surely someone else has already figured this out?

thanks all!
don

barry threw's icon

I don't feel particularly good about this patch, but I think it does
what you want...

b

Max Patch
Copy patch and select New From Clipboard in Max.

On Feb 4, 2008, at 6:22 PM, don undeen wrote:

>
> Hi,
> I've been looking at ftom for converting frequency numbers to midi
> note numbers, but I'd also like to get more discrete pitch control
> of my synthesizer, using pitch bend messages as well.
> Assuming I can set the pitch wheel width on my Novation to 1/2 step,
> what's the best way to convert frequency into midi note, and pitch-
> bend values? The equation for ftom ( expr log10($f1/8.175798) /
> log10(1.0594633) ) sort of blows my mind, so I'm thinking
> calculating the pitch-bend would be some sort of similar type of
> equation.
> Surely someone else has already figured this out?
>
> thanks all!
> don

--
Barry Threw
Media Art and Technology

San Francisco, CA
Work: 857-544-3967
Email: bthrew (at) gmail (dot) com
IM: captogreadmore (AIM)
http://www.barrythrew.com

"The greatest of the changes that science has brought us is the acuity
of change; the greatest novelty the extent of novelty."
- J. Robert Oppenheimer

Stefan Tiedje's icon

don undeen schrieb:
> The equation for ftom ( expr log10($f1/8.175798) / log10(1.0594633) )
> sort of blows my mind, so I'm thinking calculating the pitch-bend
> would be some sort of similar type of equation. Surely someone else
> has already figured this out?

You would just translate the fractional part of the ftom result to a
pitchbend value, but beware, the range of the pitchbend is not
standardized, and could be anything between a half step and two octaves.
You define it on the receiving synth. Just scale the fractional part to
the pitchbend value (not tested):

Max Patch
Copy patch and select New From Clipboard in Max.

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com

Stefan Tiedje's icon

Stefan Tiedje schrieb:
> Just scale the fractional part to the pitchbend value (not tested):

Just realised, the proposed scaling is bending over the half step
instead of a quarter step, but you get the idea. (I'll leave the further
bug fixing to you... ;-)

Max Patch
Copy patch and select New From Clipboard in Max.

--
Stefan Tiedje------------x-------
--_____-----------|--------------
--(_|_ ----|-----|-----()-------
-- _|_)----|-----()--------------
----------()--------www.ccmix.com

Gary Lee Nelson's icon

This brings back memories. Before multi-timbral synthesizers there was a
dinosaur called the Yamaha TX816. It was 8 TX7 in a box. Each could play
one timbre at a time and reach had its own pitch bend wheel. To achieve
microtonality we used the fractional part of a midi number to set the pitch
bend position (see patch below). In my 1988 piece "Fractal Mountains" (link
below) you can hear this. It in 96 tones per octave.

NOTE: Pitch bend changes everything in the channel so notes already sounding
will bend too.

Max Patch
Copy patch and select New From Clipboard in Max.

On 2/5/08 3:12 AM, "barry threw" wrote:

> I don't feel particularly good about this patch, but I think it does
> what you want...
>
> b
>
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P comment 430 250 54 196617 Pitch Bend;
> #P number 395 250 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 395 229 109 196617 scale -0.5 0.5 -64 63;
> #P newex 551 206 33 196617 - 1.;
> #P newex 395 187 166 196617 if $f1 < 0.5 then $f1 else out2 $f1;
> #P number 18 250 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 18 146 374 196617 expr int($f1)+($f1>=0)*(($f1-
> int($f1))>=0.5)-($f1
> #P newex 395 146 29 196617 t f i;
> #P newex 395 167 29 196617 - 0.;
> #P newex 18 123 228 196617 expr log10($f1/8.175798) / log10(1.0594633);
> #P flonum 18 106 66 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P comment 53 250 110 196617 Base MIDI Note Number;
> #P connect 3 0 7 0;
> #P connect 2 0 5 0;
> #P fasten 2 0 4 0 23 143 400 143;
> #P connect 9 0 10 0;
> #P fasten 8 0 9 0 556 226 400 226;
> #P connect 7 0 9 0;
> #P connect 7 1 8 0;
> #P connect 5 0 6 0;
> #P connect 4 1 3 1;
> #P connect 4 0 3 0;
> #P connect 1 0 2 0;
> #P window clipboard copycount 12;
>
>
> On Feb 4, 2008, at 6:22 PM, don undeen wrote:
>
>>
>> Hi,
>> I've been looking at ftom for converting frequency numbers to midi
>> note numbers, but I'd also like to get more discrete pitch control
>> of my synthesizer, using pitch bend messages as well.
>> Assuming I can set the pitch wheel width on my Novation to 1/2 step,
>> what's the best way to convert frequency into midi note, and pitch-
>> bend values? The equation for ftom ( expr log10($f1/8.175798) /
>> log10(1.0594633) ) sort of blows my mind, so I'm thinking
>> calculating the pitch-bend would be some sort of similar type of
>> equation.
>> Surely someone else has already figured this out?
>>
>> thanks all!
>> don
>
> --
> Barry Threw
> Media Art and Technology
>
> San Francisco, CA
> Work: 857-544-3967
> Email: bthrew (at) gmail (dot) com
> IM: captogreadmore (AIM)
> http://www.barrythrew.com
>
> "The greatest of the changes that science has brought us is the acuity
> of change; the greatest novelty the extent of novelty."
> - J. Robert Oppenheimer
>

Cheers
Gary Lee Nelson
Oberlin College
www.timara.oberlin.edu/GaryLeeNelson

nick rothwell | project cassiel's icon

On 5 Feb 2008, at 16:03, Gary Lee Nelson wrote:

> This brings back memories. Before multi-timbral synthesizers there
> was a
> dinosaur called the Yamaha TX816. It was 8 TX7 in a box.

To be pedantic: eight TF1's. (There was also a rack unit called a
TX216, which was two TF1's and a chunk of empty space...)

    -- N.

Nick Rothwell / Cassiel.com Limited
www.cassiel.com
www.myspace.com/cassieldotcom
www.last.fm/music/cassiel
www.reverbnation.com/cassiel
www.linkedin.com/in/cassiel
www.loadbang.net