Home › Forums › General › Using Ctrlr › Creating a slider with positive and negative values
- This topic has 9 replies, 4 voices, and was last updated 11 years, 6 months ago by mb47.
-
AuthorPosts
-
January 5, 2012 at 10:33 pm #529
Hello!
i’m trying to create a simple editor for the Kawai K3, but I’m running into problems with some of the parameters, most work fine, but I’m not sure how to properly set up certain things when more than one sysex string is required. The oscillator balance is a good example, in the sysex chart I have it is described like this:
Waveform Balance (BAL): -15 -> +15 (Center @ 0)
F0 40 00 10 00 01 04 08 0F F7
F0 40 00 10 00 01 04 08 01 F7
F0 40 00 10 00 01 04 00 00 F7 <- ( 0 Center)
F0 40 00 10 00 01 04 00 01 F7 <- (+1)
F0 40 00 10 00 01 04 00 0F F7 <- (+15)Entering F0 40 00 10 00 01 04 08 xx F7 as the sysex formula will let me control 1 to -15, but I’m not clear on how to get the slider to cover all the possible values, -15 to 15. I’ve tried adding these to multi-message list, but I’m not really sure what I’m doing.
Any suggestions?
Thanks!
January 6, 2012 at 12:28 am #3709I had a look at the manual
http://soundprogramming.net/manuals/Kawai_K3_Manual.pdf – page 49
and it seems that you have set it correctly.
I believe that the center parameter is 7, not 0January 6, 2012 at 1:24 am #3710I’ve looked at that, and I can’t make any sense of it, I’ve been using the sysex chart attached to this post as it seems a little easier to understand. I’m just having a hard time getting the parameters with 5 lines of sysex working in Ctrlr, how do I translate these into something Ctrlr understands?
January 6, 2012 at 3:40 am #3711need to split the value of the knob and MSB4bit LSB4bit
setting the maximum value to 24, and the minimum value at -24
with the formula
F0 40 00 10 00 01 04 ms ls F7
but unfortunately only works for the positive part
because for the negative part should be added only the first bit, so that it is negative,
but I do not know how to add only one bit to sysex byte.January 6, 2012 at 3:20 pm #3712You can do it 3 ways
1) use a FixedImageSlider and fill the list of values in a way that it will fit your formula perfectly
2) use the expression fields to add/subtract/divide/multiply the modulator value to get the actual value you want
3) use LUA to create/send those messagesJanuary 6, 2012 at 7:43 pm #3713Thanks for the responses, I’m still a little confused though. Say I used a fixed slider, how would I enter the sysex messages in the slider contents? I’ve tried adding this:
-15= f0 40 00 10 00 01 04 08 0f f7
-14= f0 40 00 10 00 01 04 08 0e f7
-13= f0 40 00 10 00 01 04 08 0d f7
-12= f0 40 00 10 00 01 04 08 0c f7
-11= f0 40 00 10 00 01 04 08 0b f7
-10= f0 40 00 10 00 01 04 08 0a f7
(and so on..)But that doesn’t work, the slider won’t even move.
I think part of the problem is the 8th character in the sysex code, this changes between negative and positive values, so -15 is F0 40 00 10 00 01 04 08 0F F7 whereas +15 is F0 40 00 10 00 01 04 00 0F F7.
Sorry if I’m not explaining myself well, this is all pretty new to me.
Thanks again
Rick
January 6, 2012 at 7:49 pm #3714No no, don’t enter SysEx in the Slider properties, leave the SysEx formula in the midi properties as it was (F0 40 00 10 00 01 04 ms ls F7) and assign correct numerical values like:
[code:34emyf36]
-15=1024
-14=1023
-13=1022
-12=1021
...
[/code:34emyf36]you just need to know witch numerical value split into LS/MS pair will make the pair you want for the position you want.
January 6, 2012 at 9:11 pm #3715Thank you! Entering the value as described did the trick.
I should have the K3 editor done in no time now, this was the main hurdle.
All the best
Rick
January 7, 2012 at 12:39 pm #3716I could not resist to understand how we could do, and that is the function in LUA
I hope it will be useful[code:1sjvtmtd]– @Tronic~2012
—
— Called when a modulator value changes
—function K3m_Sysex_Formula(modulator,value)
— Get modulator Value
modulator = panel:getModulatorByName("Synth-2")
value = modulator:getModulatorValue()— Binary Manipulation
if value < 0 then — Check if modulator value is negative
absvalue = value*-1 — Make value always positive
bin = CtrlrLuaBigInteger(absvalue) — Assign bin to class BigInteger
bin:setBit(7,true) — Set only one bit to 1
else
bin = CtrlrLuaBigInteger(value)
bin:setBit(7,false)
end— Split Byte to two separate Byte
msb = bin:getBitRangeAsInt(4,4) — Get only 4bit and make it integer
lsb = bin:getBitRangeAsInt(0,4)— Create & Send Sysex Message
sysex = CtrlrMidiMessage({0xF0,0x40,0x00,0x10,0x00,0x01,0x08,msb,lsb,0xF7})
panel:sendMidiMessageNow(sysex)— Debug
byte = bin:toString(2,
console (string.format("Value=%d Byte=%s msb=%02x lbs=%02x",value, byte, msb, lsb))end
[/code:1sjvtmtd]October 6, 2012 at 10:40 pm #3717Hi all,
I need to send from a modulator SysEx formula like this one:
f0 40 09 10 00 06 15 02|MS LS f7
where with | I mean an OR operation on the bits.It actually seems to accept it, as well as writing:
f0 40 09 10 00 06 15 02+MS LS f7but both will only send
f0 40 09 10 00 06 15 02 LS f7
whatever the valus of MS is."atom":ud9lamkv wrote:You can do it 3 ways1) use a FixedImageSlider and fill the list of values in a way that it will fit your formula perfectly
2) use the expression fields to add/subtract/divide/multiply the modulator value to get the actual value you want
3) use LUA to create/send those messages[/quote:ud9lamkv]Is method 3) the only possible in this case, or there also other ways?
I am not sure that method 1 could be used here.
Method number 2) sounds like the most straightforward, and wanted to try it out, but could not make it work.Does anybody know how to do it?
Thanks!
Marco -
AuthorPosts
- The forum ‘Using Ctrlr’ is closed to new topics and replies.