|
|
|
10-25-2020, 12:02 PM
|
#1
|
Human being with feelings
Join Date: Mar 2017
Location: Berlin
Posts: 151
|
Send CCs from JSFX
This is probably a stupid question but this is my first JSFX project and i am not a coder.
I do have some experience with writing LUA scripts though.
How do i send fixed CCs with a slider from a JSFX plugin?
Let's say i want to send controller 18 and i have my slider set to the range 0 to 127?
All the guides and help files i could find on JSFX plugins always take some midi in to work.
How do i simply send it with the fader in the plugin?
|
|
|
10-25-2020, 12:28 PM
|
#2
|
Human being with feelings
Join Date: Jun 2010
Location: Somewhere PRO
Posts: 1,049
|
In witti's plugin pack, check out "sfz_buddy"
Search the stash for "witti" or "js_plugins.zip"
__________________
"REAPER... You're simply the best" - Tina Turner
|
|
|
10-25-2020, 12:56 PM
|
#4
|
Human being with feelings
Join Date: Mar 2017
Location: Berlin
Posts: 151
|
Thanks guys. I'll check both of them out.
|
|
|
10-25-2020, 03:28 PM
|
#5
|
Human being with feelings
Join Date: Mar 2017
Location: Berlin
Posts: 151
|
ReaControlMIDI is a VST and therefor can't be altered to my needs i'm afraid.
"sfz_buddy" basically does what i want.
Unfortunately the code seems unnecessary complex for what i have in mind. Is this the way to do it?
I don't really understand what is going on. So far i was unlucky in altering the code to the few sliders i need.
If someone could come up with some easy code with just one slider working on CC 18 i can copy that code and exchange the values (CC number, slider description etc.). I'm fine with CC values and channels being hard coded into the plug.
Thanks
|
|
|
10-26-2020, 12:57 AM
|
#6
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,653
|
Something like this you mean?
Code:
desc:Send CC#18
slider1:0<0,127,1>Value
@init
ch = 0; // 0..15
cc = 18;
old_value = -1;
@slider
value = min(max(0, slider1|0), 127);
@block
value != old_value ? (
old_value = value;
midisend(0, 0xB0 | ch, cc, value);
);
|
|
|
10-26-2020, 07:35 AM
|
#7
|
Human being with feelings
Join Date: Mar 2017
Location: Berlin
Posts: 151
|
Quote:
Originally Posted by Tale
Something like this you mean?
Code:
desc:Send CC#18
slider1:0<0,127,1>Value
@init
ch = 0; // 0..15
cc = 18;
old_value = -1;
@slider
value = min(max(0, slider1|0), 127);
@block
value != old_value ? (
old_value = value;
midisend(0, 0xB0 | ch, cc, value);
);
|
Awesome. Now i understand it much better.
I build my JSFX with 25 of them. Works great.
Thanks a lot.
Last edited by Distressor; 10-26-2020 at 09:52 AM.
|
|
|
10-26-2020, 10:06 AM
|
#8
|
Human being with feelings
Join Date: Mar 2017
Location: Berlin
Posts: 151
|
If i'd like to use sysex instead of CCs how would the code change?
|
|
|
11-01-2020, 04:14 PM
|
#9
|
Human being with feelings
Join Date: Aug 2015
Posts: 2,969
|
That would depend on what (hardware) you're wanting to send sysex to.
(I guess this'll be some kind of older kit that doesn't do CC, but does do sysex?)
but it's going to be something like:
Code:
//start building sysex message
outbuf[0] = 0xF0;
outbuf[1] = manufacturer_identifier;
then you need to put the rest of your sysex message in the buffer*
terminate it, and send it
Code:
outbuf[i] = 0xF7; // finish sysex
midisend_buf(0,outbuf,i+1);
*the devil's in the specific detail... there's a pretty good article here:
http://www.muzines.co.uk/articles/ev...exclusive/5680
__________________
it's meant to sound like that...
Last edited by jrk; 11-01-2020 at 04:20 PM.
|
|
|
01-03-2023, 08:15 AM
|
#10
|
Human being with feelings
Join Date: May 2021
Posts: 112
|
Quote:
Originally Posted by Tale
Something like this you mean?
Code:
desc:Send CC#18
slider1:0<0,127,1>Value
@init
ch = 0; // 0..15
cc = 18;
old_value = -1;
@slider
value = min(max(0, slider1|0), 127);
@block
value != old_value ? (
old_value = value;
midisend(0, 0xB0 | ch, cc, value);
);
|
Thank you !!
I tried this, and I now can send any cc with a slider, but after some experimenting to make more cc sliders (like Distressor managed to do, I know very little about programming) I got stuck.
Could you (or someone) give an example with an extra slider, controlling, for instance, cc19 ?
Then I expect I'll be able to make as many cc sliders as needed.
|
|
|
01-03-2023, 11:07 AM
|
#11
|
Human being with feelings
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,653
|
Quote:
Originally Posted by MST
Could you (or someone) give an example with an extra slider, controlling, for instance, cc19 ?
Then I expect I'll be able to make as many cc sliders as needed.
|
Yeah, sure! Note that for two sliders I would do it this way, but for e.g. 10 sliders I would probably do it differently (i.e. I would try to combine the repetitive code in both @slider and @block in a loop). However, that would be more complicated... I think this is easier to understand. For now anyway.
Code:
desc:Send CC#18 / CC#19
slider1:0<0,127,1>CC#18
slider2:0<0,127,1>CC#19
@init
ch = 0; // 0..15
// CC#18
cc1 = 18;
old_value1 = -1;
// CC#19
cc2 = 19;
old_value2 = -1;
@slider
// CC#18
value1 = min(max(0, slider1|0), 127);
// CC#19
value2 = min(max(0, slider2|0), 127);
@block
// CC#18
value1 != old_value1 ? (
old_value1 = value1;
midisend(0, 0xB0 | ch, cc1, value1);
);
// CC#19
value2 != old_value2 ? (
old_value2 = value2;
midisend(0, 0xB0 | ch, cc2, value2);
);
|
|
|
01-04-2023, 04:26 PM
|
#12
|
Human being with feelings
Join Date: May 2021
Posts: 112
|
Awesome, it works, and I can do with it what I want, thank you !!
Yes, I've got a lot to learn, but I don't mind writing overcomplicated codes when I know I'll get a good result.
I might drop by again with a question about parameter feedback, but at the moment I'm happy, and I'll first indulge myself with some study before I dare to ask more.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 05:18 PM.
|