Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER General Discussion Forum

Reply
 
Thread Tools Display Modes
Old 02-08-2018, 03:36 PM   #1
Robert Randolph
Human being with feelings
 
Robert Randolph's Avatar
 
Join Date: Apr 2017
Location: St. Petersburg, FL
Posts: 880
Default JSFX tutorial for the total Newbie - guide

So I wrote a MIDI Note to CC plugin recently, and I thought I'd write a guide to how it's done.

I cover everything from basic MIDI concepts, to JSFX basics, to programming basics etc... I assume that the only thing you know is what Reaper is, how to create a text file and how to type.

There's no ads or anything on my site. So this is totally free unless you feel obliged to donate. (or become a patreon)

If you have any comments, questions or just want to berate me then I'm welcome to hear it. Thanks!

http://admiralbumblebee.com/music/20...m-scratch.html

p.s. I posted it here rather than the JSFX&ReaScript forum so that people _not_ generally interested in scripting already can see it.

EDIT - I don't even assume you know how to create a text file any more. The Tutorial is now 33% easier! (I'm sure that math works out)

Last edited by Robert Randolph; 02-08-2018 at 09:25 PM.
Robert Randolph is offline   Reply With Quote
Old 02-08-2018, 04:11 PM   #2
domzy
Human being with feelings
 
Join Date: Feb 2017
Posts: 4,540
Default

cheers! i'll check it out.
domzy is offline   Reply With Quote
Old 02-08-2018, 06:51 PM   #3
Melvin J.
Human being with feelings
 
Melvin J.'s Avatar
 
Join Date: Apr 2010
Location: South West Michigan
Posts: 256
Default

Dude, you are the shit! I'm definitely going to dive into this as I've been wondering for a while now on how to program a JS. Thanks!
__________________
ADK Laptop Intel i7 2860QM, 8 GB RAM, Avid MBOX Pro 3 (BLA Modified), Novation Remote SL37, DSI Mopho, DSI Tempest, Trilian, Aether 1.5.1, Valhalla, Nerve, Komplete 7
Melvin J. is offline   Reply With Quote
Old 02-08-2018, 07:35 PM   #4
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,229
Default

Awesome, thank you! Reading now...

Some comments:
  • you can create a new JSFX from the FX browser (avoiding having to use an external text editor).
  • this was undocumented (oops, fixed), but rather than using
    Code:
    ccValue = slider1;
    You can do:
    Code:
    slider1:ccValue=0<0,127,1>CC to send
    (supported in REAPER 5.0+)
  • You can also debug JSFX by using Ctrl/Cmd+K on a symbol to read its value (or if it points to memory, it will show you the value at that point in memory).
  • JSFX can't actually be used to write video processors, but the language is the same for video processors (as well as EEL ReaScripts).
  • I might ask you to ditch that askjf link if I get enough noise...

Last edited by Justin; 02-08-2018 at 08:09 PM.
Justin is offline   Reply With Quote
Old 02-08-2018, 09:22 PM   #5
Robert Randolph
Human being with feelings
 
Robert Randolph's Avatar
 
Join Date: Apr 2017
Location: St. Petersburg, FL
Posts: 880
Default

Quote:
Originally Posted by Justin View Post
Awesome, thank you! Reading now...

Some comments:
  • you can create a new JSFX from the FX browser (avoiding having to use an external text editor).
  • this was undocumented (oops, fixed), but rather than using
    Code:
    ccValue = slider1;
    You can do:
    Code:
    slider1:ccValue=0<0,127,1>CC to send
    (supported in REAPER 5.0+)
  • You can also debug JSFX by using Ctrl/Cmd+K on a symbol to read its value (or if it points to memory, it will show you the value at that point in memory).
  • JSFX can't actually be used to write video processors, but the language is the same for video processors (as well as EEL ReaScripts).
  • I might ask you to ditch that askjf link if I get enough noise...

Awesome. I updated everything you listed and switched the askjf link.

Thank you very much for reading and the corrections! I feel annointed by the Holy Reaper Seer now.
Robert Randolph is offline   Reply With Quote
Old 02-08-2018, 11:30 PM   #6
lolilol1975
Human being with feelings
 
Join Date: Dec 2015
Posts: 1,685
Default

Quote:
Originally Posted by Robert Randolph View Post
So I wrote a MIDI Note to CC plugin recently, and I thought I'd write a guide to how it's done.

I cover everything from basic MIDI concepts, to JSFX basics, to programming basics etc... I assume that the only thing you know is what Reaper is, how to create a text file and how to type.

There's no ads or anything on my site. So this is totally free unless you feel obliged to donate. (or become a patreon)

If you have any comments, questions or just want to berate me then I'm welcome to hear it. Thanks!

http://admiralbumblebee.com/music/20...m-scratch.html

p.s. I posted it here rather than the JSFX&ReaScript forum so that people _not_ generally interested in scripting already can see it.

EDIT - I don't even assume you know how to create a text file any more. The Tutorial is now 33% easier! (I'm sure that math works out)
You rock, man ! Awesome blog btw.
lolilol1975 is offline   Reply With Quote
Old 02-09-2018, 12:25 AM   #7
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,514
Default

Cool!

