## 1v/oct with Max/MSP

Reaktor, MAX/MSP, VST/AU, etc. A place for all things soft....

Moderators: luketeaford, Joe., lisa, Kent

Leoespejo
Super Deluxe Wiggler
Posts: 1528
Joined: Sat May 07, 2011 5:26 am
Location: Barcelona

### 1v/oct with Max/MSP

Sorry, for the noob question, i've been searching in the forum for something similar but only found old posts.

Well, to the point, I need to send signals from Max/MSP to my analog modular synth (euro rack) to control pitch (frequency) in my oscillators, the convention in euro rack is 1 Volt per Octave.

I know i need i DC coupled audio interface, i use Expert Sleepers ES-3

I've try sending many different types of signal and there is no problem, so i think is perfectly possible.

- Frequency in Max is measured in Hz
- Frequency in Euro Rack Analog Synths is measured in Volts per Octave

So I think i have to scale in some way Max's Hz and transform them to Volts per Octave maybe multiplying, but i have try this and is not as accurate as i need.

I've posted a similar Topic in Max's Forum to cover all fronts, so please don't tell me "go to Max's forum"

Thank you in advance for any help

os
Super Deluxe Wiggler
Posts: 13325
Joined: Tue Jun 30, 2009 6:55 am
Location: UK
Contact:
The mathematical operation you're looking for is 'log' (logarithm).

usw
Veteran Wiggler
Posts: 573
Joined: Sun Aug 14, 2011 4:19 am
Location: Villeurbanne, France
To be more precise, with x being the frequency in hz you want to convert, the operation is :
log(x) / log(2)

You'll need to set "x" to your desired range (by dividing your input by 440 for example. As is, the operation will return 0v for an input of 1hz) !
ps : log is undefined for 0 and will return a complex number when given negative values

Leoespejo
Super Deluxe Wiggler
Posts: 1528
Joined: Sat May 07, 2011 5:26 am
Location: Barcelona
os use you got it !!!! thank you

I made the patch and the numbers seams to be ok i let you know after testing with the modular.

felix le chat
Veteran Wiggler
Posts: 683
Joined: Tue Aug 10, 2010 5:38 am

### Re: 1v/oct with Max/MSP

Leoespejo wrote:I need to send signals from Max/MSP to my analog modular synth (euro rack) to control pitch (frequency) in my oscillators, the convention in euro rack is 1 Volt per Octave.

[...]

- Frequency in Max is measured in Hz
- Frequency in Euro Rack Analog Synths is measured in Volts per Octave

So I think i have to scale in some way Max's Hz and transform them to Volts per Octave maybe multiplying, but i have try this and is not as accurate as i need.
Sorry but I don't understand what you mean by "Max's Hz" in this context. Of course some Max objects use Hz for measuring frequency, but I don't see why (or "where") a conversion from Hz to 1V/oct is required when controlling analogue synths from Max.

What did I miss?

Flc

darwingrosse
Wiggling with Experience
Posts: 391
Joined: Tue Apr 06, 2010 9:38 am
Location: Northfield, MN
You might want to check out stretta's vcvi stuff:

http://stretta.blogspot.com/2011/06/vcv ... rlive.html

In addition to producing the proper output, it has a way to properly scale the output. The link is for the max for live version, but I'm pretty sure there is a straight Max version floating around as well...
[ddg]

Art+Music+Technology podcast:
http://artmusictech.libsyn.com/

Modular Synth Mastery books:
http://20objects.com

Leoespejo
Super Deluxe Wiggler
Posts: 1528
Joined: Sat May 07, 2011 5:26 am
Location: Barcelona

### Re: 1v/oct with Max/MSP

felix le chat wrote:
Leoespejo wrote:I need to send signals from Max/MSP to my analog modular synth (euro rack) to control pitch (frequency) in my oscillators, the convention in euro rack is 1 Volt per Octave.

[...]

- Frequency in Max is measured in Hz
- Frequency in Euro Rack Analog Synths is measured in Volts per Octave

