Old 12-02-2016, 09:54 AM   #241
joe2
Human being with feelings
 
Join Date: Sep 2008
Location: UK
Posts: 360
Default

Quote:
Originally Posted by spk77 View Post
Grid/Snap settings seems to be stored into rpp files?

My request is - Easier access to the "Grid/Snap settings":
  • get checkbox states (from the "Grid/Snap settings" dialog)
  • get values from the edit boxes and dropdown lists

Thank you.

I'm also interested in this but would like to be able to set values as well.

I'm wondering if a feasible more general approach would be something like set_config_var -- is there any way to do that at the moment? (I'm guessing not.)

e.g. I'm currently doing something involving:

Code:
int *projshowgrid = (int *)get_config_var("projshowgrid", &sz0);

int *maxsnaptrack = (int *)get_config_var("maxsnaptrack", &sz1);
and it seems fine for getting the values (though I need to work out/be told how the bitmask(?) for GRID works, any tips welcome! .

Thanks for any help.


Sorry, it appears I don't know what I'm talking about. <:¬D

But on the PLUS side, it looks like there is a way of playing with things like snap settings. I've got a rudimentary POC plugin on the go which basically does something like this:

Code:
int *projshowgrid = (int *)get_config_var("projshowgrid", &sz);

if (*projshowgrid == 3327)
{

    // snap to nearby is ON: try turning it off

    *projshowgrid = 3199;

}
else if (*projshowgrid == 3199)
{

    // snap to nearby is OFF: try turning it on

    *projshowgrid = 3327;

}
I have no idea if this is safe, and I don't know how the numbers[0] should change depending on the various snap settings. But it seems to work, for now.


[0] That is, the numbers that follow GRID [here] in an RPP. (Is it a "bitmask", or something?)

Last edited by joe2; 12-02-2016 at 10:08 AM. Reason: Chatting rubbish
joe2 is offline   Reply With Quote
Old 01-01-2017, 09:53 PM   #242
FnA
Human being with feelings
 
FnA's Avatar
 
Join Date: Jun 2012
Posts: 2,031
Default

SetLastTouchedTrack

Preference: Mouse click/edit changes track selection causes change on mouse button down so it not only changes track selection on click, it also changes it on drags. With this on single click, maybe I could assign paste to a double click and not have to deal with that. Might be useful for other things too.

Maybe something similar could be in media item and track mouse modifier context?
FnA is offline   Reply With Quote
Old 01-01-2017, 09:57 PM   #243
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,137
Default

I forgot this thread was here. Whoops. Pasting from my FR thread:

I've got a Lua script going that provides a list of chords and lets you preview them. However, the only way to do that currently is pretty messy:

1. The track has to be armed, monitoring, and set to use the VMK as input, so too bad if the user has their own routing set up.

2. You have to screw around with MIDI messages:
Code:
reaper.StuffMIDIMessage(0, 0x90+note_tbl[i].chan-1, note_tbl[i].pitch, note_tbl[i].vel)
3. You have to keep track of times and note releases manually as part of your reaper.defer loop.

So, dear Cockosgobblers (I promise that's a term of endearment. It's also an Office Space reference within an Office Space reference.), it would be awfully swell if you could add a couple of functions to let us simulate mouse-clicks on the keys in the MIDI editor directly:

Code:
reaper.MIDIEditor_NoteDown( hwnd midieditor , int note , int velocity [, int length ])
reaper.MIDIEditor_NoteUp( hwnd midieditor , int note , int velocity )
(The optional Length parameter would automatically release the note after a specified time, just to make it easy on anyone who doesn't need control of it themselves; PPQ, QN, whatever works)

Cheers.
__________________
Currently working away from home; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is offline   Reply With Quote
Old 02-24-2017, 08:30 AM   #244
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,137
Default

Does anyone even look at this thread?

Another request - it'd be nice if we could get the name, as displayed in the action list, for a given command ID/SWS command ID/script ID:
Code:
string reaper.GetCommandName( string command_id )
That is, calling it with "40364" would return "Options: Toggle metronome", etc.
__________________
Currently working away from home; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is offline   Reply With Quote
Old 03-09-2017, 08:55 PM   #245
Claudiohbsantos
Human being with feelings
 
Join Date: Aug 2014
Location: New York
Posts: 132
Default

It would be amazing if the markers had unique ID's that didn't change regardless of position. That would allow scripts to easily know which marker is which even when markers are manually dragged around and multiple markers are edited at once by actions/other scripts. Right now the only way to get close to this kind of feature is to implement a complex chain of checks to try to determine which marker is the odd one out after an edit, and it's not 100% reliable.

This would allow things such as creating marker groups/folders, synchronizing markers with TO-DO list APIs, among others
Claudiohbsantos is offline   Reply With Quote
Old 04-06-2017, 12:35 AM   #246
nikolalkc
Human being with feelings
 
nikolalkc's Avatar
 
Join Date: Feb 2017
Location: Belgrade, Serbia
Posts: 95
Default

Hello everyone, this is my first post ever
I need RENDER TO FILE dialog window to be exposed as a function in Reascript API so I can customize rendering options (mono/stereo, ogg/wav, destination directory etc.) for each individual file I want to export via script. I couldn't find if function like that currently exists, or if anyone already requested it.
nikolalkc is offline   Reply With Quote
Old 04-09-2017, 03:44 PM   #247
woodslanding
Human being with feelings
 
woodslanding's Avatar
 
Join Date: Mar 2007
Location: Denver, CO
Posts: 147
Default

Quote:
Originally Posted by Lokasenna View Post
Does anyone even look at this thread?
Well, they certainly don't let on if they do
__________________
e moon
http://ericmoonmusic.com
__________________________________________

"Evil villians! Stand down from the funk!"
-space ghost
woodslanding is offline   Reply With Quote
Old 04-09-2017, 09:59 PM   #248
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Germany
Posts: 5,192
Default

Quote:
Originally Posted by nikolalkc View Post
Hello everyone, this is my first post ever
I need RENDER TO FILE dialog window to be exposed as a function in Reascript API so I can customize rendering options (mono/stereo, ogg/wav, destination directory etc.) for each individual file I want to export via script. I couldn't find if function like that currently exists, or if anyone already requested it.
I don't know how he does it, but I do know that a friend of mine does exactly this via Beyond Python. So at least fr Python scripts such an API already does exist, but AFAIK, the APIs are similar for all scripting languages.

-Michael
__________________
www.boa-sorte.de
mschnell is online now   Reply With Quote
Old 04-22-2017, 06:16 PM   #249
Argitoth
Human being with feelings
 
Argitoth's Avatar
 
Join Date: Feb 2008
Location: Phoenix, AZ
Posts: 2,054
Default

Programmatic way to enable/disable take envelope (volume/pitch/pan) without having to do item chunk manipulation
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
Argitoth is offline   Reply With Quote
Old 05-26-2017, 04:01 AM   #250
nikolalkc
Human being with feelings
 
nikolalkc's Avatar
 
Join Date: Feb 2017
Location: Belgrade, Serbia
Posts: 95
Default

Quote:
Originally Posted by mschnell View Post
I don't know how he does it, but I do know that a friend of mine does exactly this via Beyond Python. So at least fr Python scripts such an API already does exist, but AFAIK, the APIs are similar for all scripting languages.

-Michael

Can you please give me your friends email or any kind of contact?
Thanks
nikolalkc is offline   Reply With Quote
Old 07-08-2017, 06:48 AM   #251
IXix
Human being with feelings
 
Join Date: Jan 2007
Location: mcr:uk
Posts: 3,322
Default

Quote:
Originally Posted by IXix View Post
Please could we have a version of GetLastTouchedFX() that knows about Take FX? Something like this...

Code:
bool GetLastTouchedFX(int* tracknumberOut, int* itemnumberOut,
      int* takenumberOut, int* fxnumberOut, int* paramnumberOut)
Quote:
Originally Posted by IXix View Post
Please could we have API to move tracks around? Something like this...

Code:
bool MoveTrack(track, newIndex) // return false if track/index is invalid
Pretty please with cocaine on top?
IXix is offline   Reply With Quote
Old 07-10-2017, 04:42 PM   #252
snooks
Human being with feelings
 
Join Date: Sep 2015
Posts: 1,546
Default

You could script the MoveTrack one with InsertTrackAtIndex, then copying the track chunk over and deleting the original. I suppose it would break things that relied on storing track pointers though.
snooks is offline   Reply With Quote
Old 07-30-2017, 01:13 PM   #253
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,191
Default

Code:
bool GetClipboard(#bufOut)
and
Code:
bool SetClipboard(#buf)
Would be extremely useful
amagalma is offline   Reply With Quote
Old 07-30-2017, 02:52 PM   #254
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 1,991
Default

I sent a patch to SWS on GitHub to add these two clipboard APIs a few weeks ago: https://forum.cockos.com/showthread.php?p=1862069 (it hasn't been merged nor refused yet).
cfillion is offline   Reply With Quote
Old 08-13-2017, 01:28 AM   #255
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 4,891
Default

Request :

Being able to get possible scale and chord name from a series of notes, aka having an API for the Scale Finder function, would be very helpful especially with a percentage of trust for each scale;P
X-Raym is offline   Reply With Quote
Old 10-03-2017, 02:20 AM   #256
amagalma
Human being with feelings
 
Join Date: Apr 2011
Posts: 1,191
Default

CountSelectedAutomationItems and GetSelectedAutomationItem, the equivalent actions to the ones regarding Media Items
amagalma is offline   Reply With Quote
Old 10-21-2017, 08:50 AM   #257
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 7,881
Default

Code:
boolean reaper.TrackFX_GetOffline( track, fx )
TrackFX_SetOffline( track, fx, offline )

boolean reaper.TakeFX_GetOffline( take, fx )
reaper.TakeFX_SetOffline( take, fx, offline )
(similar to ...Get/SetEnabled(), for avoiding chunk parsing)

Last edited by nofish; 10-22-2017 at 09:03 AM. Reason: copy/paste error
nofish is offline   Reply With Quote
Old 10-21-2017, 11:38 AM   #258
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 279
Default

Quote:
Originally Posted by MusoBob View Post
GetMediaSourceCues

there is no available function in ReaScript to get File Cue Points infos.
There is just no way we can from ReaScript know what are the cue points positions, in a file what are the names of the cue points etc...
Quote:
Originally Posted by X-Raym View Post
integrer = CountItemCuePoint(item) and time = GetItemCuePointTime(integrer) will be nice.
Currently, we have to use the action "move edit cursor to next cue in items" to try to count how many Cue Points are visible for the selected items.
(it involves unselecting all other items, and a lot of comparison to see if edit cursor has moved or not).
Has anything to do this this been implemented yet ?

I save the wav with BWF btext chunk > Markers and need to be able to read the wav cue point infos then import that section/bars of the wav with the particular Marker, eg: Chords.
So I save the wav that is playing through all different chords with Markers @ the chord changes, I then need to create up a song with a chord progression using sections from the source wav's to fit my progression.
MusoBob is offline   Reply With Quote
Old 10-22-2017, 09:27 AM   #259
mespotine
Human being with feelings
 
Join Date: May 2017
Posts: 299
Default

Quote:
Originally Posted by nikolalkc View Post
Hello everyone, this is my first post ever
I need RENDER TO FILE dialog window to be exposed as a function in Reascript API so I can customize rendering options (mono/stereo, ogg/wav, destination directory etc.) for each individual file I want to export via script. I couldn't find if function like that currently exists, or if anyone already requested it.
I'm currently in the process of working on some helper-functions for Reaper's Lua, that'll include render-functions as well, that don't need the rendering dialog.
It'll take some more time, as I'm still in the middle of bugtesting and don't want to rush things, though and don't have all formats yet...
mespotine is offline   Reply With Quote
Old 10-22-2017, 09:34 AM   #260
mespotine
Human being with feelings
 
Join Date: May 2017
Posts: 299
Default

Didn't know, that this thread existed, so I'll repost my FR here:

When working with GetUserInput, I often stumble over the limitation of the "," used as separator for multiple fields, as this virtually prevents me from inputting a "," into one of the fields, cause I can't separate the values anymore. So, I'd love to suggest the following additions into the pool of API-functions:


>>bool GetUserInputs2("title", int num_inputs, "captions_csv", #retvals_csv[, string separator])
like GetUserInputs, but uses the parameter seperator for seperating the individual fields, instead of the standard "," so parsing the returned value-string would be easier.

Parameter:
- separator - indicates, what seperates the captions/retvals in the csv. Default is a ,


>>array GetUserInputs3("title", int num_inputs, "captions_csv"[, string seperator])
like GetUserInputs3, but returns the input-values as an array and not as a csv-string.

Parameter:
- seperator - indicates, what seperates the entries in the captions_csv. Default is a ,



I also would love to see some more ways of customizing the reaper.MB-function, by giving it's buttons individual labels, as well as having more buttons to use.
Also a checkbox for use-cases like "Do you want this Messagebox to reappear?" would be great:

>>integer choice, integer checkbox = reaper.MB2(string msg, string title, integer numberofbuttons, string "text for button 1", string "text for button 2", string "text for button 3", ... , string "text for button n"[, integer preselection][, string checkbox-title])
Customizable MessageBox, where the buttons can have their own texts.

Parameters:
- number of buttons - how many buttons shall this messagebox have, so Reaper can determine, how many of the parameters are for the button-texts.
- "text for button n" - the text for the buttons.
preselection - which button shall be automatically preselected, when working with keyboard
- checkbox-title - an optional checkbox, that is included between the msg and the buttons. Can be used for "don't ask again"-choices.
mespotine is offline   Reply With Quote
Old 10-22-2017, 09:37 AM   #261
mespotine
Human being with feelings
 
Join Date: May 2017
Posts: 299
Default

And this small one, but an important one, a filerequester, just like GetUserFileNameForRead, but for saving a file:

boolean retval, string filenameNeed4096 reaper.GetUserFileNameForWrite(string filenameNeed4096, string title, string defext)

The problem with GetUserFilenameForRead is, you can't select a file, that doesn't exist. This could be prevented with GetUserFileNameForWrite.
mespotine is offline   Reply With Quote
Old 11-20-2017, 11:43 AM   #262
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 1,961
Default

1) There is no way to set name for AI (pool instances are in project chunk),
2) any of existing API can not be used for direct accessing Pooled AI (by pool ID), only if they are placed somewhere,
3) there is no way to remove pooled AI.
__________________
SoundCloud | MPL Scripts discussion | ReaPack | Donate
mpl is offline   Reply With Quote
Old 01-27-2018, 12:34 AM   #263
MusoBob
Human being with feelings
 
Join Date: Sep 2014
Posts: 279
Default MIDI_SetScale

How do I go about setting the root & scale, I can get it MIDI_GetScale but not set it MIDI_SetScale
MusoBob is offline   Reply With Quote
Old 02-13-2018, 04:15 AM   #264
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 4,891
Default

Hi,

There is
Code:
reaper.Main_SaveProject( proj, forceSaveAsInOptional )
but it doesn't allow to
  • Save as but without popup (with a destination path)
  • Save as project template (which has the big advantage to NOT open the new project)
  • To get the path chosen by the user it is was a popup..
It would be nice to have these options available. thanks !
X-Raym is offline   Reply With Quote
Old 03-02-2018, 10:54 AM   #265
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,402
Default

Here's my request: SetTCPScroll
Code:
MediaTrack reaper.SetTCPScroll(MediaTrack topmosttrack)
spk77 is offline   Reply With Quote
Old 03-02-2018, 01:40 PM   #266
daxliniere
Human being with feelings
 
daxliniere's Avatar
 
Join Date: Nov 2008
Location: London, UK
Posts: 1,707
Default

Quote:
Originally Posted by spk77 View Post
Here's my request: SetTCPScroll
Code:
MediaTrack reaper.SetTCPScroll(MediaTrack topmosttrack)
If this is scroll visible window to X track, then HELL YES, that would be awesome!
And for MCP, too, please.

(There are supposedly 2 solutions for MCP already, but none seem to work.)
__________________
Dax Liniere
London's newest premium studio complex! (Facebook)
[i7-4790K, 12Gb RAM, Win8.1x64, NVidia 9600, UAD2-OCTO, FireFaceUFX, REAPER x64]
daxliniere is offline   Reply With Quote
Old 03-02-2018, 04:02 PM   #267
doppelganger
Human being with feelings
 
Join Date: Feb 2017
Posts: 221
Default

oh, that's where you leave your function requests,
i'll leave my "wannathat" here too, if you don't mind)

1. I_MCP_WIDTHOVERRIDE for GetMediaTrackInfo_Value/SetMediaTrackInfo_Value
(-for making more flexible tracks in mixer, track can be extended/shrinked horizontally showing full track name and more controls or fxlist/parmlist/sendlist.
-Also this can be used to make children of folder track to collapse to thin lines, like in TCP, but horizontally)

2. Don't know, if it's possible or maybe it's too much. At current state selected fx can be only 1 at the time, and selected fx = current single fx.
What i propose is that, current fx = single current fx, but selected fx = one or multiple selected fx, which you select in fx chain window,
you can select multiple fx with shift+mouseclick or ctrl+mouseclick.
Then this functions could be usefulfor manipulations with multiple selected fx:
1. int TrackFX_GetCountSelected(MediaTrack* track )
2. bool TrackFX_GetSelected(MediaTrack track, int sel_fx_idx)
3. TrackFX_SetSelected(MediaTrack track, int sel_fx_idx, bool selected)

Last edited by doppelganger; 03-05-2018 at 06:06 AM.
doppelganger is offline   Reply With Quote
Old 03-02-2018, 05:57 PM   #268
fundorin
Banned
 
Join Date: Feb 2014
Location: Moscow, Russia
Posts: 554
Default

Quote:
Originally Posted by spk77 View Post
Here's my request: SetTCPScroll
Code:
MediaTrack reaper.SetTCPScroll(MediaTrack topmosttrack)
Also btmmosttrack for TCP and rightmosttrack for MCP.
Having those I could've successfully scroll to the control surface's banks of tracks.
fundorin is offline   Reply With Quote
Old 03-07-2018, 11:00 AM   #269
Chain
Human being with feelings
 
Join Date: May 2017
Location: Italy
Posts: 19
Default OSC automap

i have a wish
is it possible to write a script that enables to automap OSC values?
for example (using touchosc)
i am using an eq from GRM tools...
it has 31 bands for each channel....
on my osc interface i have 31 sliders....
they send the values /2/multifader3/1 for example....
the value of the fader is the last one /2/multifader3/(X)...
is there a way to select multiple faders or to enable a automap function where i put
the OSC message /2/multifader3/ and then the values from 1 to 31 an assign them to the corresponding bands on the eq?
that would be interesting to map those values fast and not only for this tool...
it would enable maybe also for live performances and live mixing?
it would be a present of the heaven.... because not only that the vst is in stereo (that means 31*2 faders)

in case if there is already something like that i hope you can tell me where to find it... i was tryng to find it but in the actions list i couldnt find something like that...
__________________
Instrested in everything!! Hit me up!!
Chain is offline   Reply With Quote
Old 03-07-2018, 11:13 AM   #270
Claudiohbsantos
Human being with feelings
 
Join Date: Aug 2014
Location: New York
Posts: 132
Default

I have two requests that I have wished for in a couple scripts now:

1.
reaper.getActionList() - An action to retrieve the entire action list (native+customs+scripts) with their names and command id's. It would be awesome if it returned a table but that's just me being lazy, we can parse it ourselves hhahaha

2.
Modify reaper.TrackCtl_SetToolTip(string fmt, integer xpos, integer ypos, boolean topmost) so we can display more than a single tooltip simultaneously.
Claudiohbsantos is offline   Reply With Quote
Old 03-07-2018, 04:41 PM   #271
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 1,991
Default

Quote:
Originally Posted by Claudiohbsantos View Post
reaper.getActionList() - An action to retrieve the entire action list (native+customs+scripts) with their names and command id's. It would be awesome if it returned a table but that's just me being lazy, we can parse it ourselves hhahaha
There are kbd_enumerateActions and related API functions but they are only available to extensions.

Last edited by cfillion; 03-07-2018 at 04:51 PM.
cfillion is offline   Reply With Quote
Old 03-07-2018, 07:57 PM   #272
Claudiohbsantos
Human being with feelings
 
Join Date: Aug 2014
Location: New York
Posts: 132
Default

Quote:
Originally Posted by cfillion View Post
There are kbd_enumerateActions and related API functions but they are only available to extensions.
Really? Oh... I've been postponing learning how to work with the extensions for a long while, maybe I'll have to just bite the bullet and finally jump on it.

I have one question about the extensions in general: is it relatively easy for me to create an extension to expose these functions for the scripting API? I see SWS creates quite a few script API functions.
Claudiohbsantos is offline   Reply With Quote
Old 03-07-2018, 08:11 PM   #273
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 1,991
Default

Yes it's relatively easy (but there is not much documentation). I think it would be a good idea to expose these functions in SWS (I'm interested in kbd_getTextFromCmd, I'll look into doing that later).

Minimal example for adding a custom API function and exposing it to ReaScript:
Code:
static const char *definition = "double\0char*,int\0str,flag\0help text for myfunction";

static double cImpl(char *str, int flag)
{
  return 0;
}

static void *reascriptImpl(void **argv, int argc)
{
  // argument count check is already done by reaper
  return (void *)(intptr_t)cImpl((char *)argv[0], (int)(intptr_t)argv[1]);
}

void registerAPI()
{
  // call when initializing the extension
  plugin_register("API_functionName", (void *)&cImpl);
  plugin_register("APIvararg_functionName", (void *)&reascriptImpl);
  plugin_register("APIdef_functionName", (void *)definition);
}

void removeAPI()
{
  // call when unloading the extension
  plugin_register("-API_functionName", (void *)&cImpl);
  plugin_register("-APIvararg_functionName", (void *)&reascriptImpl);
  plugin_register("-APIdef_functionName", (void *)definition);
}
(This gets repetitive when adding many functions so I made helper functions and macros to clean this up and have the compiler generate the ugly reascript implementations automatically: https://github.com/cfillion/reapack/...api_helper.hpp. SWS uses a PHP script to generate them.)

Last edited by cfillion; 03-07-2018 at 08:37 PM.
cfillion is offline   Reply With Quote
Old 03-19-2018, 11:33 AM   #274
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 4,891
Default

Hi,

It ha sbeen several time someone ask me for being able to script something based arround what regions are selected in the Markers and Regions window.

It would be nice to be able to see that !

A simple function like boolean = IsRegionSelectedInMarkerManager( idx ) would works perfectly.

Thanks for listening !
X-Raym is offline   Reply With Quote
Old 03-20-2018, 12:55 PM   #275
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,402
Default

Two functions that would be nice to have:
  1. reaper.atprojectexit(ReaProject proj, function)
    • Similar to reaper.atexit(function), but "function" would be run when the project is closing
  2. reaper.SetProjExtState(string projectfilename, string extname, string key, string value)
    • SetProjExtState for offline project files
spk77 is offline   Reply With Quote
Old 03-30-2018, 09:06 AM   #276
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,402
Default

Sysex support for reaper.StuffMIDIMessage...and some way to receive sysex data.

I would like to store Kemper Profiling Amp rigs (sysex data) to tracks by using reaper.SetProjExtState.
(and later, when needed, send the data back to Kemper)


Ctrlr can send/receive sysex messages
Github: https://github.com/RomanKubiak/ctrlr...c7/Source/Core

Ctrlr example - this code reads a "kipr" -file (Kemper rig) and sends it to MIDI out -> to Kemper MIDI in
Code:
readFileAsData = function(mod, value)
	if panel:getBootstrapState() then
		return
	end

	fileToRead = utils.openFileWindow(
		"Open file to read as data",
		File.getSpecialLocation(File.userHomeDirectory),
		"*.kipr",
		true
	)

	if fileToRead:existsAsFile() then

		-- Update the file path
		panel:getLabelComponent("lastFileReadPathL"):setText ("> "..fileToRead:getFullPathName())

		if fileToRead:getSize() > 8192 then
				utils.warnWindow(
					"File too big", 
					"Labels are not designed to show too much data, please choose a file that's smaller then 8kb.\
The file you chose is "..fileToRead:getSize().." bytes"
				)
			return
		end

		-- We need a memory block to load our file into, this can be created at some other point in time
		-- if we expect the files to be big and the amount of memory we need is higher, it will pre-allocate
		-- that memory at the moment that MemoryBlock() is called
		-- here we will allocate the amount of memory that is equalt to the size of the file

		fileData = MemoryBlock(fileToRead:getSize())

		-- This method does not return a new memory block, it operates on the one provided by us

		fileToRead:loadFileAsData (fileData)

		--panel:getLabelComponent("dataContentL"):setText(
			--fileData:toHexString(1)
	--	)
		size = fileToRead:getSize()-0x17
		-- skip header part
		datablock = MemoryBlock(fileToRead:getSize()-0x17)
		datablock = fileData:getRange(0x17,size)
		sysexdata= MemoryBlock()

	
		for i=0,size,1 do
		
			if (datablock:getByte(i)== 240) then
				--console(datablock:getByte(i):toHexString(1))
				sysexdata:append(datablock:getRange(i,1))

				local m= datablock:getByte(i+1)
				sysexdata:append(datablock:getRange(i+2,m))
				console(sysexdata:toHexString(1))
				local midimessage = CtrlrMidiMessage(sysexdata:toHexString(1))
	    		--panel:sendMidiMessageNow(midimessage)
				sysexdata= MemoryBlock()
			end
		end
	end
end
spk77 is offline   Reply With Quote
Old 05-23-2018, 04:06 PM   #277
Nixon
Human being with feelings
 
Nixon's Avatar
 
Join Date: Dec 2011
Posts: 268
Default

Did anyone get ctrl + or alt + keystrokes working in lua? If not I'd like to request that.
__________________
Item FX Sends -
Nixon is offline   Reply With Quote
Old 05-24-2018, 09:45 AM   #278
mespotine
Human being with feelings
 
Join Date: May 2017
Posts: 299
Default

Quote:
Originally Posted by Nixon View Post
Did anyone get ctrl + or alt + keystrokes working in lua? If not I'd like to request that.
Do you mean with gfx-windows?
mespotine is offline   Reply With Quote
Old 05-24-2018, 10:19 AM   #279
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: The vast, frozen wasteland of western Canadia.
Posts: 5,137
Default

Quote:
Originally Posted by Nixon View Post
Did anyone get ctrl + or alt + keystrokes working in lua? If not I'd like to request that.
There are a few specific key combinations that won't work, and some foreign keys that aren't read properly, but other than that they've always worked just fine.

Code:
-- Ctrl + Z
if gfx.mouse_cap & 4 == 4 and gfx.getchar(27) > 0 then
__________________
Currently working away from home; don't expect timely responses from me.
Default 5.0 Nitpicky Edition / GUI tutorial for Lua / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate / ReaPack
Lokasenna is offline   Reply With Quote
Old 05-26-2018, 08:33 AM   #280
deeb
Human being with feelings
 
deeb's Avatar
 
Join Date: Feb 2017
Posts: 1,588
Default

i would like to be able to apply in script the same time stretch on an audio item already in project as applied by media browser when "match tempo" is ON. Not sure if this should be an APi wish or an action.
deeb is online now   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:11 AM.


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