Nice, so a menu to instantly reach "Basic Code", "advanced functions", "Special Variables" on every page would be nice. Also "advanced functions" is all in small letters on the buttom of this page http://reaper.fm/sdk/js/basiccode.php while on all other pages it has capital (as all other page references (like Basic Code ...) have).

freembuf(top)
The freembuf() function provides a facility for you to notify the memory manager that you are no longer using a portion of the local memory buffer.

For example, if the user changed a parameter on your effect halving your memory requirements, you should use the lowest indices possible, and call this function with the highest index you are using plus 1, i.e. if you are using 128,000 items, you should call freembuf(128001); If you are no longer using any memory, you should call freembuf(0);

if you are using 128,000 items the highest index is 127,999, so you should call freembuf(128000).

am i going nuts or did somebody at cockos make a mistake here?

//EDIT: i'm gonna be nice and use this function but just in case i AM going nuts, i'll use highest index + 2

One thing I missed as a newbie (just started a thread about it)--there should probably be a section about the format of the sample data I'll be seeing. What is the range? Always stereo? Do I have a pointer to it? Is it an array to me in JS?

Maybe one little fully commented simple filter plug would suffice.

Edit: On second reading, I found a mention of the range in the Special Variables" section. I must have glossed over that section in my fist reading.

Maybe what I'm looking for is a tutorial. I suppose I could write one as I make my way. :-)

Here's what I found was missing or wasn't clear enough for me in the doc - for the sake of future JS users :

1) Sliders.

a. You can define up to 64 sliders from slider1 to slider64.b. Slider values can also be accessed with a variable index : slider(1), slider(2), ... slider(variable).

Code:

i=1; loop(64, x+=slider(i) ; i+=1);

c. You can make sliders invisible in the default interface by adding "- " before their name :

Code:

@slider
slider1:0<0,127,1>control change
slider2:0<0,127,1>- X coordinate
slider3:0<0,127,1>- Y coordinate
// Only the first slider will be visible in the default interface.
// You can create your own graphical user interface to use slider2 and slider3.

***

2) Arrays.

There is only one array available, its index goes from 0 to 8388607.
You have to define in @init where your sub-arrays will be located (their offset) in this big array.

It is stated in the doc that the @gfx section runs in a separate thread from @block and @sample so the variable i can be modified in @block and in @gfx concurrently.
You have to use 2 different variables, i and ii for example :

I used the built in script editor of Reaper ("edit" button clicked in FX window) to change an existing js Midi effect. My changed version of "midi_note_filter" now filters away the unwanted "All Notes Off" messages generated by my Roland D50 keyboard.

Instead of changing an existing effect I'd prefer to create a copy and edit the copy. However this does not work. If I add a new effect file into the Reaper sub-directory C:\Programs\REAPER\InstallData\Effects\MIDI and restart reaper the new effect does not appear in the "add fx to" screen. What did I miss? I am clueless.. any hints would be very much appreciated!

I first did not find the folder "Application Data" you mentioned for XP. Then I figured out it is by default invisible so I had to enable display of hidden files and folders in the folder options. Also in the german version of XP it is called "Anwendungsdaten" instead of "Application Data".

I checked the js documentation, http://www.reaper.fm/sdk/js/js.php , unfortunately could not find out what is the name of the "slider" BYPASS which is available on each effect?

I would like to send/trigger certain codes/events based on "bypass parameter change" of that js effect. For example in midi_transpose js effect, after each bypass toggling I would like to send "all notes off" for that track. But how can I tell in js language:

When Jesusonic increments x up to 0, that statement returns 0, which means false, and false statements at the end of while loops break the loop, so the while loop ends early.
Adding the "1;" statement ensures the last line of the while loop is true. Now the loop won't break until the if-condition is false.
Another way to write the while loop is to not use an if-statement and instead put the while-condition all by itself on the last line. If you do this, DON'T put in a "1;" or you'll get an infinite loop: