change control changes 0-127 to -24 to +24 integer semitones

Learn about building and using Max for Live devices.
Post Reply
alien factory
Posts: 119
Joined: Mon Jun 04, 2007 5:17 pm
Location: Mannheim / Germany
Contact:

change control changes 0-127 to -24 to +24 integer semitones

Post by alien factory » Wed Dec 21, 2011 11:58 pm

Hi Max Professionals,

I'm looking for a way to change the control changes from my Kore2 controller which outputs values from 0 to 127 into integer semitone values from -24 to +24 for the tuning of my Phosycon plug-in.

Setup a the moment:

Kore2 knob is midi mapped to the tuning parameter of my Phosycon Plug-in

Result is that the tuning goes linear from -24 to +24 with all the in between values like -12.57 , 11.34, 8.28 , etc.

What I need is something in between that changes the control changes into integer values, so the tuning is always "in tune" with getting integer numbers (-24, -23, -22, -21, -20, -19, -18, -17 etc.)

I hope I could made clear what I mean...

Is there already some max device for this?

I already looked through maxforlive.com but found nothing...

Any help is appreciated...

cheers
Stefan
Macbook Pro 2.5 Ghz, Intel Core 2 Duo, 2GB RAM, LIVE 8.1, Novation SL37, APC40, M-Audio Firewire410, ProTools 8 LE, Reason 4, Waves Native Power Pack, Music Production Toolkit 2, Stylus RMX, NI Komplete&Kore

http://www.myspace.com/stefanhollaender

spectro
Posts: 5
Joined: Mon May 30, 2011 1:42 pm

Re: change control changes 0-127 to -24 to +24 integer semitones

Post by spectro » Thu Dec 22, 2011 8:30 am

You may be able to sort this by creating a group containing the plug-in (right click on plugin window header), then mapping the parameter to a macro dial (which is in turn controlled in turn by the Kore 2 knob) , which should allow the 0 -127 range map properly to the -24 - +24 values you require.

alien factory
Posts: 119
Joined: Mon Jun 04, 2007 5:17 pm
Location: Mannheim / Germany
Contact:

Re: change control changes 0-127 to -24 to +24 integer semitones

Post by alien factory » Thu Dec 22, 2011 1:28 pm

thanks for the reply, but thats the way I did this, because I have some more plug-ins afterwards and wanted to save the whole group.

The range is indeed right from -24 to +24, but my problem is that when I turn the knob the values are like I described and not only integer values.

:-(
Macbook Pro 2.5 Ghz, Intel Core 2 Duo, 2GB RAM, LIVE 8.1, Novation SL37, APC40, M-Audio Firewire410, ProTools 8 LE, Reason 4, Waves Native Power Pack, Music Production Toolkit 2, Stylus RMX, NI Komplete&Kore

http://www.myspace.com/stefanhollaender

monolake
Posts: 119
Joined: Sun Mar 09, 2003 9:42 am
Location: Berlin
Contact:

Re: change control changes 0-127 to -24 to +24 integer semitones

Post by monolake » Thu Dec 22, 2011 4:01 pm

<pre><code>
----------begin_max5_patcher----------
750.3oc2WE0biBBD9YyuBFeN0QPMF6a282nSmLXfzxcJ3nXtzqS+ue.Jolqp
wlz5z6dIFVVV91O1cY44ENtohCzJWvsf6.NNOuvwwHRKvocriaN9v1LbkQM2
cYBdct6xlo1I3xJ1uo5of9d9shUZv3YToYIvWEJpkVonVoEX41GY7G1TR2Ja
.Rvp0JKAPqg5OQZyBfJQf6aWCiXfhH8G2.C6BENN2.E2uUxvYfuKxH1oa1Z4
SEzlMQ6HXo6RfaJl+fK3dsZurXg9mkSjK3zeovfcGjzCFGvsTTyIuGFB0KCA
OOCEFZ3F+wonfKkhtLVYqHOmxkugVRU1lVd60G53OBwjjnohvHyunwnk0miU
tj.h57TZ4bjb.CRNexQxkdvy3WYlwLVk.FMgpD9e8pRTsEmQA9d.HJ1CbCJz
SkO68dnrUWXYC353lxFqFkyfyaYiL1dpGQYbqc2iKOtqGm7N38teHgOnj.s2
uxPEM0QCiGfIPC6pKsgHGWXAtTgZUktMTNNMi1EcU38TxFrTVxRqkzW+WUKw
zxLZmOqlJ1YEak207pTrGFifNQ4bAQwVlpm1foSMFi+Ssw5Vf8MFPPnCMMiu
SX.ReadMm0bdz6rhRhpl4.1kP2M7jUETJIikan3dcqJIsXPWhdnPv02TM3xY
78rJV6gn+Pdl7ogU.y4BIVxD7MGOq587QkKXvAJtWjjO5omMhreefIUwEchF
6kndTTJeazzPgRc.aiBljc6mOnFFpX4EYzO2FFP9QcZXXzBhw+a1v.bso3Fx
O972SF8+bCCVhHdBOqH7Ka+B5jNc2BplE9T6UvxVAwS3IFePuvvXZUwG9e+j
TC9zxOk1pD0kaslxdSM3UDRnURF2T8siRQmnyiLBgx6VkHmQJDp.5VLD3i7h
TtNxzvMT01fcz.mtSFrAS.r5229dP60hI+ofofYESISARv4klfSAS9yKllRr
exEF6atXLHN93nqDrQS.qyaT1TRFulbQ0fWV7G.IYaYd
-----------end_max5_patcher-----------
</code></pre>

alien factory
Posts: 119
Joined: Mon Jun 04, 2007 5:17 pm
Location: Mannheim / Germany
Contact:

Re: change control changes 0-127 to -24 to +24 integer semitones

Post by alien factory » Thu Dec 22, 2011 5:17 pm

thanks, monolake :-)

