Home › Forums › General › Using Ctrlr › modulatorMappedValue does it work like this?
- This topic has 15 replies, 4 voices, and was last updated 7 years, 9 months ago by Possemo.
-
AuthorPosts
-
July 22, 2016 at 12:32 pm #69577
I have a sysex message to send that sets master “tune”, however the thing is not linear so I can’t use “modulatorValue” so I need to go via a look-up table, like this:
Slider/Modulator Value to be sent
-99…………………..45
-50…………………..35
0…………………….0
+50………………….150
+99…………………..257It’s mad I know, in the past I made a table (array) used the slider value to address the mapped value. I assume “modulatorMappedValue” will do this. My question is what code do I need?
I can create a table thus:TuneLookupTable = function(modulator, numericModulatorValue) TuneValue = {} TuneLookUp[1] =45 TuneLookUp[2] = 35 TuneLookUp[3] = 0 TuneLookUp[4] = 150 numericModulatorValue = TuneLookUp [ numericModulatorValue ] <-!???? return numericModulatorValue
I’ve usege LUA to crate a method and put that table in there, I assume the “return” gets put into modulatorMappedvalue, but what about the value coming into the method? At the moment I have a big crash as I think I’m addressing some array “key” out of range, so I need to bring in from the modulator the value on the slider, which I though was numericModulatorValue, but I guess not as that is teh source of my crash.
July 22, 2016 at 3:46 pm #69582A table isn’t necessary. You can use a fixed slider and insert there the mapped values, in field “Slider content”. The format is:
0 = mappedValue1
1 = mappedValue2
…For negative numbers, maybe you will need to mess with expressions, there are several topics related:
http://ctrlr.org/forums/topic/negative-values-in-hex-which-expression/
http://ctrlr.org/forums/topic/korg-z1-negative-values/
http://ctrlr.org/forums/topic/creating-a-slider-with-positive-and-negative-values/July 22, 2016 at 6:08 pm #69583Thanks for the tip but… where do I find “slider content” field? I’ve looked down the list of properties for uiSlider
The categories I have are:
Modulator,
MIDI,
Component Generic,
Component.
Under which of those four would I find “slider content”, closest seems to be having to enter sysex for every entry, in the MIDI section.Going back to my original question, I also need to add a time delay so I would like to try my Method (function call)
I am using version 5.2.44 on XP 32
I have changed to uiFixedImageSlider component and it is there. 🙂
But I just want the slider to look like the standard slider, I don’t need the image resource thing, which seems to lose the standard slider look.July 22, 2016 at 7:53 pm #69587why not use uiFixedSlider? And then… why do you use a Ctrlr version from stone age?
July 23, 2016 at 7:20 am #69592You know, when I was experimenting yesterday with this, I tried all the sliders and I’m sure with uiFixedSlider there was no “Slider Contents” option!!
BTW: if anyone can help with the Method call athat would be good as I will need that for other sysex commands too.
When I installed crtl, I thought I was getting the latest version, maybe something went wrong.
July 23, 2016 at 11:26 am #69595What are the typical usages for uiFixedSlider?
Somewhere isn’t this a contradiction? A slider (something moving) that is fixed…July 23, 2016 at 1:05 pm #69596I think it’s due to fix values, as fix means correct or set right, adjust.
The fixed slider lets you set the output values, instead 0-127 you can output anything.- This reply was modified 7 years, 9 months ago by dasfaker.
July 23, 2016 at 1:08 pm #69598@Peter_EP: sometimes the nightlybuilds are not sorted by date, newest is
Ctrlr-5.4.2.exe. It think should work on WinXP.
@goodweather: yea that’s what I thought too for a long time. But Fixedsliders are very powerful. They aren’t fixed at all. But you can fix the vaules. For the Matrix1000 panel I had to make an awkward valuelist list like this:-63=65
-62=66
-61=67
-60=68
-59=69
-58=70
-57=71
…Here, a value of 125 will set the parameter to -3.
The first value is just display, you could make an entry like this: HelloWorld=3. The second value is the modulators MAPPED value. In Lua you get and set this by :setValueMapped(value, false, false) and :getValueMapped(). You still have the normal modulator value: the first entry has modulator value 0, the second 1, and so on.
July 23, 2016 at 4:02 pm #69602OK. Thanks to both of you.
I have never used that because I’m solving it in a different (maybe easier?) way.
I’m always using uiImageSliders with some OnChange method. In that method I’m performing the transformation.
In your case Possemo, value = param – 128.
If special calculation then series of “elseif”…When I have special values, I’m still using uiImageSliders but with content as
Osc1+Osc2=0
Osc1=43
Osc2=85
which is indeed a series of fixed values…July 23, 2016 at 4:19 pm #69604So you are doing it with Lua scripts, sure not a bad idea. But how do you make the display? I mean showing -34 instead of the real value? With graphics? I never used Imagesliders, I am too lazy to make the graphics…
July 23, 2016 at 9:24 pm #69609A display is a uiGroup. Each element is a uiLabel that I call lblxxx when not changing and txtxxx when changing. I just change the uiLabelText property.
Pretty straightforward and I think quite flexible due to the coding…July 23, 2016 at 9:36 pm #69610I see. I think it will be interesting to study the code of your panel when it is finished. I hope you don’t plan to make it closed source…
July 24, 2016 at 9:02 am #69615Thanks for the interest, I am making progress, ctrl is excellent.
I now downloaded the Ctrlr-5.4.2.exe and looked in the About box: it says Version 5.3.201
July 24, 2016 at 10:35 am #69617yes the about box has not been updated, but it is the newest ver. For me (on Win10) it works quite well.
July 24, 2016 at 7:22 pm #69618Of course Possemo! I will publish it in .bpanelz.
As we are all learning by looking at each other’s panel, all panels should be published in an open way. This is also a recognition to the work done by atom in my opinion.
I’m busy with final testing of the librarian.July 24, 2016 at 8:18 pm #69619yea, for the enduser it is nice to provide ready to use instances, but when you would like to look into the cracks work .bpanelz is great. Btw. I am on final testing of a Matrix1000 panel
-
AuthorPosts
- The forum ‘Using Ctrlr’ is closed to new topics and replies.