Home › Forums › General › Using Ctrlr › Novation Bass Station 2 Panel
- This topic has 44 replies, 4 voices, and was last updated 3 years, 6 months ago by An0n3mau5.
-
AuthorPosts
-
August 26, 2020 at 11:13 am #119556
Thanks An0n3mau5,
Congratulations on having a 4 month old. My daughter has a 4 month old too!
Well here is the panel again using those split CCNUMBERS, this time 17:49. Must be unusual if Possemo has never seen it.
Samoht’s post is good, but you would still have to change the CCNUMBER, which needs lua.
You are using 5.3.201 on Windows 10? I just downloaded that panel and was able to open it.
Here’s another one using 17:49 – you should be able to use this as a template for all the other split CCNUMBERs.
Regards,
John
Panel was not correct so deleted!
See below for correct code.- This reply was modified 3 years, 7 months ago by dnaldoog. Reason: deleted panel because it is not working
August 26, 2020 at 11:40 am #119558[20:15:54:000366]: Ch:[ 8] No:[ 17] Val:[ 0] RAW:[b7 11 00]
[20:15:54:000366]: Ch:[ 8] No:[ 49] Val:[ 64] RAW:[b7 31 40]
[20:15:54:000430]: Ch:[ 8] No:[ 17] Val:[ 1] RAW:[b7 11 01]
[20:15:54:000430]: Ch:[ 8] No:[ 49] Val:[ 0] RAW:[b7 31 00]
[20:15:54:000475]: Ch:[ 8] No:[ 17] Val:[ 1] RAW:[b7 11 01]
[20:15:54:000475]: Ch:[ 8] No:[ 49] Val:[ 64] RAW:[b7 31 40]
[20:15:54:000510]: Ch:[ 8] No:[ 17] Val:[ 2] RAW:[b7 11 02]
[20:15:54:000510]: Ch:[ 8] No:[ 49] Val:[ 0] RAW:[b7 31 00]
[20:15:54:000535]: Ch:[ 8] No:[ 17] Val:[ 2] RAW:[b7 11 02]
[20:15:54:000535]: Ch:[ 8] No:[ 49] Val:[ 64] RAW:[b7 31 40]
[20:15:54:000565]: Ch:[ 8] No:[ 17] Val:[ 3] RAW:[b7 11 03]
[20:15:54:000565]: Ch:[ 8] No:[ 49] Val:[ 0] RAW:[b7 31 00]
[20:15:54:000620]: Ch:[ 8] No:[ 17] Val:[ 3] RAW:[b7 11 03]So as you turn the knob LFO2 depth on the Machine is it spitting out alternate cc numbers 31/11 31/11 and values like above. It’s switching between values 0/64 (0x40) for 31 between value changes and sending cc number 11 twice with the same value? Must be something I don’t understand. What do you get when you go above 127 (ie 0)?
?August 26, 2020 at 4:25 pm #119561This is indeed very strange – even stranger than I guessed.
So this is not cc17 from -127 to 0 and cc49 from 0 to +127. This looks a bit like whacky msb/lsb. Is there an explanation from Novation somewhere? Maye you were right with your “64-offset” though I don’t see the logic in doing that. Anyway, let’s guess it:[ 17] Val:[ 0] RAW:[b7 11 00]
[ 49] Val:[ 64] RAW:[b7 31 40] –> 64 = -127[ 17] Val:[ 1] RAW:[b7 11 01]
[ 49] Val:[ 0] RAW:[b7 31 00] –> 128 = -126[ 17] Val:[ 1] RAW:[b7 11 01]
[ 49] Val:[ 64] RAW:[b7 31 40] –> 192 = -125[ 17] Val:[ 2] RAW:[b7 11 02]
[ 49] Val:[ 0] RAW:[b7 31 00] –> 256 = -124[ 17] Val:[ 2] RAW:[b7 11 02]
[ 49] Val:[ 64] RAW:[b7 31 40] –> 320 = -123[ 17] Val:[ 3] RAW:[b7 11 03]
[ 49] Val:[ 0] RAW:[b7 31 00] –> 384 = -122There should be a way doing this with a uiFixedSlider and a multi midi-message. I mean, without using Lua scripts.
August 26, 2020 at 4:49 pm #119564Hi An0n3mau5 and possemo,
I found the answer thanks to sniffing out the midi from this online editor. studiocode.dev/bs2-editor/
Also this topic has been raised before:
ctrlr.org/forums/topic/bass-station-ii-parameter-question/…and here’s how to do it in lua … the ‘why‘ I don’t know – phew – not so straight forward!
CC 0-127 is sent for values -127 ~ +127 in stages 0=0,1=0,2=1,3=1 etc and then a separate CC is sent 0 for the first number and toggles to 64 for the next number , so +127, which is 255, for LFO1 Speed would be B0 32 00 // B0 12 7F. See attached panel.
† This code doesn’t work because the CC messages are sent in the wrong order
lfo_sweep = function(--[[ CtrlrModulator --]] mod --[[ number --]], value --[[ number --]], source) local channelOut = panel:getProperty("panelMidiOutputChannelDevice") local statusByte = 0xb0 + (channelOut - 1) -- use this code for dynamic channel changes local switcher = {0, 64} local number = {18, 50} value = value + 128 local even1, even2, odd1, odd2 = 0, 0, 0, 0 if value % 2 == 0 then even1 = CtrlrMidiMessage({statusByte, number[2], switcher[2]}) panel:sendMidiMessageNow(even1) even2 = CtrlrMidiMessage({statusByte, number[1], value / 2}) panel:sendMidiMessageNow(even2) else odd1 = CtrlrMidiMessage({statusByte, number[2], switcher[1]}) panel:sendMidiMessageNow(odd1) odd2 = CtrlrMidiMessage({statusByte, number[1], math.floor(value / 2)}) panel:sendMidiMessageNow(odd2) end end -- function
Attachments:
You must be logged in to view attached files.August 27, 2020 at 3:08 am #119575I think you are onto something there Possemo. I will need to experiment this weekend if/when I can find some time to see if I can accomplish that with the multi midi message and even non fixed slider and expressions if possible.
I see my other comment is awaiting moderation but just to let you know dnaldoog that the panel did not work as I was expecting (which is no surprise as it is still somewhat Greek to me), but it seemingly did not alter the LFO 1 speed and the output on the midi monitor was different to what I had with using current setup of multi type with
CC,ByteValue,MSB7bitValue,18,-1
CC,ByteValue,LSB7bitValue,50,-10 – 255
Cheers!
August 27, 2020 at 8:33 am #119576Does this panel work? LUA version, but see below for a no lua solution. ?
Attachments:
You must be logged in to view attached files.August 27, 2020 at 9:21 am #119578I had to stare at Possemo’s suggestion for a long time, before I understood it! Brilliant!
Does this work? No lua, just
CC,ByteValue,MSB7bitValue,18,-1 CC,ByteValue,LSB7bitValue,50,-1
with
(modulatorValue+128)*64
in the expression field and no uiFixedSlider necessary.
✨
Attachments:
You must be logged in to view attached files.August 27, 2020 at 9:24 am #119580Hi dnaldoog.
Indeed that panel does seem to work perfectly. Thanks so much for persisting with this and providing your time and knowledge helping me out. Now I need to put some serious time into actually understanding the code you provided and this stuff in general rather than trying to wing it lol. . .
Considering I would like to add patch load/save functionality and also support AFX mode looks like I’ll have a fair bit of study to do.
Would you mind giving a short explanation of how/why CC91 appears in the output as that may help me begin to grasp exactly what is happening (time is my primary problem atm in doing so).
Cheers!
August 27, 2020 at 10:15 am #119582When I try the panel you uploaded without LUA and change>
CC,ByteValue,MSB7bitValue,18,-1
CC,ByteValue,LSB7bitValue,50,-1To 17 and 49 it doesn’t seem to work but instead effects the Amp Env Sustain which is CC92 which is the other CC being output (which I don’t understand where it is coming from). Though when I modify my existing panel with your expression and change the max value from 16384 and interval of 64 to min -127 and max 127 it works :). . . Awesome. . . Thanks dnaldoog.
I will update this thread at my next stumbling block (any second now 😉 and will be sure to credit all those who helped with my panel when it complete. Thanks for now guys.
(*edit. Next stumbling block. Figuring out midi in expression , lol). I’ll figure it out guys. Gotta do something myself right haha.
- This reply was modified 3 years, 7 months ago by An0n3mau5.
August 27, 2020 at 10:15 am #119583That’s it. It is a bit weird but after all not that complicated. It just uses msb/lsb method with 2 CC’s. A bit odd that they use the full spectrum of 2x7bits (16364 values) when they are just using 256 values of them. This is achieved by steps of 64. I added a uiFixedSlider method to dnaldoogs version. I like the fixedslider. It allows to show the positive sign, like this: +127. FixedSlider contents are done very easy with Excel. No problem making hundreds of entries in sequence.
Attachments:
You must be logged in to view attached files.August 27, 2020 at 10:24 am #119574Hi John and congratulations to you too for your new Granddaughter.
Your updated (second) panel opened fine and has given me some insight on using LUA and should be a good platform for me to build on going forward.
Thanks to you and Possemo for the valuable input. I was thinking about this before and with the risk of sounding like a fool An0n3mau5ly on the internet I was kind of imagining the values were interleaved, and/or the 64 was kind of acting like a +.5 or a * 2 to the midi value directly preceding it. This though is coming from my understanding which is still basically as advanced as ‘set this knob to this midi cc and then turn’.
I see though that you figured it out in the meantime and I look forward to trying your updated panel and learning from it. I have already learned a lot from the 3 of you so far in this thread. So thanks once more.
I will leave here also other useful links from that dev that other users may appreciate in the future.
Cheers!
https://studiocode.dev/resources/bs2-sysex/(I’m sure this would be far more useful to me if I weren’t so dense)
https://studiocode.dev/midi-monitor/August 27, 2020 at 1:49 pm #119592Hi An0n3mau5,In reply to your message, which was probably under moderation due to containing a url in it, no one would be expected to immediately grasp what was going on with Novation’s implementation there of left bit shifting every value 6 places (multiplying by 64). There’s no explanation in the manual! Usually an explanation is there, but hard to understand, like Roland’s perennial explanation of Checksum calculation which is confusing, but at least they offer an explanation. But once you know, it seems easy, but isn’t that life?
Here is another panel, this time using Possemo’s uiFixedSlider solution as well as my original lua solution plus a new lua function that uses the JUCE class BigInteger() for your perusal. It is much similar and basically just emulates the Ctrlr way!
It has been very interesting seeing an answer to this emerge! In the end the best most elegant solution supplied by Possemo, seems simple in hindsight. Great thing – hindsight.
lfo_new = function(--[[ CtrlrModulator --]] mod, --[[ number --]] value, --[[ number --]] source) local mValue=mod:getValueMapped() local channelOut = panel:getProperty("panelMidiOutputChannelDevice") local statusByte = 0xb0 + (channelOut - 1) -- use this code for dynamic channel changes local bi=BigInteger(mValue) local msb7=bi:getBitRangeAsInt(7,14) local lsb7=bi:getBitRangeAsInt(0,7) local mb= CtrlrMidiMessage({statusByte, 17, msb7}) panel:sendMidiMessageNow(mb) local lb= CtrlrMidiMessage({statusByte, 49 ,lsb7}) panel:sendMidiMessageNow(lb) end
?
- This reply was modified 3 years, 7 months ago by dnaldoog. Reason: added BigInteger() lua function
- This reply was modified 3 years, 7 months ago by dnaldoog. Reason: added extra message in reply to a message that was under moderation
Attachments:
You must be logged in to view attached files.August 27, 2020 at 10:59 pm #119596I’d say that all these methods are equally well. Which one you choose is a matter of taste.
August 29, 2020 at 11:58 pm #119615Hi guys,
I appreciate all the help so far and taking the time to amend the posts with explanations too. I have to admit I still haven’t really had the time to even begin to study the lua code at all yet. It’s a struggle to find the time to even begin to think about it atm.
I feel like I’m doing something wrong though or I’m having compatibility or ctrlr bug issues as I’m having inconsistent behavior with the panels working/not working (completely). With the latest panel you uploaded John only the non lua modulators respond to midi. The fixed slider one does so only down to -63 and the other one just switches between 0 and 64 (sometimes).
I’m just sticking with the fixed sliders for now to get an understanding of the basics and until every control works as intended and then I would like to move into lua after.
If I create the fixed slider from scratch it seems to work as intended if using those values though I had to create the first step with 0 rather than 64. Here is the next thing I am trying to understand using the fixed slider method.
If I have a modulator that is supposed to go from -120 to +120 (in this case Osc1 Coarse) how do I do go about doing that? When I divide 16384 by 240 I get 68, so I use 68 as the intervals in the slider contents that works as expected to get me the full range but the modulator when reacting to incoming midi only reacts every 16 steps. I’m sure I just need to use a simple expression but I’m too dense to figure it out with the time constraints I have currently.
Cant quite get my head around how the BS2 does it sending 64 steps still and using the full 256 bit range while displaying -120 + 120. Any explanation or dumbing down for me would be appreciated, I’m sure its all very simple and thus I’m feeling a bit mentally challenged right now :s.
Thanks again!
August 30, 2020 at 2:17 am #119616Also Possemo, If you wouldn’t mind pointing me in the direction of further reading and/or panels of interest on the procedure for receiving/decoding/altering/encoding/sending scenario I would be very grateful so I can begin learning more about that for my MicroKorg panel.
As you can probably gather from ignorance thus far that may be some time in the future that I am able to achieve that or anything remotely close.
August 30, 2020 at 11:30 am #119620Hi An0n3mau5,
I checked the panel I sent you. It is working fine for me. What OS and version of Ctrlr are you using?
Also in the manual I see osc 1 coarse cc 27:59 -12. to 12. What does the MIDI out message look like?
Is that supposed to read osc 1 coarse cc 27:59 -120 to 120
If so, using a uiSlider, you would just make modulatorMin=-120 modulatorMax=120 with expression:
(modulatorValue+120)*64
CC,ByteValue,MSB7bitValue,27,-1 CC,ByteValue,LSB7bitValue,59,-1
Does that work?
See attached panel: ✨
Attachments:
You must be logged in to view attached files.August 31, 2020 at 12:03 am #119623Hi dnaldoog,
Thanks for persisting with me! I have no idea why your panels are (mostly) not working for me but I’m sure it must be a problem on my end as it is quite hit and miss. The panel didn’t change the Osc Coarse nor respond to midi on the BS2 after setting the midi in/out devices or after resaving and opening it after restarting Ctrlr, when it obviously should have been.
I also completely removed Ctrlr and all traces yesterday and reinstalled it so it’s beyond me what’s going on tbh. I’m on Ctrlr 5.3.201 btw and using Windows 10 LTSC v1809. It’s completely random it seems as quite a few of the controls randomly stopped working yesterday on my MicroKorg panel and I had to close everything and restart the interface etc to fix it. I wouldn’t be surprised if it is has something to do with the AMD chipset I’m on as it has USB/Midi compatibility problems apparently. My BCR2000 won’t work with it for instance (Asus Rog Strix X570 Gamine-E).
Anyway, I’m rambling. Sorry.
You were indeed right about the -12 to +12 in the manual.
So I had to use the following expressions to get the full/same range of pitch as the Bass Station 2 using uiSlider>
(modulatorValue+120)*67.983
(midiValue/67.983)-120For -120 to +120
(modulatorValue+12)*679.834
(midiValue/679.834)-12For -12 to +12
Cheers dnaldoog.
August 31, 2020 at 2:16 am #119634Very interesting – it’s a strange beast indeed that synth!
Well done working that one out!
Strange that Ctrlr isn’t working on Windows 10 with 5.3.201!
?
August 31, 2020 at 1:05 pm #119636Thanks for the encouragement dnaldoog. I’m slowly but steadily making progress on this strange beast haha.
I’m now beginning to look at how I would grey out/deactivate/hide some knobs that would only be turned on ‘IF’. To be specific the pulse width controls should only be lit up/accessible when pulse width is selected as the oscillator type. I’m assuming I would have to use lua in order to do this. Do you know of any good threads or panels where I could begin to understand how to go about doing that?
I also would like to achieve something similar with the LFO control in that when set to sync rather than speed would switch from sending CC 0 – 127 to sending nrpn with set values (named). Maybe this could be done without lua but I imagine I’m going to have to get my feet wet here and start digging in.
Wish me luck :s
August 31, 2020 at 2:56 pm #119637You’ll be getting into lua territory there for sure. To disable a control on the interface, you would need a method like:
panel:getComponent("pulse_width_control"):setEnabled(false)
orsetEnabled(true)
Changing a single uiSlider or uiFixedSlider’s MULTI message to NRPN and back again is possible, but a bit complex. Instead you could create to different buttons in different layers that sit in the same position, but even that is a little complex.
Goodweather’s DS2 panel is a popular one for learning from, but it’s pretty complex.
My JD-990 panel uses layers, so that is a good reference for learning how to do it that way, or maybe start with some simpler panels first?When I first got started, I studied this panel: ctrlr.org/akai-sg01v-panel/
?
-
AuthorPosts
- The forum ‘Using Ctrlr’ is closed to new topics and replies.