|
|
|
10-27-2019, 10:05 PM
|
#521
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,968
|
Is is not necessary. Just type reaper.Main_OnCommand rather than Main_OnCommand.
|
|
|
10-31-2019, 01:01 AM
|
#523
|
Human being with feelings
Join Date: Sep 2018
Posts: 62
|
How do I clear (reset to default) the color of a track or item in lua?
|
|
|
10-31-2019, 02:13 AM
|
#524
|
Human being with feelings
Join Date: May 2015
Location: Québec, Canada
Posts: 4,968
|
Clear the 25th bit of I_CUSTOMCOLOR to disable a track or item's custom color.
Code:
local track = reaper.GetTrack(0, 0)
local color = reaper.GetMediaTrackInfo_Value(track, 'I_CUSTOMCOLOR')
color = color & ~(1<<8*3)
reaper.SetMediaTrackInfo_Value(track, 'I_CUSTOMCOLOR', color)
|
|
|
10-31-2019, 02:33 AM
|
#525
|
Human being with feelings
Join Date: Sep 2018
Posts: 62
|
Quote:
Originally Posted by cfillion
Clear the 25th bit of I_CUSTOMCOLOR to disable a track or item's custom color.
Code:
local track = reaper.GetTrack(0, 0)
local color = reaper.GetMediaTrackInfo_Value(track, 'I_CUSTOMCOLOR')
color = color & ~(1<<8*3)
reaper.SetMediaTrackInfo_Value(track, 'I_CUSTOMCOLOR', color)
|
Awesome, thanks!!
|
|
|
10-31-2019, 05:34 PM
|
#526
|
Human being with feelings
Join Date: Dec 2008
Posts: 78
|
Quote:
Originally Posted by cfillion
Is is not necessary. Just type reaper.Main_OnCommand rather than Main_OnCommand.
|
Quote:
Originally Posted by Edgemeal
|
Thanks a lot for the info and advice, I have managed to remove this from all my scripts as well.
|
|
|
10-31-2019, 10:00 PM
|
#527
|
Human being with feelings
Join Date: May 2019
Location: Front Range Colorado
Posts: 17
|
JS "phase" variable
I recently began looking into phase correlation/cancellation issues. This got me looking into LOSER's "JS Channel Phase Meter" plugin and the JSFX code therein. LOSER uses the variable "phase" in this code. This is clearly a system variable as it is referenced without ever being initialized. And it is obviously some measure of phase correlation. But where is "phase" documented? What exactly does it measure? Why does it vary with his "Check Interval" slider? I don't find anything in the https://www.reaper.fm/sdk/js/js.php documentation on "phase". More generally, where does one find documentation/resources for the audio concepts in JSFX (i.e., beyond just JS syntax and basics)? [Maybe this should be in newbieland forum but I didn't see any JS Qs in there.]
|
|
|
10-31-2019, 10:48 PM
|
#528
|
Human being with feelings
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,785
|
"phase" is just a normal variable.
It's set to zero and counted up and down.
-Michael
|
|
|
11-01-2019, 03:53 AM
|
#529
|
Human being with feelings
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
|
Quote:
Originally Posted by IonianStreams
This is clearly a system variable as it is referenced without ever being initialized.
|
It's not a system variable, it's zeroed in the @block section of the code. The "t" variable is more suspect as it's never zeroed anywhere and is also not a system variable. (Could be Eel/JesuSonic always initializes user variables to zero, though...)
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
|
|
|
11-01-2019, 10:25 AM
|
#530
|
Human being with feelings
Join Date: May 2019
Location: Front Range Colorado
Posts: 17
|
JS "phase" variable
Thanks mschnell and Xenakios. You're both absolutely right. This is my first look at JS and I completely missed that phase line in @samples!
In the bigger picture, what I'm after is a phase correlation meter that shows more than just a hyperactive, flickering dot/slider showing the instantaneous phase (and "JS Channel Phase Meter" doesn't even show that, only "IN" and "OUT"). For example, Ozone's free Imager meter shows such a dot that floats between -1 and 1. I find myself watching it and trying to take a mental average of the value over the length of the song section I'm investigating. Why not have the meter compute/display such an average? I've not seen this in any of the JS or free meters out there.
So I programmed something in JS that seems to work. Phase correlation is calculated as done by LOSER and output to a slider at every 1024 samples. The slider mimics the Imager dot pretty well. But the program also calculates a running average of the phase correlation while song is playing, showing it in another slider. Finds the min & max correlation too. Seems to work OK. First, am I missing something in this approach?
Second, I've read that phase is calculated not as 1 or -1 based on sign(spl's) agreement, but as ArcTangent(spl0/spl1). Any comments on this is much appreciated.
|
|
|
11-02-2019, 09:45 AM
|
#531
|
Human being with feelings
Join Date: May 2019
Location: Front Range Colorado
Posts: 17
|
JS "phase" variable
I found another LOSER JSFX, "JS Stereo Field Manipulator", in which he calculates the phase "angle" using the atan(spl0/spl1) math I was asking about. He uses it to rotate the phase. I guess the best way to learn this stuff is just by studying the experts' code. Climbing the learning curve. It's pretty cool that Reaper offers the ability to program your own fx.
|
|
|
11-06-2019, 09:06 PM
|
#532
|
Human being with feelings
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
|
Determine recording MIDI items
Is there a way to efficiently determine the list of MIDI items that are being actively recorded at any given moment?
I say efficiently because I want to do this continuously within a deferred loop given that the target items can actually change over time (e.g. as the play cursor traverses over other MIDI items with MIDI overdub enabled).
Otherwise I'm sure I could figure out how to do it the slow way. (Fetch current play position, enumerate over all tracks, determine which tracks are armed for recording, enumerate MIDI items on each armed track, determine which MIDI items intersect with the play position.) But I'd rather not, because that way is *very* inefficient.
|
|
|
11-08-2019, 10:38 AM
|
#533
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,630
|
Quote:
Originally Posted by tack
Is there a way to efficiently determine the list of MIDI items that are being actively recorded at any given moment?
I say efficiently because I want to do this continuously within a deferred loop given that the target items can actually change over time (e.g. as the play cursor traverses over other MIDI items with MIDI overdub enabled).
Otherwise I'm sure I could figure out how to do it the slow way. (Fetch current play position, enumerate over all tracks, determine which tracks are armed for recording, enumerate MIDI items on each armed track, determine which MIDI items intersect with the play position.) But I'd rather not, because that way is *very* inefficient.
|
You could try to select the items at cursorposition(don't know, if there's an action for that) and just check them, using GetSelectedMediaItem
https://mespotin.uber.space/Ultrasch...ectedMediaItem
This is way faster than checking all MediaItems.
You may need to revert the item-selection after that again.
Edit:
This action could work, you would need to temporarily move the editcursor for that and select all tracks:
_XENAKIOS_SELITEMSUNDEDCURSELTX - Xenakios/SWS: Select items under edit cursor on selected tracks
|
|
|
11-08-2019, 10:43 AM
|
#534
|
Human being with feelings
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
|
Quote:
Originally Posted by mespotine
You could try to select the items at cursorposition(don't know, if there's an action for that)
|
It's an interesting idea. There's an action to select items under the edit cursor, but alas I don't see one to select items under the play cursor (which is the one that advances during recording).
|
|
|
11-08-2019, 10:45 AM
|
#535
|
Human being with feelings
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
|
Quote:
Originally Posted by mespotine
Edit:
This action could work, you would need to temporarily move the editcursor for that and select all tracks:
_XENAKIOS_SELITEMSUNDEDCURSELTX - Xenakios/SWS: Select items under edit cursor on selected tracks
|
Bearing in mind this would need to be called in each defer execution, I guess I'd have to move the edit cursor, run the action, and move it back, about 30 times a second.
Maybe that's not the end of the world if that honors PreventUIRefresh(). I'll give that a shot. Thanks for the idea!
|
|
|
11-08-2019, 10:48 AM
|
#536
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,630
|
It should survive 30 times per second, unless you work with thousands of tracks, according to my experiences.
|
|
|
11-08-2019, 11:11 AM
|
#537
|
Human being with feelings
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
|
Quote:
Originally Posted by mespotine
It should survive 30 times per second, unless you work with thousands of tracks, according to my experiences.
|
Well it was worth a shot, but it wreaks havoc on the undo history (Unselect all items + Select items under edit cursor in the undo history for each defer call). Also it doesn't seem to be possible to select items currently being recorded unless the track is set to one of the MIDI overdub/replace modes.
What I had wanted to do was to mimic Logic's behavior where recording MIDI items were red and active in the MIDI editor. That behavior isn't looking overly achievable in Reaper so far.
Thanks for the ideas anyway, mespotine!
|
|
|
11-16-2019, 08:16 AM
|
#538
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
Is there an easy way to import KeyMaps from ReaScript? I can't seem to find any API relevant for Lua scripts.
I would like to automatically update reaper-kb.ini and I would like to chose to only import actions/macros or only shortcuts from ReaperKeyMap files.
Bonus question: would it be possible to do the same for menus?
|
|
|
11-17-2019, 09:48 AM
|
#539
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,630
|
Short answer, no.
Long answer, I'm working on that for Ultraschall - Api.
Do you mean import at runtime or is importing with restart ok too?
|
|
|
11-19-2019, 04:03 AM
|
#540
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
Quote:
Originally Posted by mespotine
Short answer, no.
Long answer, I'm working on that for Ultraschall - Api.
Do you mean import at runtime or is importing with restart ok too?
|
Awesome. Runtime is always the best, but in my case, I can just ask the user to restart.
Maybe it would be possible through an extenstion to get it at runtime?
|
|
|
11-19-2019, 09:02 AM
|
#541
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,630
|
Yes, for more information on that, just head over to this thread:
https://forum.cockos.com/showthread.php?t=226007
Edit: Menus wouldn't be possible that way, but I don't know much about the C++-only-Reaper-functions, who allow accessing the menu. Maybe it's possible that way...
|
|
|
11-27-2019, 02:51 PM
|
#542
|
Human being with feelings
Join Date: Mar 2019
Posts: 428
|
How to call custom action from a script? I am trying to call a custom action through a lua script like: reaper.Main_OnCommand(reaper.NamedCommandLookup( "_749daf2e6c9d244d99884fae060ecce6"), 0, 0)
But the action is not triggering for some reason, is there anything that i am missing?
|
|
|
11-27-2019, 05:02 PM
|
#543
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,630
|
In which section is the action? Main?
|
|
|
11-27-2019, 05:08 PM
|
#544
|
Human being with feelings
Join Date: Mar 2019
Posts: 428
|
The command is on the MIDI Editor, is there a different call in the API for that?
Edit: Thanks, there is, i just saw it
|
|
|
11-28-2019, 09:26 AM
|
#545
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,630
|
Can we access gmem-states from the C++-extension-API somehow?
|
|
|
12-05-2019, 11:17 AM
|
#546
|
Human being with feelings
Join Date: Nov 2012
Posts: 47
|
Hi,
I´ve developed an EQ plugin with JUCE and would love to add it´s GUI to the REAPER 6 MCP, with the new "embedded FX GUI" feature.
Would anyone have any starters on how this could be acheived? I´ve been looking around but couldn´t find anything...
|
|
|
12-05-2019, 12:09 PM
|
#547
|
Human being with feelings
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
|
Quote:
Originally Posted by Gertius
Hi,
I´ve developed an EQ plugin with JUCE and would love to add it´s GUI to the REAPER 6 MCP, with the new "embedded FX GUI" feature.
Would anyone have any starters on how this could be acheived? I´ve been looking around but couldn´t find anything...
|
Oh, this new feature sounds great, exactly what I was looking for, e.g. for embedding permanent VU meter for master. And now we have this feature already?
|
|
|
12-05-2019, 12:41 PM
|
#548
|
Human being with feelings
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
|
Quote:
Originally Posted by pianogineer
I'm trying to use Reaper for live, mainly for backing tracks, but also potentially some keyboard patches. I'm using 1 project per song/set of patches.
|
Backing tracks sounds like spleeter.
|
|
|
12-05-2019, 01:23 PM
|
#549
|
Human being with feelings
Join Date: Nov 2012
Posts: 47
|
Quote:
Originally Posted by TonE
Oh, this new feature sounds great, exactly what I was looking for, e.g. for embedding permanent VU meter for master. And now we have this feature already?
|
Yes! The feature is now implemented. You can already have a permanent VU Meter in Master with "JS VU Meter". You have to right-click the plugin on the track and then select "Show embedded UI in MCP".
Now I would like to know if I can use the feature for my own developments with Juce. If anybody had a hint, I´d be grateful!
|
|
|
12-05-2019, 06:47 PM
|
#550
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,110
|
Quote:
Originally Posted by Gertius
Now I would like to know if I can use the feature for my own developments with Juce. If anybody had a hint, I´d be grateful!
|
Justin said they'll expose the API but afaik it has not happened yet.
https://forum.cockos.com/showthread....60#post2047760
|
|
|
12-06-2019, 08:34 AM
|
#551
|
Human being with feelings
Join Date: Nov 2012
Posts: 47
|
Quote:
Originally Posted by nofish
|
Awesome, thanks for the info! I will monitor the forum I guess. Do you know where things like that will be announced?
|
|
|
12-06-2019, 10:25 AM
|
#552
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
Quote:
Originally Posted by mespotine
Yes, for more information on that, just head over to this thread:
https://forum.cockos.com/showthread.php?t=226007
Edit: Menus wouldn't be possible that way, but I don't know much about the C++-only-Reaper-functions, who allow accessing the menu. Maybe it's possible that way...
|
If I remember correctly, in C++ you can load stuff in the menus, but you can't edit the menu itself permanently - it gets populated at runtime and that's it. I am just searching for a way to quickly update REAPER ReWorked so I don't have to make the user load menus and keymaps by hand. Messing with .ini files here isn't what I would personally like to do - I would rather do it via API so I'm 100% sure these things won't ever break in case of some change.
P.S.
Sorry for the late response!
|
|
|
12-06-2019, 01:55 PM
|
#553
|
Human being with feelings
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
|
Quote:
Originally Posted by Gertius
Yes! The feature is now implemented. You can already have a permanent VU Meter in Master with "JS VU Meter". You have to right-click the plugin on the track and then select "Show embedded UI in MCP".
Now I would like to know if I can use the feature for my own developments with Juce. If anybody had a hint, I´d be grateful!
|
But only for jsfx for now I read in an article, so not any vst? That would be cool. Just the vst gui opened inside the mixer or tcp. Because there are also other nice tools, like spectrogram, but the problem is probably what to do if those are not stretchable by themselves? I guess the solution to that is just using multiple screens. But my laptop has only one screen. Reaper could be optimized for laptop scenarios. How to do it? Check Ableton Live's window concepts. Reaper has already docking but docking should be possible into the tcp or mcp, in any position, e.g. to the side of the master track, at least.
|
|
|
12-09-2019, 04:01 AM
|
#554
|
Human being with feelings
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
|
Quote:
Originally Posted by Gertius
Now I would like to know if I can use the feature for my own developments with Juce. If anybody had a hint, I´d be grateful!
|
The information how to do it for VST2 plugins is now available in :
https://landoleet.org/dev/reaper_plugin.h (look for parts with "fx-embed".)
I would estimate using that is going to be quite challenging from Juce-based plugins. Reaper expects the embedded plugin GUIs to use Lice for the graphics etc. You need to be able to handle vendor specific VST2 canDos and opcodes, and Juce may not currently have the needed support for those, so you may need to alter the Juce source code itself.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.
|
|
|
12-10-2019, 12:28 AM
|
#555
|
Human being with feelings
Join Date: Nov 2012
Posts: 47
|
Quote:
Originally Posted by Xenakios
The information how to do it for VST2 plugins is now available in :
https://landoleet.org/dev/reaper_plugin.h (look for parts with "fx-embed".)
I would estimate using that is going to be quite challenging from Juce-based plugins. Reaper expects the embedded plugin GUIs to use Lice for the graphics etc. You need to be able to handle vendor specific VST2 canDos and opcodes, and Juce may not currently have the needed support for those, so you may need to alter the Juce source code itself.
|
Thanks! I´ll look into it.
|
|
|
12-11-2019, 07:43 PM
|
#556
|
Human being with feelings
Join Date: Sep 2006
Location: Bastrop, Tx
Posts: 162
|
Wait for MIDI event to record
In Digital Performer, you can set the transport to wait to start recording for a MIDI note to be played before it starts recording.
Does that feature exist in Reaper?
|
|
|
01-08-2020, 06:34 PM
|
#557
|
Human being with feelings
Join Date: Jan 2011
Posts: 93
|
haven't coded more than an arduino in forever. is there a way to poll for IP address/port and display it as a UI element of some kind? I've got my bandmates using the web browser interface at practice, but host computer (and naturally IP address) is a revolving door depending on the day. would love to cut preferences navigation out of the setup.
|
|
|
01-11-2020, 07:15 AM
|
#558
|
Human being with feelings
Join Date: Oct 2019
Posts: 42
|
Is it possible to write a macro, that is active in the media explorer? When browsing FX chains and selecting a .RfxChain file, macro should copy this FX chain to the selected track or better replace the existing fx chain - remove existing FX chain and paste the selected chain from the media explorer.
My goal is fast preview of saved presets (FX chains). What I do now is alt+click on FX of the selected track, than drag and drop FX preset from media explorer to the track. Not very efficient.
|
|
|
01-12-2020, 12:17 AM
|
#559
|
Human being with feelings
Join Date: Oct 2019
Posts: 42
|
I don't think it's possible. I can't find a function in the Reaper API for getting selected items in the media explorer. A simple function that returns the filepath of the selected item would be enough for this task, I think.
Another problem would be to insert an RfxChain file to the selected track. TrackFX_AddByName doesn't work with filenames.
Is there is another global interface for all Reaper windows/dialogs? I mean something like "GET VALUE OF SELECTED ITEM IN THE ACTIVE WINDOW"? In this case the filepath of selected items in the media explorer?
Or another idea. There is TrackFX_CopyToTrack, that copies from a MediaTrack object. Is it possible to get a pointer to Media Explorer window and convert this to a MediaTrack object?
|
|
|
01-14-2020, 12:05 PM
|
#560
|
Human being with feelings
Join Date: Aug 2016
Posts: 28
|
When Reaper is slave, how to align Reaper's grid with master grid
I have the following situation:
I'm streaming a Midi performance from my custom application into Reaper that I want to record.
In Reaper I use several tempo-synced FX that have cycle lengths of up to 1 bar, such as LFO tools and loopers / beat-repeat FX.
The BPM of the performance is varying, so I want to slave Reaper to my master tempo / grid.
My custom companion VST is already setting the BPM via the API but how can I align the grid (so that my tempo-synced FX are synced to my master grid)?
In other words, how can I sync the bar-phase?
Is the only option for this to emulate "beat-matching" (actually bar-matching) by having my VST set a higher/lower BPM temporarily until the phase is aligned?
I hope not, because I want to record the Midi performance without warping the grid/timeline in the recording too much:
All recorded Midi events should be on the same grid positions/offsets in Reaper as they are in my master application that's streaming the Midi into Reaper (and they wouldn't be, if I had to emulate beat-matching).
Any idea how to sync the bar-phase via ReaScript API calls?
|
|
|
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 03:51 AM.
|