Device parameter modulation range and scaling help
Hi Guys
I have been working on a tool that allows you to modulate any parameter in Ableton with any other parameter. This device also allows you to specify the min and max range of the modulation source, invert the range of the source, and is intended to have a control that allows you to change the rate that the modulator scales the target.
This is the first Max for live device I have built, I have done a lot of the tutorials and reading and have worked on it solidly for a month but I think Im at the stage where I finally have to ask for help ;)
Im going o explain the functionality of the tool a little and then explain what does and doesn't work.
There are three buttons and three nobs.
First two buttons - mod and target. These allow you to respectively select the modulation source and target by firstly clicking on the parameter you wish to use as the modulator and then clicking the mod button on the device and secondly selecting the parameter you wish to modulate then clicking the target button within the device. Now the two parameters are dynamically linked.
You can define the minimum and maximum ranges of the target with the min max knobs. Although technically within the patch these are minimum and maximum ranges imposed upon the modulation source through the scale object.
The scale knob allows you to change the rate by which the modulator scales the target.
The Invert Knob allows you to invert the range.
Right now thats out the way I have a bunch of problems with this device some more pressing than others:
This isn't the most important issue for me but I have included it first because the device won't work without explaining it.
Because the device uses the selected parameter to determine both the mod and target, upon selecting a parameter with your mouse you then click the mod button to store it and this will in turn de-select the parameter you wanted to store.
There is a way around this by making the parameter invisible or hiding it I can't remember the exact terminology and then the id given by the mod button will be zero and then make an argument like ignore if its a zero or something like that i can't remember exactly but theres a tutorial online I tested it and it works BUT There was a problem with this approach.
Firstly I'm not sure if you can assign a midi control to an invisible parameter so this reduces your options a little if this is the case. Secondly If any of the parameters I selected were on the main front panel view of ableton i.e. sends and volume faders, pan etc I could select these, store them by subsequently clicking either mod or target and this would be fine. If the parameter I wanted to select was for example on a device on another track I would have to navigate there, click on the parameter, go back to the max device and by selecting the max track and device this would deselect the parameter I wanted to store.
So the work around I made was simple you have to assign the mod and target buttons to a hardware controller in order for the device to work. So the method which I described above in the functionality section is the way I would like it to work but actually in order for it to work you have to assign buttons to mod and target, click the parameter you want to use as modulation source, push the button which is assigned to the 'mod' button within the device and repeat process to assign the target.
It would be nice to be able to do this with the mouse so if anyone has any suggestions as to the best way to set this up that would be greatly appreciated.
Ok so for the big problem now - In building the device I found that in order for me to be able to inter intermodulate between parameters with differing ranges I needed to make use of the Zmap and Scale objects.
I have set up a system that allows the value range of the target parameter to be retrieved and stored and then used to scale the min and max control value ranges using Zmap and then these values in turn are used to scale the modulation source before it modulates the target.
This works flawlessly so for example I can take a send pot value 0 - 1 floating point and use it to modulate the range of the auto filter frequency which responds to 0 - 135 integer. I can impose min max value ranges on this as well and these are all scaled to the appropriate target value range automatically.
The difficulty in the patch happens with the behaviour of the scale knob. As mentioned earlier the scale knob is designed to change the rate that the modulator scales the target. Now as its set up in the patch I have it almost working. You can take one send pot and modulate another send pot with it and if scale is set to maximum which is 1 the two parameters will behave identically. Reduce the scale to 50 percent and this results in 50 percent of the of the modulator modulating the full range of the target.
This is the desired behaviour I want but if I take that send pot and use this for example to modulate the frequency cut off then the parameter hardly moves. I don't think that the value of the actual scale knob is being appropriately scaled by the target parameters range.
You can look inside the patch and see the scale object with the note "scales modulator with min max values" next to it - The scale knob goes into third 'high input value' inlet of the scale object after it has had its range converted to the target parameters using the Zmap object. If you remove the patch cord coming into the third inlet and replace it with one coming from the second numeric box above it this will cut the scale knob out of the equation and the patch will have all of the correct functionality minus this particular feature.
Ideally I would like to be able to utilise this feature and change the rate at which the target parameter is scaled both positively and negatively. So for example you could modulate the full target parameter with 50 percent of the modulator and you could also modulate 50 percent of the target with the full range of the modulator. This is the major part of the functionality that I am stuck on.
There are a couple of other issues that need much shorter explanations:
When I open the device for editing my modulator and target parameters are lost and I have to reassign them.
Modulators and targets can not be reassigned when in editing mode it needs to be saved, closed and done from the max for live device.
When ever a new target parameter is assigned, the min, max and scale knobs each need to be clicked and dragged once in order for the patch to work.
Within the device I have an 'outputvalue' message box that you can click on and this send the values for you. The button that is patched into this message box doesn't get it to send the message. I feel like I'm missing something basic here with this problem and I can't understand it.
Similar behaviour with the buttons that set the modulator and target parameters. I had to use the Uzi object to send a couple of bangs because I was having to click everything twice. I don't get things like this I'm sure I must be missing something basic.
On a very final note an additional feature I want to put in is a text box that displays the modulator and target parameters beneath the buttons so that you can easily keep track of them. Ive not got round to exploring how to do this yet.
Thats literally everything I can think of to include although Im sure I will probably remember something really important after posting it ;) Help on any of the features mentioned would be hugely appreciated. This is the first Max device I have set out to make that I can really see a tangible creative and technical benefit to my work flow from and I would really love to start using it in my projects. Im going to paste the code below:
Chees
Rich
PS I have included the ableton project using this device so you can load automatically. Send B of track 1 is dynamically linked to send A of track 1. Have a play around with min max and scale nobs and follow the instructions laid out above to reassign modulators and targets and you will understand the behaviour that I am talking about.
Ive discovered that this device actually only works at all if the modulator and target buttons are assigned to buttons using the touchable remote script for the iPad. I was just testing using regular midi automation to buttons on another controller and realised that pushing the midi assigned button deselects the parameter that you want to modulate. Assigning the buttons using the iPad as the controller and the touchable app seems to be fine. So I'm going to look into whats causing this.
In case anyone wants to test it it does work when using Abletons native key map mode. Also for some reason you need to detect both the source and the target parameters twice to get it to work.
Huge oversight on my part I came across the building blocks in the max for live devices a while ago but forgot about them. There should be enough here for me to hack together what I need. The Max Api params matrix one would be the one to customise. I basically have to implement my own parameter scaling function to this to achieve what I want as I really dislike the included curve, comp, jitter, smooth controls. This will keep me going for a while maybe I will shout out again if I hit a brick wall. But I'm not sure if anyones listening.... ;)
Hi --
I can map arbitrary midi controllers to arbitrary synth parameters with the midi map function.
Is there a way to map the max midi or audio lfo to a map so I can specify min and max?
Is this what you were trying to do?
Thanks for your work.