|
|
|
11-23-2009, 06:53 AM
|
#1
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
is it possible to load specific Chain preset to items/tracks with a script?
is it possible to create an action scripts that will load specific chain presets?
like:
Custom action: Add chain fx:grain_01 to selected item.
Custom action: Add chain fx:grain_01 to selected track.
this could help me with some cool macros for random effects.
ps: can someone please make a video tutorial how to write such a script?
|
|
|
11-24-2009, 04:32 AM
|
#2
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
I need a script that can be easily duplicated and change the path of the chain fx preset to create actions for specific chain fx.
can someone please make such a thing ?
|
|
|
11-24-2009, 05:25 AM
|
#3
|
Human being with feelings
Join Date: Aug 2008
Posts: 1,144
|
I think we need a special Forum for ReaScript things.
(though I don't use it at all).
|
|
|
11-24-2009, 01:14 PM
|
#4
|
Human being with feelings
Join Date: Feb 2009
Location: Dunedin, New Zealand
Posts: 205
|
Quote:
Originally Posted by whatsup
I think we need a special Forum for ReaScript things.
|
That would be a shame from my point of view since I've received ReaScript help from some experienced (and generous) C++ programmers here.
If people prefix their posts with "ReaScript: " then they're easy to skip and ignore.
I'm new around these parts but I would've have thought that "writing a script, need help" type posts would be acceptable while something more like "want a script that does this, someone please write it, KTHX!" is probably pushing the limit.
|
|
|
11-24-2009, 01:17 PM
|
#5
|
Human being with feelings
Join Date: Feb 2009
Location: Dunedin, New Zealand
Posts: 205
|
Quote:
Originally Posted by Reflected
can someone please make a video tutorial how to write such a script?
|
You don't need a video. If you want to start writing your own scripts, you need to start learning Perl or Python. Plenty of free tutorials out there in Google land. Everything you need is sitting there waiting for you to discover it. Won't cost you a cent, just a personal investment of time.
|
|
|
11-24-2009, 07:38 PM
|
#6
|
Human being with feelings
Join Date: Jul 2009
Location: Sherbrooke, Qc, Canada
Posts: 101
|
I don't want videos, but I sure do want proper documentation for the different programming interfaces available to REAPER.
|
|
|
11-25-2009, 02:31 AM
|
#7
|
Human being with feelings
Join Date: Dec 2006
Location: UK
Posts: 789
|
Quote:
I sure do want proper documentation
|
Yep - that's the plan. The Wiki is coming along, a few more example scripts are there (need some Python scripts please...), and more people are using ReaScript. The more all this happens the better ReaScript will get as things get ironed out and features added.
Get stuck in Luc. Have a look at some of the example scripts in the Wiki and have fun modifying them. I think that ReaScript is the best thing that's happened to REAPER and, given the dev team's can-do attitude, will make it the most powerful DAW on the market.
__________________
Mike Lacey, Leicestershire, UK
|
|
|
11-25-2009, 05:07 AM
|
#8
|
Human being with feelings
Join Date: Jul 2009
Location: Sherbrooke, Qc, Canada
Posts: 101
|
Hi Mike,
Thanks for taking care of the wiki BTW.
What I'd really like to see is a "big picture" kind of document that would explain the major "extension points" of REAPER.
While I can look at code all day long, I'd have a much better time if I understood the high level before getting into the low level details.
I'm not only talking ReaScript, but also C++ API. I've looked at the sample code, but without a higher level comprehension of the API...
I'm used to programming BTW, though my expertise is more in Business Applications/Automation, so it's not lack of understanding the code per say. I just don't enjoy the "shot in the dark" approach all that much.
I hope it makes sense :-)
|
|
|
11-25-2009, 05:49 AM
|
#9
|
Human being with feelings
Join Date: Dec 2006
Location: UK
Posts: 789
|
My background isn't a million miles away from yours, so I know where you're coming from with wanting a Big Picture document. That feeling is at least part of why I've started to help look after the ReaScript API bits of the Wiki.
If I were reading such a document, called "So, You Want to Extend REAPER?" maybe, I'd be looking for introduction sections on the kinds of tasks each language can usefully be used for and the skills you need to use them - complete with some discussion on the strengths and weaknesses of each. I would also be looking for pointers to more detailed documentation.
Is this what you mean?
__________________
Mike Lacey, Leicestershire, UK
Last edited by MikeLacey; 11-26-2009 at 01:19 AM.
|
|
|
11-25-2009, 04:26 PM
|
#10
|
Human being with feelings
Join Date: Jul 2009
Location: Sherbrooke, Qc, Canada
Posts: 101
|
Mike, you got it spot on.
Right now, I don't even know what can be extended with API or ReaScript.
Of course, I could deduce it from looking at a bunch of code, but between my day job, family, learning to play guitar/keyboard and learning to use REAPER, I don't really feel like investing a lot of time going blindly about learning the REAPER API.
My best regards to you.
|
|
|
11-26-2009, 01:18 AM
|
#11
|
Mortal
Join Date: Dec 2008
Location: France
Posts: 1,969
|
Luc, I see what you mean, I even perhaps also complained about that.. But I can tell you things are really improving (more & more comments in the headers, dev subforum waken-up by reaScript, more users and btw more support, etc..). The thing I can advice is just to go ahead, just try! Sure: you'll crash your Reaper a lot but you'll also find people to help you and your questions will help other interestred people!
I you indeed know C++, have a look here: http://www.cockos.com/reaper/sdk/plu...in_functions.h and you'll guess what is doable.
About thye OP: yes, it's do-able (though "preset" isn't really the good wording)
|
|
|
11-26-2009, 01:23 AM
|
#12
|
Human being with feelings
Join Date: Dec 2006
Location: UK
Posts: 789
|
It fits in with the long term project I have in mind; I've started to put some notes together covering much of that. I'll get version 1 finished, PDFed and posted.
__________________
Mike Lacey, Leicestershire, UK
Last edited by MikeLacey; 11-27-2009 at 02:00 AM.
Reason: to protect the guilty
|
|
|
11-26-2009, 02:06 AM
|
#13
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
Quote:
Originally Posted by Jeffos
About thye OP: yes, it's do-able (though "preset" isn't really the good wording)
|
can you post such a script please?
|
|
|
11-27-2009, 09:17 AM
|
#14
|
Human being with feelings
Join Date: Dec 2006
Location: UK
Posts: 789
|
Here's something that comes close...
This uses the ClipBoard to Copy an FX Chain from an Item
If you've already done that it Pastes any FX Chain in the ClipBoard into the currently selected Item(s)
So, you run it twice... - Select the Item containing the FX Chain you want to copy to other items
- Run the script
- Select the Item(s) you want to copy the FX Chain to
- Run the script
Mike
PHP Code:
#
# CopyAndPasteItemFXChain.pl
#
# int CountSelectedMediaItems(ReaProject* proj)
# bool GetSetItemState(MediaItem* item, char* str, int maxlen)
# MediaItem* GetSelectedMediaItem(ReaProject* proj, int selitem)
use strict;
use warnings;
use Win32::Clipboard;
my $Clipboard = Win32::Clipboard();
use constant CURR_PROJ => 0;
use constant FIRST_SEL => 0;
use constant MAXLEN => (16 * 1024);
use constant ACTION_NAME => "Copy And Paste Item FX Chain";
use constant MSGBOX_OKONLY => 0;
use constant MSGBOX_YESNO => 4;
use constant MSGBOX_YES => 6;
use constant MSGBOX_NO => 7;
use constant COPY => 0;
use constant PASTE => 1;
my $it;
my $chunk;
my $result;
my $maxlen;
my $indent;
my $item;
my ($before, $after, $section, $takefx);
my $run_mode;
my $report = " " . localtime() . "\n";
my $num_selected_items;
# prototype(s)
sub extract_section($$$);
sub FXChainInClipBoard();
$report .= "initialised\n";
# get number of selected items
my $prompt_str='';
my $action;
my $nothing;
$num_selected_items = RPR_CountSelectedMediaItems(CURR_PROJ);
if($num_selected_items == 0){
$prompt_str =
"No Items Selected.\n\nThis script needs to be run twice." .
" The first run, with one Item selected, copies the Item FX Chain" .
" (if any) into the Windows Clipboard.\n\n" .
"A second run, with one or more Items selected, and a valid" .
" FX Chain from a previous run of this script in the Windows Clipboard," .
" will Paste that FX Chain into the selected Items.\n\n" .
"No action will be taken now; press OK to return to REAPER\n";
RPR_MB($prompt_str, ACTION_NAME, MSGBOX_OKONLY);
exit(0);
}elsif($num_selected_items >= 1){
if(FXChainInClipBoard()){
$prompt_str =
"One or more Items Selected and (what looks like...) an FX Chain" .
" in the Windows Clipboard.\n\n" .
"This will Paste the FX Chain into the selected Item or Items\n\n" .
"Do you want to continue?";
($action, $nothing, $nothing, $nothing) = RPR_MB($prompt_str, ACTION_NAME, MSGBOX_YESNO);
$run_mode = PASTE if $action == MSGBOX_YES;
} else {
$prompt_str =
"One or more Items Selected and no FX Chain in the Windows" .
" Clipboard.\n\n" .
"This will Copy the FX Chain of the selected Item into the" .
" Windows Clipboard.\n\n" .
"Do you want to continue?";
($action, $nothing, $nothing, $nothing) = RPR_MB($prompt_str, ACTION_NAME, MSGBOX_YESNO);
$run_mode = COPY if $action == MSGBOX_YES;
}
}
if($run_mode == COPY){
# Get the FX chain from the selected item
$it = RPR_GetSelectedMediaItem(CURR_PROJ, FIRST_SEL);
$chunk = ""; # because I want to read the state of the first item
($result, $it, $chunk, $maxlen) = RPR_GetSetItemState($it, $chunk, MAXLEN);
# pick out first TAXFEX section
($before, $takefx, $after) = extract_section($chunk, '<TAKEFX', 0);
# remove the FXID lines
$takefx =~ s/^FXID.+\n//mg;
if($takefx){
$takefx = "REAPER-FXCHAIN-DATA\n" . $takefx;
$Clipboard -> Set($takefx);
} else {
RPR_MB("No FX Chain in First Selected Item", ACTION_NAME, MSGBOX_OKONLY);
}
} elsif($run_mode == PASTE){
# Items Loop
# copy that TAKEFX section into every selected item, replacing any
# existing TAKEFX section in that item
my $NewItemStr='';
$takefx = $Clipboard -> Get();
$takefx =~ s/^REAPER-FXCHAIN-DATA\n//;
for $item ( 0 .. $num_selected_items - 1){
$chunk="";
$it = RPR_GetSelectedMediaItem(CURR_PROJ, $item);
($result, $it, $chunk, $maxlen) = RPR_GetSetItemState($it, $chunk, MAXLEN);
($before, $section, $after) = extract_section($chunk, '<TAKEFX', 0) if $result;
unless($section){
$NewItemStr = substr $before, 0, -2;
$NewItemStr .= "\n" . $takefx . ">\n";
} else {
$NewItemStr = $before . $takefx . $after
}
$Clipboard -> Set($NewItemStr);
($result, $it, $chunk, $maxlen) = RPR_GetSetItemState($it, $NewItemStr, MAXLEN);
}
}
exit(0);
# subroutines below here
sub extract_section($$$){ my($chunk, $name, $index) = @_;
my @chunk; # to hold $chunk split into lines
my $cline; # individual lines from @chunk
my $indent; # to keep track in a multiline section
my ($before, $section, $after); # return values
my $inner_state = 0; # 0=before section, 1=in section, 2=after
my $multiline = 0; # boolean, single line sections have no <
my $occurrence = 0;
$multiline = 1 if $name =~ /^</; # a multiline section?
$before = $section = $after = ''; # just in case
@chunk = split(/\n/,$chunk); # populate @chunk
foreach $cline (@chunk){ # and loop through it
if($inner_state == 0){ # "before" section
if($cline =~ /^\s*$name(\s|$)/){
# correct section name - correct occurrence?
if($occurrence == $index){ # Yes
$indent++; # keep track of indents
$inner_state = 1; # might be multiline...
$section .= "$cline\n"; # build up return variable
$inner_state = 2 # done unless
unless $multiline; # it's a multiline section
} else { # No, wrong occurrence
$occurrence++; # keep looking
last # unless already gone past it
if $occurrence > $index;
}
} else {
# still before the section we're looking for
$before .= "$cline\n"; # so build up return variable
}
} elsif($inner_state == 1){ # in a multiline section
$section .= "$cline\n"; # so build up return variable
$indent++ if $cline =~ /</; # keep track of indents
$indent-- if $cline =~ />/; # keep track of indents
$inner_state = 2 if $indent == 0; # and get out if we're done
} elsif($inner_state == 2){ # "after" section
$after .= "$cline\n"; # so build up return variable
}
}
return($before, $section, $after);
}
sub FXChainInClipBoard(){
use constant TRUE => 1;
use constant FALSE => 0;
my $CB;
$CB = $Clipboard -> Get();
if($CB =~ /^REAPER-FXCHAIN-DATA\n/){
return(TRUE);
} else {
return(FALSE);
}
}
__________________
Mike Lacey, Leicestershire, UK
|
|
|
11-30-2009, 08:46 AM
|
#15
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
I want load specific chains quickly into items, not to copy a chain from 1 to another.
but this is a good start I guess.
|
|
|
11-30-2009, 08:50 AM
|
#16
|
Human being with feelings
Join Date: Dec 2006
Location: UK
Posts: 789
|
Ok...
How do you want to tell the script which chain you want to load? I can't give you a file dialogue window at the moment.
__________________
Mike Lacey, Leicestershire, UK
|
|
|
11-30-2009, 10:20 AM
|
#17
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
I donno
Jeffos knows :P
|
|
|
11-30-2009, 10:23 AM
|
#18
|
Human being with feelings
Join Date: Dec 2006
Location: UK
Posts: 789
|
LOL -- Ok
__________________
Mike Lacey, Leicestershire, UK
|
|
|
11-30-2009, 01:14 PM
|
#19
|
Mortal
Join Date: Dec 2008
Location: France
Posts: 1,969
|
Quote:
Originally Posted by Reflected
Jeffos knows :P
|
... in C/C++.
Reflected, I see you coming. No biggie but, in -my- humble opinion, you should cool down a bit about dev requests, request PMs, FRs and stuff. Look! in this thread you even forgot to thank Mike for that script..
er.. Mike!?
[edit]just like the hand of thierry henry: never existed[/edit]
Last edited by Jeffos; 11-30-2009 at 04:07 PM.
|
|
|
11-30-2009, 01:46 PM
|
#20
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
Quote:
Originally Posted by Jeffos
... in C/C++.
Reflected, I see you coming. No biggie but, in -my- humble opinion, you should cool down a bit about dev requests, request PMs, FRs and stuff. Look! in this thread you even forgot to thank Mike for that script..
er.. Mike!?
It seems I'm going crazy, just to be sure: I could swear I heard a guy talking about a book here.. as you were here too: am I dreaming, am I drunk or something ?
|
Man...
of course that I thank mike, I just wait for some results and then I will thank everyone who helped or tried to help, I don't want to embarrass him in every single post.
actually Mike is one of those people I won't forget soon (if ever), he is so nice and helpful, that I want to give him a huge
|
|
|
11-30-2009, 02:01 PM
|
#21
|
Human being with feelings
Join Date: Dec 2006
Location: UK
Posts: 789
|
@ Reflected - you're welcome.
@ Jeffos - eh?
__________________
Mike Lacey, Leicestershire, UK
|
|
|
11-30-2009, 02:47 PM
|
#22
|
Mortal
Join Date: Dec 2008
Location: France
Posts: 1,969
|
@Reflected: no prob! it's just that sometimes you reminds me some of my day job "ever unsatisfied customers" (but in that case, I usually talk about OBRs: On Bu$ine$$ Requet$ )
@Mike: memset(jeffos, 0, book_stuff + hand_of_Thierry_Henry)
|
|
|
12-05-2009, 03:10 PM
|
#23
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
please give it a try >.<
|
|
|
12-07-2009, 07:33 AM
|
#24
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
Yodel He Hoo!
|
|
|
12-12-2009, 05:21 PM
|
#25
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
Bump
*help*
*shame*
*hiding*
|
|
|
12-16-2009, 02:45 AM
|
#26
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
ok I give up
you hate me
|
|
|
12-16-2009, 02:53 AM
|
#27
|
Mortal
Join Date: Dec 2008
Location: France
Posts: 1,969
|
no reflected, i don't hate you! i've got a very close code (vst extension loading/enabling/disabling some stuff on pg changes) i do things i need and share those which are not too specific, be patient..
each new bump to this thread = 2 month delay.
|
|
|
12-16-2009, 06:45 PM
|
#28
|
Human being with feelings
Join Date: Jul 2007
Posts: 619
|
Quote:
Originally Posted by Jeffos
each new bump to this thread = 2 month delay.
|
.......LOL!!!
thats gotta be the best possible response to this thread at this point.
|
|
|
12-16-2009, 08:05 PM
|
#29
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
you are so lovely
|
|
|
12-29-2009, 06:36 AM
|
#30
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
.....
Last edited by Reflected; 01-23-2010 at 05:12 AM.
|
|
|
01-23-2010, 05:12 AM
|
#31
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
ufff
|
|
|
02-23-2010, 08:33 AM
|
#32
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
Jeffy ?
|
|
|
02-23-2010, 08:57 AM
|
#33
|
-blänk-
Join Date: Jun 2008
Posts: 11,359
|
Boom, now we'll have to wait 'til april at least
|
|
|
02-23-2010, 09:26 AM
|
#34
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
this is so unfair...I came back from work (Garage) very tired...please be gentle. :/
|
|
|
02-23-2010, 10:29 AM
|
#35
|
-blänk-
Join Date: Jun 2008
Posts: 11,359
|
Sorry pal, was just kidding. It was so inviting, I didn't mean harm.
|
|
|
02-24-2010, 11:02 AM
|
#36
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
jeff, mike, someone?
c'mon mates it shouldn't be hard to make a small tutorial or a script for this, it will be extremely useful for me and probably for many others:
example of usage, a shortcut to load spectrum analyzers, common filters, common delays and other utilities.
I spend tons of time (because my English) to help improving reaper:
maybe you also enjoy some of my suggestions...
Implemented FR list.
I'm not that mean and arrogant as it looks like from my english..., please reconsider to help >.<
|
|
|
02-24-2010, 02:30 PM
|
#37
|
Human being with feelings
Join Date: Jul 2009
Posts: 3,295
|
look, I'm sorry if I hurt you in any way...I really don't understand how come you are not jumping on the opportunity to make something good and help someone who ask for your help.
good night human being.
I love you
Last edited by Reflected; 02-24-2010 at 02:37 PM.
|
|
|
02-25-2010, 03:13 AM
|
#38
|
Human being with feelings
Join Date: Feb 2009
Location: Dunedin, New Zealand
Posts: 205
|
Quote:
Originally Posted by Reflected
good night human being.
I love you
|
Oh dear.
I've been moving house this week (after a one bedroom apartment, it's great to have a proper music room again...) and this is what I come back to once the power at the new place is switched on?!
C'mon Reflected. Toughen up! This is a developer forum not a request line! If you get scripting then run into trouble, people will likely be more than willing to help you out. If you keep bumping this thread and feeling bad 'cause nobody has made this action for you, are you really surprised at Jeff's response? A bit of initiative would go a long way!
You could have picked up some basic Perl and had things moving along yourself by now... I learnt basic Perl about 4 years ago because I wanted to do some text manipulation of Cakewalk sfz files. I swear that it took me one week of an hour or so a day to go from knowing nothing to having the exact script I was hoping for. There is so much documentation and help out there that you're never stuck for very long. It's not like the old days pre-Internet when the only way I could learn machine code on the C-64 was by borrowing dusty old books from people in the know.
I want to make the jump to C++. Perhaps we could both set some goals e.g. start on the 1st of March and check in our progress early in April?
I dunno, on the other hand, maybe Jeff's offer is a good one!
|
|
|
02-25-2010, 04:58 AM
|
#39
|
Mortal
Join Date: Dec 2008
Location: France
Posts: 1,969
|
Quote:
Originally Posted by Reflected
I really don't understand how come you are not jumping on the opportunity to make something good and help someone who ask for your help.
good night human being.
I love you
|
Man!!! I just don't have time for that!! I've got a MASSIVE musical deadline soon!! I doesn't work like that, see what I said above. Also, a bit like gofer: simply couldn't resist, just did that for the fun (after reaScript you should also dig into that concept, the "fun"). I knew I shouldn't do that..
Reflected,
I see clear.
also, I saw your post before you edited it, you went a bit far with your adjectives and especially about my non-helpfullness...
also, no need for a "deal", the forum offers some tools for that.
here are your actions. please, just don't bug me anymore.
_____________
ok, rather than debating about your behavior, I looked to that: you'll find your actions in the (updated) zip here: http://forum.cockos.com/showpost.php...0&postcount=13. I just ckecked it works (to be understood as: "not tested"). I'll do nothing more about that before putting them in SWS OS.
the "entry point" action is:
-Load and store FX chain...
then you have:
-Set stored FX chain to selected item(s), active take
-Set stored FX chain to selected item(s), all takes
-Set stored FX chain to selected track(s)
and also (same code):
-Clear FX chain for selected item(s), active take
-Clear FX chain for selected item(s), all takes
-Clear FX chain for selected track(s)
|
|
|
02-25-2010, 05:08 AM
|
#40
|
Mortal
Join Date: Dec 2008
Location: France
Posts: 1,969
|
sfzgeek, thanks.
eh!? did you see the progress in that other thread (the face-to-face with schwa.. I'm a bit scared. hummm.. curious.. all other 3rd party devs seems in hollidays ).
I wanted to say to you: for some reasons, I have to send some champagne to cockos, perharps you should also send your mythical sunglasses to schwa, I think he really deserves such big ones
|
|
|
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 04:50 PM.
|