11-09-2013, 01:40 PM
|
#1 |
|
Human being with feelings
Join Date: Nov 2013
Location: France
Posts: 185
|
Hi !
I'm just starting to work with JS scripts, but I think this is a bug. When a JS script is activated after an "init", the value of the system variable num_ch is equal to 0 during the processing of the first audio buffer. After that, it takes the correct value. Try the following script : insert it as an FX, then open the "edit" window to monitor the values of variables "bcnt" and "zz". desc:Trying to show a bug in JS // @init bcnt=0; zz=99; @sample (num_ch == 0) ? (bcnt+=1;zz=num_ch; ) ; // end After the script is loaded, "bcnt" is set to 0, and "zz" to 99. As soon as the track is activated, samples are sent to the script. Then, these values become 512 (bcnt) and 0 (zz), which shows that during the first 512 samples (the size of the internal buffer), num_ch is not equal to 2 (or the number of channels of the track), but to 0. I am working with Mac OS X (10.5.8) and REAPER v4.54 Best Regards. Jack. |
|
|
10-24-2024, 05:03 AM
|
#2 |
|
Human being with feelings
Join Date: Jul 2019
Posts: 11
|
I have the very same issue with an elementary plugin supposed to zero-out a single channel of a multichannel track. My problem is that num_ch seems to be updated *after* the processing of the first vector, so that the first vector still plays the unwanted channel.
To reproduce, below is the stripped version of the plugin showing the issue: place it on a track with a multitrack audio channel which has some non-zero samples on the seventh channel at the very beginning of the playback. Does anyone know a workaround to update num_ch before the processing? ================= desc:KillChannel @init @sample c = 0; loop(num_ch, (spl(c) = (c==6 ? 0 : spl(c))); c+=1; ); Last edited by danieleghisi; 10-24-2024 at 05:04 AM. Reason: removed emoticon created within line of code |
|
|
10-24-2024, 05:42 AM
|
#3 |
|
Administrator
Join Date: Mar 2007
Location: NY
Posts: 17,784
|
Fixing, thanks for the report.
|
|
|
![]() |
| Thread Tools | |
|
|