PDA

View Full Version : ReaScript Regions ?


Anton9
11-03-2009, 02:08 PM
Hey guys..,

Is there any way to select a named region using ReaScript ?
Is there any way of popping up the midi learn dialog box for last tweaked fx parameter through ReaScript ?
If not.., Schwa, Justin.., could we please get these ?
Anyone have some script examples of the new MIDI api functions ?
I really hope that the MIDI side of the api will continue to grow.., Id love to be able to select and manipulate notes and their properties through ReaScript :)

Thanks,
Anton

MikeLacey
11-03-2009, 02:31 PM
Hi,

Here's a script using the new MIDIEditor functions. It works but it's not what you'd call polished.


#
# LoadNoteNames.pl
# ver 0.2

use strict;
use warnings;

use constant OPEN_MIDI_ITEM => 40109;
use constant LOAD_NOTE_NAMES => 40409;
use constant DRUM_DIAMONDS_VIEW => 40450;
use constant HIDE_UNUSED_UNNAMED_ROWS => 40454;
use constant FILE_CLOSE_WINDOW => 2;
use constant MSGBOX_YESNO => 4;
use constant MSGBOX_YES => 6;
use constant MSGBOX_NO => 7;

my $ret_val;

RPR_Main_OnCommand(OPEN_MIDI_ITEM,0);

my $med = RPR_MIDIEditor_GetActive();

$ret_val = RPR_MIDIEditor_OnCommand($med, LOAD_NOTE_NAMES);

$ret_val = RPR_ShowMessageBox("Did The Load Succeed?","Load Notes Names", MSGBOX_YESNO);

if($ret_val == MSGBOX_YES){
$ret_val = RPR_MIDIEditor_OnCommand($med, DRUM_DIAMONDS_VIEW);
$ret_val = RPR_MIDIEditor_OnCommand($med, HIDE_UNUSED_UNNAMED_ROWS);
} else {
$ret_val = RPR_MIDIEditor_OnCommand($med, FILE_CLOSE_WINDOW);
}

exit 0;


The functions are documented in the Wiki.

I don't know of a way to do the selection and MIDI dialogue tasks - someone else might. Meanwhile have a look at the MIDIEditor_OnCommand() function, if you can do it with a MIDI Editor menu option or action, you can do it with that.

Anton9
11-04-2009, 11:38 AM
Mike,

Thank you for the example and thank you for all the work your doing in the Wiki :)

Anton

MikeLacey
11-04-2009, 12:01 PM
My pleasure Anton.