Pitch Modulation with Groove~

Isosceles_CAT's icon

Hi, I'm working on a basic sampler patch. I'm translating MIDI note messages into values that groove can use with the expr object:

<>

Unfortunately, math is not my strong point, and I'm not even sure how I came up with those values, but they seem to work well.

Anyway, I wanted to add pitch modulation by adding the modulator to the midi note number before it goes into the expr object. However, expr is not an MSP object, and I can't seem to find an MSP equivalent.

I'd strongly prefer to use only standard Max/MSP objects and figure this out myself, but can anybody please point me in the right direction?

Thanks kindly,
Joshua

Trum's icon

Actually you dont need to muck about with expr too much- you can get the correct results with mtof (midi to frequency) - theres even a float version in the help file that uses a similar expression.

Anyway - what do you mean by modulator? do you plan to transpose the notes up or down or something more complicated - either way, the notes are not msp till they get into groove itself - so you can do whatever you want with the numbers.

If what you actually want is to transpose the actually sound coming out of groove you'll need to use something like gizmo~ (an fft based pitch transposer)

Hope this clears things up a little any more questions just ask

T

Isosceles_CAT's icon

Thanks for the reply. I'm realizing that my initial description of the problem was insufficient.

I'm looking for a curve that works like this:
In - Out
72 = 2.
60 = 1.
48 = 0.5
36 = 0.25
...etc

So that when I hit middle C, groove plays the sample back at 1X pitch, and then one octave lower plays the sample at half speed, etc. I was doing this with expr and pow.

What I meant by pitch modulation is adding the output of a cycle~ to the midi note value before it gets converted to groove friendly values. So, a cycle with an output ranging from -1 to +1 will produce a pitch modulation of -1 and +1 notes at the frequency of the cycle~... Hopefully resulting in an effect which can range from subtle vibrato to more pronounced FM like effects (depending on the amplitude and frequency of the cycle). Does that make sense?

Lewis Keller's icon

Quote: Isosceles_CAT wrote on Tue, 17 April 2007 09:51
----------------------------------------------------
> So that when I hit middle C, groove plays the sample back at 1X pitch, and then one octave lower plays the sample at half speed, etc. I was doing this with expr and pow.
>
> What I meant by pitch modulation is adding the output of a cycle~ to the midi note value before it gets converted to groove friendly values. So, a cycle with an output ranging from -1 to +1 will produce a pitch modulation of -1 and +1 notes at the frequency of the cycle~... Hopefully resulting in an effect which can range from subtle vibrato to more pronounced FM like effects (depending on the amplitude and frequency of the cycle). Does that make sense?
>
----------------------------------------------------
Try this, I think it's what you're after. The one on the left is how you describe it working but since the modulation is going from signal domain, to scheduler domain and back again it will be limited in how fast it can go and still sound good. The one on the right keeps the modulation in the signal domain. However, I didn't do all of the math to make the width controls work the same on both versions, I thought you could work that part out. :)

Lewis

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

Lewis Keller's icon

Sorry, I forgot that mtof has a msp equivalent mtof~. Ignore my last post and try this instead:

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

Isosceles_CAT's icon

Perfect, brilliant, thanks! :)

Roman Thilenius's icon

Quote: Isosceles_CAT wrote on Tue, 17 April 2007 10:51
----------------------------------------------------
> Thanks for the reply. I'm realizing that my initial description of the problem was insufficient.
>
> I'm looking for a curve that works like this:
> In - Out
> 72 = 2.
> 60 = 1.
> 48 = 0.5
> 36 = 0.25
> ...etc

i once started exactly like you here with this list of numbers
and then came up with [110.nntr], formerly known as [110.nn2r].

you could consider it a derivate of [mtof] but with a differnet
base and offset.

mtof:

[expr (440. * exp(.057762265 * ($f1 - 69.)));]

110.nntr:

[+ 9]
[expr (1. * exp(.057762265 * ($f1 - 69.)));]

the offset of "+9" is the difference between note number
60 and 440 Hz, and the base is 1. because we are calcculating
what i called "rate or playspeed" in my naivity.

hth,

-110

flowdesigner's icon

what is the reason for 261,62558 being the number?

Im using this for gizmo~

Justin G's icon

261.62558 hertz is the frequency of note C4. see this text by Ronald Keith Parks:
http://faculty.winthrop.edu/parksr/images/parks_specfilt.pdf
specifically, section 2.1 "frequency shifting"

Emmanuel Jourdan's icon

It is worth noting that there's an abstraction called transratio in Max's search path which might just to what you want… or not…