So I think i have to scale in some way Max's Hz and transform them to Volts per Octave maybe multiplying, but i have try this and is not as accurate as i need.
Sorry but I don't understand what you mean by "Max's Hz" in this context. Of course some Max objects use Hz for measuring frequency, but I don't see why (or "where") a conversion from Hz to 1V/oct is required when controlling analogue synths from Max.

What did I miss?

Flc
Felix, I'm not a Max's expert, But i need to send Frequency information to my Modular so i think i need to scale or to transform the Hz i have in Max to 1v/oct to make that my Oscillators repruduce those frequencies.

I'll take a look at Streta's patch but at first sight i see that he implements Midi, i don't want to use Midi as i'm using not tempered scales.

If you guys have Max/MSP take a look at this topic i made in cycling 74's forum, dowload the last version and maybe help me:

http://cycling74.com/forums/topic.php?id=39883

felix le chat
Veteran Wiggler
Posts: 683
Joined: Tue Aug 10, 2010 5:38 am
Yes, no problem, and it depends on what you want to do exactly. That said, I don't think you need to use any Hz to 1V/oct conversion actually. In digital technology, numbers mean nothing, so you can give them any interpretation.

Take an oscillator that has a 1V/oct CV input. We will assume that this oscillator has perfect 1V/oct tracking, or can be calibrated (on the module) so that it has acceptable tracking. Let's say you tune your oscillator so that it produces a C3 note when nothing (or zero volt) is plugged in the 1V/oct input.

* If you send 1V (by any means) to the 1V/oct input, then the oscillator produces a C4 note.
* If you send 3V to the 1V/oct input, then the oscillator produces a C6 note.
* If you send -1V to the 1V/oct input, then the oscillator produces a C2 note.
* If you send 0.5V to the 1V/oct input, then the oscillator produces a note between C3 and C4, which happens to be F#3 from the 12-note equal temperament scale.

If you want to divide the octave into 13 equally spaced pitches, for example C4, C#4, D4, D#4, E4, F4, F#4, G4, G#4, A4, A#4, B4, C5, then you need to send the following voltages: 1, 1+(1/12), 1+(2/12), 1+(3/12), 1+(4/12), 1+(5/12), 1+(6/12), 1+(7/12), 1+(8/12), 1+(9/12), 1+(10/12), 1+(11/12), 2

When sending Max signals between -1 and 1, the ES-3 produces different voltages as you already know.

So all you have to do is to send the right Max signal values so that the ES-3 outputs the right voltages. In case this is not clear, I prefer to precise that I am talking about Max signals ("MSP") here, not message numbers.

1. The first thing to do is to calibrate the ES-3 in software so that:
* when sending [sig~ 0] to an ES-3 output, this output produces a voltage of 0 volt
* when sending [sig~ 1] to an ES-3 output, this output produces a voltage of MAX volt, let's choose 8V for example
* when sending [sig~ -1] to an ES-3 output, this output produces a voltage of -MAX volt (-8V here).

You can do this with a multimeter and the following Max objects: [+~] (offset), [*~] (gain). Just change the offset and gain values so that you measure the right voltage with the multimeter. I don't remember if you should do [+~] then [*~] or the opposite order, but you get the idea.
When doing this calibration, be sure that you don't send values that are inferior to -1 or superior to +1 (full-scale distorsion).
This is something long to do because the outputs may all have a slightly different voltage behavior.

2. At this point, you should be able to send -8V (Max signal value -1), 0V (Max signal value 0) or +8V (Max signal value 1) with each ES-3 output.
So for sending -8, -7, 6, ..., -1, 0, 1, 2, ..., 7, 8 volts with the ES-3, you just have to send Max signal values -1, -7/8, -6/8, ..., -1/8, 0, 1/8, 2/8, ..., 7/8, 1 respectively. Here you get 16 different octaves, for example C0, C1, C2, C3, C4, ..., C15.