A very minor nitpick, but it might be worth mentioning anyway: You can also write hex numbers as e.g. 0x90 instead of $x90. This is more in line with other programming languages e.g. C/C++, JavaScript, etc. This does require REAPER v4.25+.
Tale is offline   Reply With Quote
Old 02-09-2018, 01:11 AM   #8
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,238
Default

Very nice !

I hope it will help users to make their own modes :P

What's next step ?
Audio Processing ?
GFX ? :P
X-Raym is offline   Reply With Quote
Old 02-09-2018, 09:28 AM   #9
Robert Randolph
Human being with feelings
 
Robert Randolph's Avatar
 
Join Date: Apr 2017
Location: St. Petersburg, FL
Posts: 880
Default

Quote:
Originally Posted by Tale View Post
Cool!

A very minor nitpick, but it might be worth mentioning anyway: You can also write hex numbers as e.g. 0x90 instead of $x90. This is more in line with other programming languages e.g. C/C++, JavaScript, etc. This does require REAPER v4.25+.
Thanks. I wasn't aware of that.

I picked up the $x notation (and most of the JSFX syntax) by reading through other scripts.

Unfortunately I don't think I can fully correct the $x usage, since there's so many screenshots that use the $x notation. I will update the post to mention it though.
Robert Randolph is offline   Reply With Quote
Old 02-11-2018, 04:03 AM   #10
Tale
Human being with feelings
 
Tale's Avatar
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 3,514
Default

Quote:
Originally Posted by Robert Randolph View Post
Unfortunately I don't think I can fully correct the $x usage, since there's so many screenshots that use the $x notation.
Of course! I guess in the end it's more of a personal preference anyway.

Quote:
Originally Posted by Robert Randolph View Post
I will update the post to mention it though.
Cool. Do note however that is should be 0x0F, not just x0F.
Tale is offline   Reply With Quote
Old 02-11-2018, 05:56 AM   #11
martifingers
Human being with feelings
 
Join Date: May 2011
Posts: 2,633
Default

As pretty much your target audience I think it was very generous of you to share your time and expertise. As to the content, the best compliment I can pay you would be to say you may be the Kenny of the JSFX world!
martifingers is offline   Reply With Quote
Old 02-12-2018, 01:21 PM   #12
pbattersby
Human being with feelings
 
pbattersby's Avatar
 
Join Date: Jun 2012
Posts: 348
Default

Quote:
Originally Posted by Robert Randolph View Post
So I wrote a MIDI Note to CC plugin recently, and I thought I'd write a guide to how it's done.
Well done. I imagine creating that tutorial was a lot of work. If/when I decide I want to write a plugin, I'll be back to work through the tutorial in detail.

Note, the link in this text near the top of the tutorial:

"This tutorial really isn’t for you, but maybe you can skip to results to see what happened."

... needs to target the anchor #result (singular) rather than the anchor #results (plural) which doesn't exist.

Despite having clicked that link, the tutorial is for me (even though I'm an experienced programmer), I was curious to skip to the end then come back or the beginning.
__________________
Paul Battersby
Virtual Playing Orchestra - free sample library @ http://virtualplaying.com
pbattersby is offline   Reply With Quote
Old 02-12-2018, 06:59 PM   #13
pipelineaudio
Mortal
 
pipelineaudio's Avatar
 
Join Date: Jan 2006
Location: Wickenburg, Arizona
Posts: 14,009
Default

Thank you for this, this is awesome!
pipelineaudio is offline   Reply With Quote
Old 02-12-2018, 08:16 PM   #14
Robert Randolph
Human being with feelings
 
Robert Randolph's Avatar
 
Join Date: Apr 2017
Location: St. Petersburg, FL
Posts: 880
Default

Quote:
Originally Posted by pbattersby View Post
Well done. I imagine creating that tutorial was a lot of work. If/when I decide I want to write a plugin, I'll be back to work through the tutorial in detail.

Note, the link in this text near the top of the tutorial:

"This tutorial really isn’t for you, but maybe you can skip to results to see what happened."

... needs to target the anchor #result (singular) rather than the anchor #results (plural) which doesn't exist.

Despite having clicked that link, the tutorial is for me (even though I'm an experienced programmer), I was curious to skip to the end then come back or the beginning.
Great catch on that anchor mistake.

I'm fixing it now!
Robert Randolph is offline   Reply With Quote
Old 02-12-2018, 10:02 PM   #15
michaeltonight
Human being with feelings
 
michaeltonight's Avatar
 
Join Date: Jun 2010
Location: Texas
Posts: 353
Default

Whoa! Thank you so much for this! Exactly what I needed, exactly when I needed it!
michaeltonight is offline   Reply With Quote
Old 02-13-2018, 12:33 PM   #16
cyrilfb
Human being with feelings
 
cyrilfb's Avatar
 
Join Date: Apr 2012
Location: Denver, CO
Posts: 249
Default Great Work!

Thanks for this. The level of detail will help many of us.
__________________
Cy Ball
Reaper + inspiration = music.
soundcloud.com/cyball or cyball.bandcamp.com/ or cyrilfb.com
cyrilfb is offline   Reply With Quote
Reply

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:31 PM.


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