now I'll get back to my M4L manual to see how to get this code into a device...

Liebe Grüße

Stefan
Macbook Pro 2.5 Ghz, Intel Core 2 Duo, 2GB RAM, LIVE 8.1, Novation SL37, APC40, M-Audio Firewire410, ProTools 8 LE, Reason 4, Waves Native Power Pack, Music Production Toolkit 2, Stylus RMX, NI Komplete&Kore

http://www.myspace.com/stefanhollaender

alien factory
Posts: 119
Joined: Mon Jun 04, 2007 5:17 pm
Location: Mannheim / Germany
Contact:

Re: change control changes 0-127 to -24 to +24 integer semitones

Post by alien factory » Thu Dec 22, 2011 6:01 pm

okay, Monolake...

Now i build your patch into a max4live midi effect, so i can now control the live dial by a hardware knob and it returns the integer values to a transpose dial (-24 to +24) I added to the device...

But how can these transformed values be delivered to my plug-in respectively my group macro knob, which is connected to the transpose value of the plug-in?

any further help is deeply appreciated.. ;-)

Stefan

Edit: if I could add "map mode" into the new device that could help??? is this possible?
Macbook Pro 2.5 Ghz, Intel Core 2 Duo, 2GB RAM, LIVE 8.1, Novation SL37, APC40, M-Audio Firewire410, ProTools 8 LE, Reason 4, Waves Native Power Pack, Music Production Toolkit 2, Stylus RMX, NI Komplete&Kore

http://www.myspace.com/stefanhollaender

towers of silence
Posts: 70
Joined: Tue Jan 06, 2009 11:32 pm
Location: Portsmouth, NH

Re: change control changes 0-127 to -24 to +24 integer semitones

Post by towers of silence » Fri Dec 23, 2011 12:58 am

A little off track but sort of a continuation of what Stefan is looking to do, and Monolake's patch above got me close to my answer- I'm wondering if you can use the scale object contained in Monolake's patch to not just output integer values, but quantize those values even further. Specifically, I'm trying to quantize pitch bend data to only output values according to a certain scale but I can't figure out exactly how

EDIT: basically, I suppose I'm wondering if it's possible to exclude certain values from the integer output

S4racen
Posts: 5830
Joined: Fri Aug 24, 2007 4:08 pm
Location: Dunstable
Contact:

Re: change control changes 0-127 to -24 to +24 integer semitones

Post by S4racen » Fri Dec 23, 2011 11:02 am