Then how to get intermediate notes depends on the scale.

For equal-temperament scales, this is quite easy. In those scales, the octave is perceptually equally divided into whatever number of pitches. (We start from C here, but you can change the starting pitch on the oscillator, or add a global offset value in Max).
If you choose to divide into 2 pitches, these will happen to be C and F#.
If you choose to divide into 4 pitches, these will be C, Eb, F# and A.
If you choose to divide into 3 pitches: C, E, G#.
When dividing into 12 pitches, you get the usual "western" equal-tempered scale.
Of course (and fortunately), you can also divide the octave into whatever other number of equal divisions, including 5, 7, 213, etc, and even real numbers like 12.5 or 7.34589 (with real numbers there may not be any actual octave). The pitches you get do not have a name in western music, but it's not important at all.

As an example, we choose to divide the scale equally into 7 notes. Remember that changing the control value between 0 and 1/8 spans one octave. So for getting the 7 different notes, use these values:
0 + (0/7)*(1/8) = 0
0 + (1/7)*(1/8)
0 + (2/7)*(1/8)
0 + (3/7)*(1/8)
0 + (4/7)*(1/8)
0 + (5/7)*(1/8)
0 + (6/7)*(1/8)
0 + (7/7)*(1/8) = 1/8

The next octave would be:
1/8 + (0/7)*(1/8) = 1/8
1/8 + (1/7)*(1/8)
1/8 + (2/7)*(1/8)
1/8 + (3/7)*(1/8)
1/8 + (4/7)*(1/8)
1/8 + (5/7)*(1/8)
1/8 + (6/7)*(1/8)
1/8 + (7/7)*(1/8) = 2/8

In Max you would process it like this:
(k/7)*(1/8), with k being any integer number (even negative numbers). In other words, k corresponds to the "note number", either in MIDI or in whatever other system.

You can extend this principle to non-equally tempered scales too,
for example, replace
0/7, 1/7, 2/7, ..., 7/7
by
0/7, 1.1/7, 1.9/7, 3.1/7, 3.9/7, 5.1/7, 5.9/7, 7/7

Silent Way does nearly all this, and also a lot more (envelopes, polyphony management, automatic VCO calibration, etc)

Flc

Leoespejo
Super Deluxe Wiggler
Posts: 1528
Joined: Sat May 07, 2011 5:26 am
Location: Barcelona
Felix, thank you very, very much for your answer and help. I'm at work now sand can't try to implement your advice, anyway, i'll do it, and i'll let you know the results.

Ones again thank you

Javidondebass
Learning to Wiggle
Posts: 6
Joined: Mon Nov 27, 2017 8:32 am

### 1v/oct with Max/MSP

buenas Leo, wiggleando me he encontrado con una hilo tuyo donde se habla de la conversión entre hz (max) y v/oct (modular).

me hallo en la misma situación que tu describes, tratando de controlar el modular con el max y un expert sleepers, en mi caso la ES8

queria preguntarte si resolviste algún patch para dicho propósito y serias tan amable de compartir la info, muchas gracias!

Javi P.

darwingrosse
Wiggling with Experience
Posts: 391
Joined: Tue Apr 06, 2010 9:38 am
Location: Northfield, MN

### Re: 1v/oct with Max/MSP

Javidondebass wrote:buenas Leo, wiggleando me he encontrado con una hilo tuyo donde se habla de la conversión entre hz (max) y v/oct (modular).

me hallo en la misma situación que tu describes, tratando de controlar el modular con el max y un expert sleepers, en mi caso la ES8

queria preguntarte si resolviste algún patch para dicho propósito y serias tan amable de compartir la info, muchas gracias!

Javi P.
Working with an ES-8 is especially easy, since it is close to 'auto-calibrated' from the factory. At least in my case, there is a pretty direct mapping of signal values to voltage output.

For example, if I output a [sig~ 1.0] to one of the ES-8 outputs, I get 5 volts out of that output. If I send a [sig~ 0.0], I get 0 volts.

