Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 12-06-2021, 07:41 AM   #1
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 425
Default Using export_buffer_to_project() hangs and crashes REAPER

Using export_buffer_to_project() in a @slider block in a JSFX hangs and crashes REAPER if:
* The project is playing back
* The JSFX is on the monitoring FX chain

It is still possible to trigger the crash while the JSFX plugin is on tracks instead, but it happens less frequently.


REAPER version: 6.42
OS: Windows 10 64bit

Perhaps using export_buffer_to_project() in the @slider block is not a good idea in the first place, but as far as I can tell this is the only place where we can use this function without showing the JSFX plugins gfx window.
__________________
ReaScript Discord Server | Scripts | JSFX
BirdBird is offline   Reply With Quote
Old 12-06-2021, 05:07 PM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

Hmm yeah don’t do that, it’s nit allowed (we’ll make that enforced).

I'll look at adding an option to have @gfx run even when the window is closed (for idle processing), that could be useful.

Last edited by Justin; 12-06-2021 at 05:17 PM.
Justin is offline   Reply With Quote
Old 12-06-2021, 05:35 PM   #3
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 425
Default

Awesome, thank you Justin!
BirdBird is offline   Reply With Quote
Old 12-07-2021, 11:14 AM   #4
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

Today's dev build adds support for options:gfx_idle or options:gfx_idle_only and a gfx_is_idle variable
Justin is offline   Reply With Quote
Old 12-07-2021, 12:18 PM   #5
nvk
Human being with feelings
 
nvk's Avatar
 
Join Date: Jul 2019
Posts: 156
Default

Would it be possible to add export_buffer_to_project to the documentation? It seems very useful. I'm not exactly sure what planar_pitch is supposed to do.
nvk is offline   Reply With Quote
Old 12-07-2021, 04:59 PM   #6
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

Quote:
Originally Posted by nvk View Post
Would it be possible to add export_buffer_to_project to the documentation? It seems very useful. I'm not exactly sure what planar_pitch is supposed to do.
Ah yeah, it's about that time.

For multichannel exports: planar_pitch should be 0 if interleaved, otherwise it is the distance in memory between channels.

As an example, suppose nch=2, your left channel is at offset 1, your right channel at offset 10000001, and you're writing 32768 samples, you'd call:

export_buffer_to_project(1,32768, 2, srate,trackidx,flags=0, 10000001-1 /* or right_channel-left_channel */);
Justin is offline   Reply With Quote
Old 12-07-2021, 06:06 PM   #7
nvk
Human being with feelings
 
nvk's Avatar
 
Join Date: Jul 2019
Posts: 156
Default

Quote:
Originally Posted by Justin View Post
Ah yeah, it's about that time.

For multichannel exports: planar_pitch should be 0 if interleaved, otherwise it is the distance in memory between channels.

As an example, suppose nch=2, your left channel is at offset 1, your right channel at offset 10000001, and you're writing 32768 samples, you'd call:

export_buffer_to_project(1,32768, 2, srate,trackidx,flags=0, 10000001-1 /* or right_channel-left_channel */);
Thanks, that makes sense!
nvk is offline   Reply With Quote
Old 12-07-2021, 07:16 PM   #8
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 15,721
Default

https://www.reaper.fm/sdk/js/advfunc...fer_to_project
Justin is offline   Reply With Quote
Old 12-07-2021, 08:50 PM   #9
nvk
Human being with feelings
 
nvk's Avatar
 
Join Date: Jul 2019
Posts: 156
Default

Awesome, much appreciated!
nvk 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:43 AM.


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