Marco
Full Member
Posts: 6
|
Post by Marco on Jun 16, 2019 15:06:07 GMT
Hi everybody, first thread for me here. First of all, I wanna say a big thanks to xPsycHoWasPx for running this forum.
I've been using Lemur for a while as my to-go midi controller, but only recently I'm starting to explore scripting. I had some experience with arduino boards some years ago, but I'm not a ninja coder for sure. So, what I'm trying to do is accessing a value inside a script that is defined at the Project level...the script itself it's not relevant, I'm just posting an example here. Clearly there's something I'm missing, or that I'm doing wrong, as the monitor object I'm using for display the value gets stick to '0'. I was referring to part '11.3 Return' in the user manual, which seems the most relevant to me in this case. Could anyone point me in the right direction?
|
|
|
Post by ericzang on Jun 19, 2019 6:12:55 GMT
If you haven't yet, check out this video (and the rest in the series). www.youtube.com/watch?v=rnFgwy2BC3U
two key parts I changed were, test() On Expression to Knob.x - it wasn't getting any changing value from anywhere. Needed to change the use of double ==, it is for conditional statements (if), whereas = is for assigning values. I still sometimes accidentally typo and overlook this too! (but mostly using = where I should ==).
|
|
Marco
Full Member
Posts: 6
|
Post by Marco on Jun 19, 2019 8:02:29 GMT
I was indeed checking your videos theese days, but I haven't made to the fifth yet...thank you for the replay, and many thanks for your invaluable tutorial. The reason I set the Execution to Manual was because I'd like to use the script for more than one Object, recalling it from different Monitors. Got in now, thank you!
|
|
|
Post by ericzang on Jun 19, 2019 8:28:33 GMT
You're welcome, but I'm not the one who made those great videos Even if the script is not set to Manual, you can still call the script from other objects/scripts in the same way. Goodluck in Lemurland! (You may have found that the offical liine forum is back online?)
|
|
Marco
Full Member
Posts: 6
|
Post by Marco on Jun 19, 2019 12:05:48 GMT
ah ok...well, thanks for point it to my attention.
really? if I would change my first script's (script_test.jzml) execution from 'Manual' to 'On Expression' it lose the argoument in braces...I understand I need to specify 'Knob.x' in the adjacent field, but then again I could not use the script for more than one variable (e.g. Knob2.x)...or am I missing something?
Yes I have...I've asked here because I've had zero replies there some time ago for another thread...maybe I should try again.
|
|
|
Post by ericzang on Jun 19, 2019 21:39:49 GMT
Sorry I think I'm not quite understanding what your goal is. Anyhow I made another version of the script that uses two knobs in case it might be of any help.
|
|
|
Post by ericzang on Jun 19, 2019 21:45:25 GMT
I just now after posting the above jzml changed the test() to Execute: Manual. Still works the same. Always some thing new to learn with lemur! I guess its because the Monitor is continually calling/running the script(?).
|
|
Marco
Full Member
Posts: 6
|
Post by Marco on Jun 20, 2019 7:49:14 GMT
I think that's exactly what is happening, to my understanding.
Sorry, I should have been more precise from the beginning...my goal was to design a global script to refer to, whenever I need to see the dB value of one or more Ableton Live send knob(s)...this come quite there, except in the -20 dB region (not really sure about the math they use there), but it works for me.
|
|
|
Post by ericzang on Jun 20, 2019 8:18:06 GMT
That's really cool, thanks for posting the jzml. I need to learn about how to interact with declared expressions within the script name as you did with lintodb(value), and interesting how the monitor is able to use Knob.x in place of value. Also that knob value scaling is very useful, thanks! Nice math going on there! The other solution I saw took a different approach, but I think yours is more accurate. I couldn't find the original link to it (from the forum or user library), so I'll post it here in case you hadn't seen it, for curiosity sake. Uses interpolation between values in vector. Also, you may be aware of Clyphx. He is working on using OSC to transfer value and parameter names from Ableton back to an OSC device. That part is in beta for now.
|
|
Marco
Full Member
Posts: 6
|
Post by Marco on Jun 21, 2019 14:56:20 GMT
You're welcome!
Yes, when you create a script with a variable, as I did in lintodB(value), you can call it 'externally' (from an object or from another script). The script has to be created at the project level to be accessible to every object, and execution has to be set to 'manual', meaning the script's is triggered when called up in another script or expression. Just substitute your script variable with an object variable in the value field (e.g. value = lintodB(Fader.x)), then changing Fader.x will call the execution of the script, Fader.x being your value. I just did that in the monitor object in my example. (I hope all of this makes sense, I'm still a beginner with scripting, and most important, english is not my first language...sorry).
I got to the math there after some trial and error, and I borrow the >0 && <0.5 region from a max/MSP patch I found in the cycling forum. thanks, I'll have a look into it...
I wasn't...seems super cool, thanks...ahhh, so much interesting stuff, so little time!
|
|
|
Post by ericzang on Jun 22, 2019 8:25:12 GMT
Thanks for explaining more about it Marco! I'll experiment around with that. Here's a link to the ClyphX and OSC parameter values info: forum.nativekontrol.com/thread/3620/beta-osc-output-clyphx-proThere's a video link at the end of that first post.
(Your English is excellent, I wouldn't have known it wasn't your first language.)
|
|