|
|
|
04-04-2019, 09:41 AM
|
#1
|
Human being with feelings
Join Date: Dec 2015
Posts: 172
|
Optimal way to play sound from Lua Script?
Hi, guys!
What is the optimal way to play sound from Lua Script? Just for auditioning samples, like in browser. I know that Reaper's Lua is not for realtime work with sound, but... I think there are at least several methods.
For example - you can Load Sample to RS5k(using Lua), make track record and MIDI enabled and and send some notes to track with RS5k. But... It seems too complicated (((
Can you help me to find more suitable way?
Last edited by kartalex; 04-04-2019 at 02:46 PM.
|
|
|
04-04-2019, 01:07 PM
|
#2
|
Human being with feelings
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
|
I don't recall there is any straight-forward way to do it from plain ReaScript.
You could suggest to Julian Sader, the developer of the js_ReaScriptAPI extension plugin, to add something for that. I might also myself look if there's some sensible way to add something into that plugin to allow that. Reaper does have a mechanism available for C++ extension plugins to play a PCM_source object (read, "audio file") into the main audio hardware output.
edit : I already got the playback working. But as usual, stopping (properly) is more complicated than anticipated...
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
Last edited by Xenakios; 04-04-2019 at 01:49 PM.
|
|
|
04-04-2019, 03:51 PM
|
#3
|
Human being with feelings
Join Date: Dec 2015
Posts: 172
|
Quote:
Originally Posted by Xenakios
I don't recall there is any straight-forward way to do it from plain ReaScript.
You could suggest to Julian Sader, the developer of the js_ReaScriptAPI extension plugin, to add something for that. I might also myself look if there's some sensible way to add something into that plugin to allow that. Reaper does have a mechanism available for C++ extension plugins to play a PCM_source object (read, "audio file") into the main audio hardware output.
edit : I already got the playback working. But as usual, stopping (properly) is more complicated than anticipated...
|
Cool, Xenakios!
I've posted the same question in Julian's thread, thank you!
|
|
|
04-05-2019, 05:21 AM
|
#4
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,630
|
Quote:
Originally Posted by Xenakios
I don't recall there is any straight-forward way to do it from plain ReaScript.
You could suggest to Julian Sader, the developer of the js_ReaScriptAPI extension plugin, to add something for that. I might also myself look if there's some sensible way to add something into that plugin to allow that. Reaper does have a mechanism available for C++ extension plugins to play a PCM_source object (read, "audio file") into the main audio hardware output.
edit : I already got the playback working. But as usual, stopping (properly) is more complicated than anticipated...
|
Oh Boy..this would be awesome
We are in desperate need of such a function at Ultraschall
|
|
|
04-10-2019, 05:24 AM
|
#5
|
Human being with feelings
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
|
After doing some fixes in the extension code, it looks like cleaning up the playback objects might now be working, but I need to do some additional tests.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
|
|
|
04-10-2019, 02:16 PM
|
#6
|
Human being with feelings
Join Date: Dec 2015
Posts: 172
|
Quote:
Originally Posted by Xenakios
After doing some fixes in the extension code, it looks like cleaning up the playback objects might now be working, but I need to do some additional tests.
|
Great news! Can't wait for it
|
|
|
09-15-2020, 06:53 PM
|
#7
|
Human being with feelings
Join Date: Dec 2017
Posts: 179
|
Anyone ever figure out how to play a sound from reascript?
|
|
|
09-15-2020, 07:25 PM
|
#8
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,630
|
|
|
|
09-16-2020, 10:02 AM
|
#9
|
Human being with feelings
Join Date: Dec 2017
Posts: 179
|
Thanks this is amazing!
|
|
|
09-17-2020, 12:25 AM
|
#10
|
Human being with feelings
Join Date: Sep 2018
Location: China
Posts: 565
|
Is it able to preview a file not start from the beginning?
|
|
|
09-17-2020, 02:18 AM
|
#11
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,630
|
Nope.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 06:51 PM.
|