So, for every 0.2 level of signal, I get an octave of CV output, or approx 0.01666/semitone.

If you want to create notes from frequencies, you could use an ftom, then convert the MIDI value into something that maps to that range (I would use something like [scale 60 120 0.0 1.0], if you don't mind lower notes producing negative voltages) and you have everything you need.

As someone else said - the numbers are arbitrary, it's all about what the ES-8 does with the numbers!

[ddg]
[ddg]

Art+Music+Technology podcast:
http://artmusictech.libsyn.com/

Modular Synth Mastery books:
http://20objects.com

Common Wiggler
Posts: 182
Joined: Mon Aug 04, 2014 3:52 pm
Location: Austin, TX, USA
Contact:
expert sleepers provides max externals - have you tried those yet? Might be easier than rolling your own!

http://www.expert-sleepers.co.uk/index_ ... ilable.php

fuzzy_dunlop
Learning to Wiggle
Posts: 12
Joined: Wed Apr 08, 2020 9:05 pm
Location: Austin, TX

### Re: 1v/oct with Max/MSP

Hey, y'all!

It took me a while to piece it all together but I was able to figure out a fairly simple solution for this, in case anyone else who isn't calculus-savvy would like to save some time.

I'm using an ES-8 interface, sending CV to the V/OCT inputs on a Doepfer A-111-4 Quad VCO, whose V/OCT Input is tuned to 0 = C3.

Hz to V/OCT conversion for ES-8:
You do not have the required permissions to view the files attached to this post.

Polyterative
Common Wiggler
Posts: 139
Joined: Wed Jan 08, 2020 8:33 am
Location: Italy
Contact:

### Re:

usw wrote:
Sat May 12, 2012 3:32 pm
To be more precise, with x being the frequency in hz you want to convert, the operation is :
log(x) / log(2)

You'll need to set "x" to your desired range (by dividing your input by 440 for example. As is, the operation will return 0v for an input of 1hz) !
ps : log is undefined for 0 and will return a complex number when given negative values
Did not know.
The math here is surprisingly simple and elegant
Rack / Music / Instagram / Module demos
► Show Spoiler

xntrk
Common Wiggler
Posts: 80
Joined: Thu Apr 30, 2020 7:55 am

### Re: 1v/oct with Max/MSP

darwingrosse wrote:
Sat Oct 06, 2018 7:49 pm
For example, if I output a [sig~ 1.0] to one of the ES-8 outputs, I get 5 volts out of that output. If I send a [sig~ 0.0], I get 0 volts.
Did you have to mess around with the output gain settings on Max? Changing the master gain drastically impacts the output voltages I'm seeing. How can you set the gain so that you get reasonable tracking?

darwingrosse
Wiggling with Experience
Posts: 391
Joined: Tue Apr 06, 2010 9:38 am
Location: Northfield, MN

### Re: 1v/oct with Max/MSP

I just left it at the default - that seems to work for me. But yeah - anything that messes with the output "volume" will directly affect the output voltages of the ES device.
[ddg]

Art+Music+Technology podcast:
http://artmusictech.libsyn.com/

Modular Synth Mastery books:
http://20objects.com

Xomrys
Common Wiggler
Posts: 67
Joined: Wed Feb 26, 2020 12:54 am

### Re: 1v/oct with Max/MSP

Sometimes the tracking of the analog VCO will be off from 1V/Oct, or could even be nonlinear in high frequencies for example.
Ideally you'd have some sort of a calibration feedback loop where the Max patch listens to the sound and builds its own table. You don't want this feedback loop running 'live', but you can press a button, have it learn a tuning, and then hope that it will hold the rest of the session (if you do this when the gear has warmed up to constant temprerature, it usually will.

The idea of a custom tuning table can be used for other tunings (just intonation etc.) It can also be used to manage things like slope generators being used as oscillators, where the tracking is extremely nonlinear and no attempt has been made for it to conform to any V/Oct standard.