Old 12-06-2019, 08:37 AM   #1
Human being with feelings
Join Date: Dec 2019
Posts: 1
Default Slider Types programming Examples

Hello all there,

im new here because i have a Problem or a Question with the regular slider Code.

im About to create JS Controller Plugins for all my Hardware. I have realized cc, sysex, sysex with checksum (Roland), Nrpn Slider. For Mixer and Synthies.

At my last Plugin for the DSI Tetra 4 i have checked that when the sequencer starts , some slider values will be send through the sequencer and to the Hardware. The sequencer starts with puffering and delayed and the Sound will be sometimes changed from the synth.

Now my Question, is it possible to create a type of slider which are not send at start, means they are send only when i Change a value ?

im using:

(slider8 != oldslider8) ?
msgbuf[0] = $x00;
msgbuf[1] = $x20;
msgbuf[2] = $x32;
msgbuf[3] = $x00;
msgbuf[4] = $x0b;
msgbuf[5] = $x20;
msgbuf[6] = $x01;

msgbuf[7] = floor(slider1); // Channel

msgbuf[8] = Feqlowfreq; // Funktion
msgbuf[9] = floor(slider8) / 256; // Wert über 256
msgbuf[10] = floor(slider8); // Wert

oldslider8 = slider8;


in the Reaper JSFX Programming Manual is written:

The code in the @slider section gets executed following an @init, or when a parameter (slider) changes. Ideally code in here should detect when a slider has changed, and adapt to the new parameters (ideally avoiding clicks or glitches). The parameters defined with sliderX: can be read using the variables sliderX.

Point: Ideally code in here should detect when a slider has changed, and adapt to the new parameters (ideally avoiding clicks or glitches).

Is it possible to Code a slider without this functions ?

Or Maybe i understand it wrong. ;-)

Thanks and best Regards
boureux is offline   Reply With Quote
Old Today, 02:57 AM   #2
Human being with feelings
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,387

You might want to set ext_noinit=1 which will stop @init being called so much...

Context: @init only
Set this variable to 1.0 in your @init section if you do not wish for @init to be called (and variables/RAM to be possibly cleared) on every transport start
If that's not enough then you could try something like this to prevent changes being sent when the plugin loads...


init_done ?
   slider8 != oldslider8 ?



init_done = 1;
To avoid clicks/glitches you can use a one-pole filter to transition smoothly to the new value over a period of time. Here's a good explanation in the snippets thread...https://forum.cockos.com/showpost.ph...0&postcount=60
IXix is offline   Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -7. The time now is 08:42 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.