Home › Forums › General › Programming › Novation SL MkII and Reaper (MIDIOSC bridge)
- This topic has 34 replies, 4 voices, and was last updated 7 years, 4 months ago by fundorin.
-
AuthorPosts
-
December 11, 2016 at 9:47 pm #70603
I’ve started this new thread to ask silly questions about my project and gather all knowledge in one place.
The task is to be able to control Reaper with midi controller and get feedback from Reaper to the controller. Reaper can’t give midi feedback, so the panel will convert midi from SL to OSC and feed OSC to Reaper. Then, Ctrlr will take OSC feedback and send it back to SL to turn on LEDs and display info on LCD.December 11, 2016 at 10:03 pm #70605Thx for your explanations, I see a bit better…
– Based on user/fx/inst/mixer selection, I would set a variable so one knows at any time what is selected
– Based on that variable, you could change all labels of the controls. When a contorl is modified, the corresponding OnChange Lua method will perform an if..then..elseif… to know what action to performI’ve started this midi2osc bridge using oscii-bot, at first. Then, I’ve switched to Processing. Then, to VSTLua. Tried a bunch of other software (probably, every one) and got back to Ctrlr, cause it doesn’t scare me with programming scripts, as it did a year ago.
So, I have half of the code ready to be transfered from script that was partially made in VSTLua to Ctrlr. Including four different modes.– LED ring behaviour: I’m not aware of the 6 possibilities. Do you mean for the same rotary button? If yes, then you need to build 6 images (each containing the same number of frames) and then I suppose you can switch the image resource according to the wished behaviour
Yes, the same encoder. I’m defenitely going to switch images, if “tabless” tabs aren’t possible.
This modes are available for encoder LEDs:
I’ve also made a demo video long ago (better than pictures):
– devices: I didn’t find a way to know if the smiley was happy or sad. I can only find if my synth is in the list
What about setting your device as input and output after you found it in the list?
It seems like I’ve seen something like this in Ctrlr source. It seems to be possible to do this with VstLua – https://dl.dropboxusercontent.com/u/8162257/nativemidi.lua, though I never tried. What about Ctrlr?P.S. I feel like I need to add a screenshot of my panel to this thread, in case someone else is interested. 😉
December 12, 2016 at 9:34 am #70626Really cool! What are the things you would like help with (no promises…)?
December 12, 2016 at 10:07 am #70627I have a couple of questions 😉
1. How to change resource image of the modulator from script?
2. How to set particular midi in and out from script, using getMidiDevicesList and/or modulator value?
3. What is the code for “midi settings” window popup, in case that menu is hidden?
4. How to add extra font for iuLCD modulator to replicate the one that is used for LCD by Novation?
5. How to change icon of the standalone version? I’ve seen that this is possible in Snow Ed panel.
6. How to handle double button presses with Lua script and how to differentiate them from single presses or holding the button?
7. Is there a timer available in Ctrlr’s lua?
P.S. More silly questions are coming! I wish there was Wiki for this type of questions.
December 12, 2016 at 12:07 pm #70629Yes it is a pain that there is no wiki and it is the reason I wrote my Step by Step guide (ongoing work on a 2.0 version with a lot of Lua explanations + memory blocks + timers + …). http://ctrlr.org/forums/topic/ctrlr-step-by-step-guide/
1. I’ll check that one
2. Don’t know
3. Can you ask dasfaker? He is using that in his SnowEd panel I think but I don’t have the source. Maybe this is also done in other panels. Did you search the forum?
4. You can add font as resource (as images) then use it in your panel. That’s the theory. I did it for my Pro2 panel and got issues and strange behavior so I decided NOT to do it but to provide the font separately when distributing the panel. People should install the font before using the panel and the font becomes an OS font.
5. I guess you do that afterwards (Windows property)
6. I think this is described in Juce API. I’m using a differentiation left/right and I’m pretty sure having seen single/double.
7. Yes, there are. I’m using them in my Pro2 panel (Timers method containing all timers). You will also find examples in the forum.December 12, 2016 at 12:19 pm #706314. One can only use font from resources with uiLabel, but not with uiLCD. I’m having alignment issues, using uiLabel. I’ve made blue dots background to replicate SL’s LCD and can’t fit uiLabel properly, if characters number is less then 9 (9×8=72 as lcd is 72×2).
5. Could you show me an example of how to use Juce API commands in Lua script? Would I be able to find the corresponding commands by myself in your DSI panel?
I’ve read your guide, but it lacks of lua chapters, yet. The most important ones, as for me. Don’t you think it might be a good idea to create google docs document, so that selected forum members could edit your guide online?
December 12, 2016 at 1:47 pm #70633What is the code for “midi settings” window popup, in case that menu is hidden?
There’s no code, it’s just a property of uiButtons, “Internal function this component should execute”
December 12, 2016 at 1:52 pm #70634There’s no code, it’s just a property of uiButtons, “Internal function this component should execute”
Can’t find it. Is it “Link to PANEL property”?
December 12, 2016 at 1:57 pm #706354. One can only use font from resources with uiLabel, but not with uiLCD. I’m having alignment issues, using uiLabel. I’ve made blue dots background to replicate SL’s LCD and can’t fit uiLabel properly, if characters number is less then 9 (9×8=72 as lcd is 72×2).
You’ll get into troubles, as Juce text is horizontally scaled always, monospaced fonts aren’t displayed correctly.
December 12, 2016 at 1:58 pm #70636In uiButtons, over “Component position and size”
December 12, 2016 at 1:59 pm #70637You’ll get into troubles, as Juce text is horizontally scaled always, monospaced fonts aren’t displayed correctly.
I kinda solved this issue.
December 12, 2016 at 2:03 pm #70638In uiButtons, over “Component position and size”
There’s no such option in uiImageButton, only in uiButton. How did you add midi jack image to the button? Or is it just placed below transparent uibutton?
December 12, 2016 at 2:10 pm #70639I can add a font property to uiLCD i’m sure, as for JUCE’s font handling, i’m not touching that, i’m sure JUCE has done this much better then i would have ever done.
December 12, 2016 at 2:24 pm #70640I can add a font property to uiLCD i’m sure, as for JUCE’s font handling, i’m not touching that, i’m sure JUCE has done this much better then i would have ever done.
No need to change JUCE’s font handling as I’ve already found out how to use monospaced font.
Font property for uiLCD would be nice, though I don’t understand the difference between uiLabel and uiLCD for now.
“Internal function this component should execute” option for uiImageButton would also be nice.P.S. I’m waiting for OSC fixes in the new build more than anything else, so I can start working on the code, finally. As for me, everything else isn’t as important as properly working OSC subsystem.
December 12, 2016 at 2:34 pm #70641yeah i’m working on it, i need to make it right or ctrlr will crash, it’s an issue with pointers and type casting
December 12, 2016 at 7:43 pm #70643i uploaded a new build for windows, this issue should be fixed now, however please see the DEMO – OSC panel for an example, you shouldn.t use the .s field to access strings, it’s all explained in the comments there.
December 12, 2016 at 7:55 pm #70644Thank you for the new version.
Ctrlr crashes with demo panel and “pink log” only shows outgoing OSC from slider.From Reaper I call “Refresh control surface” action, which sends all necessary info to remote device via OSC (strings, numbers, floats).
December 12, 2016 at 8:26 pm #70646I see that you wrote in comments: “in lua we can’t use [] for strings”.
In fact, I’ve succesfully used strings as table indexes with VSTLua and formatted them to my liking.December 12, 2016 at 8:36 pm #70647I don’t get it. At some point I was able to get string names of the tracks with simple code:
onOSCMessage = function(path, types, arguments) console(path..' '..types) if types == 's'then value = tostring(arguments[0]) end console(value) end
But when I’ve tried to add floats and integers via elseif, Ctrlr crashed and now, after removing all elseif’s, Ctrlr still crashes with the above code.
UPD. I’ve also found this comments:
— +1 index since arguments is a 0 indexed array
— and lua starts with 1
Even if Lua starts with 1 by default, it can easily access table indexes under key “0”.
“You can start an array at index 0, 1, or any other value: ” https://www.lua.org/pil/11.1.htmlDecember 12, 2016 at 10:02 pm #70649i don’t know what VSTLua is and the indexing of tables is something that’s in Lua, i make theese comments for other users so that they are aware of how this language works, this stuff can be done in many ways better/worse.
As for Ctrlr crashing, i’ll investigate further
-
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.