<pre><code>
----------begin_max5_patcher----------
520.3ocoU0rjaBCC9L7T3wmyx.4mlL8V6qQmcxXvJIdqQlAKRy1c128ZLlDR
KjR2dAikjk9zmjreKNhmat.VN6yruwhhdKNJxKpUPTXeDuTboPKrdy3XSYNT
yWzo5fAIq5mPqprzjzfXmQlFRCj+LKCR6DQuVAcAjqPhufwyE3QN64fUUBp3
jBOtuFJnNCWks04ZV1p0sKaR8a1kjd8LJoGal7WdZ2PnghRer3eoVIzruZzR
9MHpvdDl0J68331OKlKQ.+vEud2QvEOX41BgFXoIrrkaSXOsbMa45+I1JaJ1
ZVTTVG4j9PNZyGgi9zGfizpyPhz41dOdVTeMd+gxY10z1xbPaDzbHjM9Vl0c
e2NNcrhe0M0NvQP8d.E4ZXX4399kfPq3LH2KHpVk2Pvs+rARIvJsIttALG5E
2KeXLaPEYoW6Ban23NCDHZHAoL39qjHeD6Jc0.OJWtMIcT8JzGiQ01yzioS4
fnqfMfdFyJ6ISMMYY9dnXj+EvpM3w46qGkXZE98VOYmB2sNvHePxevLIm6Kd
Sp0TKc2YNgekvgoUZq.PpUkdJZzzxRP0joDboxf.RSebEdVYU8UyN89o79kv
HuevwU.ve+4B+rWq76uGvZZpK5GYCW5vtM9IAKoPey7.a1cmMmTRIfCRMdoR
VYbuZDf.64QuSZtHZ0LPzl+CD417d7u.Picz0B
-----------end_max5_patcher-----------
</code></pre>

Will do what Stefan asked originally, Towers, have a look at the round object? if not then the route object, with a list of all the values you wish to exclude and connect to the far right output for the values you want....

Cheers
D

alien factory
Posts: 119
Joined: Mon Jun 04, 2007 5:17 pm
Location: Mannheim / Germany
Contact:

Re: change control changes 0-127 to -24 to +24 integer semitones

Post by alien factory » Fri Dec 23, 2011 11:39 am

Hi Darren thanks for the device, but Monolake already posted this and I put it into a device...

see above.. the problem is how to get the "integer" values to the plug-in parameter (tuning).

How can I "map" the output of this device to the parameter "tuning" that I configured in my group, wherein the plug-in sits...??

Hardware Controller knob -> live dial (0-127) -> integer output (-24 to +24) -> ??? -> configured group parameter (tuning)

any help needed?
Macbook Pro 2.5 Ghz, Intel Core 2 Duo, 2GB RAM, LIVE 8.1, Novation SL37, APC40, M-Audio Firewire410, ProTools 8 LE, Reason 4, Waves Native Power Pack, Music Production Toolkit 2, Stylus RMX, NI Komplete&Kore

http://www.myspace.com/stefanhollaender

S4racen
Posts: 5830
Joined: Fri Aug 24, 2007 4:08 pm
Location: Dunstable
Contact:

Re: change control changes 0-127 to -24 to +24 integer semitones

Post by S4racen » Fri Dec 23, 2011 12:07 pm

Umm you need the live object model to find the id of the parameter you want to control? Thats kinda the first building block of the 4live bit of Max4Live.... Have a look at the tutorials on max4live.info apologies if this isn't what you mean....

Also look at the built in abstractions for M4L, you'll find one in there that'll do it i'm sure...

Cheers
D

towers of silence
Posts: 70
Joined: Tue Jan 06, 2009 11:32 pm
Location: Portsmouth, NH

Re: change control changes 0-127 to -24 to +24 integer semitones

Post by towers of silence » Fri Dec 23, 2011 5:45 pm

S4racen wrote:
Will do what Stefan asked originally, Towers, have a look at the round object? if not then the route object, with a list of all the values you wish to exclude and connect to the far right output for the values you want....

Cheers
D

Awesome- that seems to do the trick...now I need to read up on pitch bend data- I had no idea it wasn't a standard CC. Thanks for your help S4racen

S4racen
Posts: 5830
Joined: Fri Aug 24, 2007 4:08 pm
Location: Dunstable
Contact:

Re: change control changes 0-127 to -24 to +24 integer semitones

Post by S4racen » Sat Dec 24, 2011 12:42 am

No worries, there a workaround for everything!!

Cheers
D

chapelier fou
Posts: 6020
Joined: Mon May 15, 2006 12:15 pm

Re: change control changes 0-127 to -24 to +24 integer semitones

Post by chapelier fou » Sat Dec 24, 2011 9:02 am

i didn't open the patches, but obviously you need to use "round" object. Or is it "truncate" ?
MacBook Pro 13" Retina i7 2.8 GHz OS 10.13, L10.0.1, M4L.
MacStudio M1Max 32Go OS 12.3.1

chapelier fou
Posts: 6020
Joined: Mon May 15, 2006 12:15 pm

Re: change control changes 0-127 to -24 to +24 integer semitones

Post by chapelier fou » Sat Dec 24, 2011 9:04 am

oops. Also misread the topic. Just woke up, sorry.
MacBook Pro 13" Retina i7 2.8 GHz OS 10.13, L10.0.1, M4L.
MacStudio M1Max 32Go OS 12.3.1

Post Reply