Old 03-05-2014, 07:29 AM   #41
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 14,214
Default

Quote:
Originally Posted by VVV View Post
BTW is there an FR for this?
post 28 has 2 of them
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 03-14-2014, 04:56 PM   #42
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

i did it! a nondestructive version of the native glue.

it stores the original items in a hidden track, then duplicates and glues, then reinserts the glued item where the originals were. it uses notes to keep track of which 'glue group' an instance belongs to.

when you unglue, it creates an empty container behind the items, which keeps track of the glue group they belong to, then when you click glue again, it updates all instances that have the same glue group id in their notes! you can even nest glue groups within glue groups, and they will all update. i tested it with 20 levels of nesting and it was fine. also tried it with 1400 instances of the glued items. took around 3 seconds to update!

finally, if you have midi items in your selection and you create a glue group, it will automatically 'apply track fx as new take' to the midi items, so they can be glued. when you unglue though, it deletes the take from the reinserted midi item, and restores the original take.



the hidden track method is not ideal, but until reascript offers a way to store extra data in projects, its the best i could come up with. the empty container is also not ideal, but it works ok. ill release the source in a bit, and hopefully anyone with more python/reascript skills can improve it. or ideally, reaper devs can give glueing a bit of love and actually implement this natively. it basically just requires storing the state chunks of the original items somewhere and a few loops to update srcs.
matthewjumpsoffbuildings is offline   Reply With Quote
Old 03-16-2014, 06:02 AM   #43
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

Just opened up the bitbucket repo

https://bitbucket.org/matthewjumpsof...reaper-scripts
matthewjumpsoffbuildings is offline   Reply With Quote
Old 04-06-2014, 02:21 AM   #44
Peach
Human being with feelings
 
Join Date: Jul 2011
Posts: 23
Default

+1. I need this to work with Reaper!
Peach is offline   Reply With Quote
Old 04-06-2014, 07:36 AM   #45
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 7,239
Default

very nice matthew
I didn't notice this thread! Going to try these scripts right now
heda is offline   Reply With Quote
Old 04-06-2014, 09:46 AM   #46
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 14,214
Default

Indeed! Nice work there.

I'm really hoping we can convince the devs this is crucial as I would really like to take all my complex edits with automation (and gaps between items) and treat them as a nice and neat item that goes from start to end of the bar
__________________
subproject FRs click here
note: don't search for my pseudonym on the web. The "musicbynumbers" you find is not me or the name I use for my own music.
musicbynumbers is offline   Reply With Quote
Old 04-06-2014, 12:55 PM   #47
urednik
Human being with feelings
 
urednik's Avatar
 
Join Date: Apr 2010
Posts: 1,247
Default

Non destructive glue and PT playlists, please!
This script versions are to slow, so developers have to do it soon. Eventually
__________________
W10 (64) Lenovo E540 - SSD; Lenovo B590; W7 (32), Compaq 610 (2.1Ghz core 2 duo, L2 cache, 2GB RAM); DPA 4018, Schoeps MK2, Schoeps MTSC 64, Neumann mk184, AEA Ribbon 88mk, AKG SolidTUBE; Focusrite Scarlett 18i20, recording merely live acoustic music.
urednik is offline   Reply With Quote
Old 11-07-2014, 05:32 PM   #48
nonobvious
Human being with feelings
 
nonobvious's Avatar
 
Join Date: Apr 2012
Location: brooklyn
Posts: 284
Default

I want this sooo badddly
nonobvious is offline   Reply With Quote
Old 02-03-2015, 11:46 AM   #49
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Is it time for it?
vitalker is online now   Reply With Quote
Old 02-04-2015, 02:53 AM   #50
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Bump!
vitalker is online now   Reply With Quote
Old 02-04-2015, 03:18 AM   #51
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

i plan to redo my code for nondestructive glue, especially in view of the speed boost EEL provides.

however i really need to be able to store data in the project xml. i need API access to the project bay, which hasnt been developed yet, and may not be. or i need to work out how write a plugin that somehow allows me to store data in the plugin data nodes in the project xml.
__________________
[sun sprites] spotify facebook
matthewjumpsoffbuildings is offline   Reply With Quote
Old 02-07-2015, 04:58 AM   #52
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

Quote:
Originally Posted by matthewjumpsoffbuildings View Post
i plan to redo my code for nondestructive glue, especially in view of the speed boost EEL provides.
No, it would be better to have this function in native API.
vitalker is online now   Reply With Quote
Old 02-07-2015, 05:28 AM   #53
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

Quote:
Originally Posted by vitalker View Post
No, it would be better to have this function in native API.
obviously, but this kind of thing has been requested for years, no idea when the devs will sort it. in the meantime im gonna try and make a reascript version that is close enough
__________________
[sun sprites] spotify facebook
matthewjumpsoffbuildings is offline   Reply With Quote
Old 02-07-2015, 08:53 AM   #54
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Quote:
Originally Posted by matthewjumpsoffbuildings View Post
however i really need to be able to store data in the project xml.
In the latest pre-release, there are functions for that (haven't tested yet)

Code:
EEL: int SetProjExtState(ReaProject proj, "extname", "key", "value")
EEL: int GetProjExtState(ReaProject proj, "extname", "key", #valOut)
EEL: bool EnumProjExtState(ReaProject proj, "extname", int idx, optional #keyOutOptional, optional #valOutOptional)
spk77 is offline   Reply With Quote
Old 02-07-2015, 09:02 AM   #55
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

Quote:
Originally Posted by spk77 View Post
In the latest pre-release, there are functions for that (haven't tested yet)

Code:
EEL: int SetProjExtState(ReaProject proj, "extname", "key", "value")
EEL: int GetProjExtState(ReaProject proj, "extname", "key", #valOut)
EEL: bool EnumProjExtState(ReaProject proj, "extname", int idx, optional #keyOutOptional, optional #valOutOptional)

holy shit thats awesome! i wish the devs would let me know if non-destructive glue was gonna happen soon, i dont want to spend tons of time redoing this in EEL only to have a native solution released soon after. but im kinda motivated to try anyway :P
__________________
[sun sprites] spotify facebook

Last edited by matthewjumpsoffbuildings; 02-07-2015 at 09:21 AM.
matthewjumpsoffbuildings is offline   Reply With Quote
Old 02-07-2015, 10:43 AM   #56
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

also the other thing that would make this a million times easier is the ability to edit items notes via the api.

currently im doing a str replace hack to insert the data into xml state of the group containers notes, so i can keep track of which group the item belongs to. it also doubles as a visual aid so you can see which group the items belong to.
__________________
[sun sprites] spotify facebook
matthewjumpsoffbuildings is offline   Reply With Quote
Old 02-07-2015, 10:53 AM   #57
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Quote:
Originally Posted by matthewjumpsoffbuildings View Post
also the other thing that would make this a million times easier is the ability to edit items notes via the api.

currently im doing a str replace hack to insert the data into xml state of the group containers notes, so i can keep track of which group the item belongs to. it also doubles as a visual aid so you can see which group the items belong to.
These might work :
Code:
EEL: bool extension_api("ULT_GetMediaItemNote", #retval, MediaItem item)
EEL: extension_api("ULT_SetMediaItemNote", MediaItem item, #note)
(Needs SWS extension (maybe beta?) and the latest pre-release of Reaper)
spk77 is offline   Reply With Quote
Old 02-07-2015, 11:02 AM   #58
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

man you are the EEL guru. thanks so much, its hard to keep up to date with all the new API stuff sometimes

ill check it out soon... im motivated now, hopefully have an updated, much faster and cleaner EEL version of glue groups in a few days. id love your input on it when its up on bitbucket too, if thats cool.
__________________
[sun sprites] spotify facebook
matthewjumpsoffbuildings is offline   Reply With Quote
Old 02-08-2015, 11:44 AM   #59
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default Nice !

This is one of the most powerful unglue script since ReaScript - Superglue
It should be post on the JSFX/ReaScript forum so every one know it exists

Can't wait to see out it will evolves !

Thanks for sharing !
X-Raym is offline   Reply With Quote
Old 02-09-2015, 10:17 AM   #60
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

spk77, im trying to use that ULT extension to get the notes, i get an error
Code:
'ULT_SetMediaItemNote' unknown function
heres the code im using
Code:
extension_api("ULT_GetMediaItemNote", #notes, item);
the function shows up in the help menu reascript api HTML, so im not sure why its not working...
__________________
[sun sprites] spotify facebook
matthewjumpsoffbuildings is offline   Reply With Quote
Old 02-09-2015, 11:37 AM   #61
spk77
Human being with feelings
 
Join Date: Aug 2012
Location: Finland
Posts: 2,668
Default

Hmm...Do you have SWS 2.6.2 build #0 and the latest preversion of REAPER?


It works here:


Code:
(item = GetSelectedMediaItem(0,0)) ? (
  extension_api("ULT_GetMediaItemNote", #note, item);
  #note += "new text\r\n"; // seems we have to use "\r\n" for newline
  extension_api("ULT_SetMediaItemNote", item, #note);
  UpdateItemInProject(item);
);
spk77 is offline   Reply With Quote
Old 02-09-2015, 01:25 PM   #62
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

ah i didnt have the very latest SWS beta.

im workin away on this, but i have a couple of questions/possible problems. the EEL language is way more limited, and i dont know it very well so im probably making a lot of mistakes. im also having a lot of trouble debugging, for example unless something is a string i cant seem to show anything in the console?

also this kind of script relies on a lot of nested function calls, including function A calling function B which then calls function A several more times... is this a problem with EEL?

should i be switching to Lua? it seems higher level than EEL, but im guessing not as performant? i want this glue group code to be very efficient, i can imagine people would have projects with hundreds, perhaps even thousands of copies of glued items, including nested glued items, so when you unglue and edit one it needs to be able to update all the other instances, and recursively update any nested instances, very quickly. python was quite slow, too slow to be honest, if Lua is similarly slow i guess ill have to struggle through with EEL.

if EEL is the best bet, can you recommend any tutorials or documentation? the API docs and even the basic docs on the reaper site are ok to start but theres a lot of stuff i still cant figure out (like how to show non-string data in the console :P)
__________________
[sun sprites] spotify facebook
matthewjumpsoffbuildings is offline   Reply With Quote
Old 02-09-2015, 03:07 PM   #63
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

Quote:
Originally Posted by matthewjumpsoffbuildings View Post

should i be switching to Lua? it seems higher level than EEL, but im guessing not as performant?
Not a coder myself but here's a few things schwa says about EEL and Lua (from post #4)

http://forum.cockos.com/showthread.php?t=152355
nofish is offline   Reply With Quote
Old 02-10-2015, 06:11 AM   #64
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

ok id prefer to do it in EEL if i could, but it might have to be Lua.

just wondering if anyone can tell me how to show console messages in EEL with non-string values?

if i have a variable x with a value of 20, i can do ShowConsoleMsg(x). i also dont know how to do string interpolation... eg ShowConsoleMsg("the value of x is {x}") or something like that... is this kind of thing possible?

i really dont quite understand the way strings work in EEL. i dont get the difference between myString = "foo" and #myString = "foo". i also cant get string matching to work properly, probably in part due to my trouble grasping how EEL handles strings.

any advice would be appreciated.
__________________
[sun sprites] spotify facebook
matthewjumpsoffbuildings is offline   Reply With Quote
Old 02-10-2015, 06:23 AM   #65
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

@matthew

take a look at EEL : Console debug messages.
It is my personnal script for displaying all kind of variable value in the console.
You can use it, or take it as inspiration for building your own function.

For some case, like with global variable, I have to use the match function to convert it into a standard variable.
X-Raym is offline   Reply With Quote
Old 02-10-2015, 08:33 AM   #66
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

ok that helped with the logging, cheers.

this match() issue is driving me insane though.

Code:
function getGlueGroupFromItem(item)
(
	// use the SWS ULT extension to get the notes
	extension_api("ULT_GetMediaItemNote", #notes, item);

	match("*glue_group_container:%d:*", #notes, results) ? (
		ShowConsoleMsg("match\n");
		ShowConsoleMsg( sprintf(#, "%d", strlen(results)) );
		ShowConsoleMsg("\n");
	);
);
i have confirmed that #notes contains the correct string, and the match is returning true because the ShowConsoleMsg("match") is firing. but its saying that the strlen of the results variable is 0, and if i try and ShowConsoleMsg(results) i get nothing.

what the hell is going on?
__________________
[sun sprites] spotify facebook
matthewjumpsoffbuildings is offline   Reply With Quote
Old 02-10-2015, 08:39 AM   #67
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

haha yeah all that strings & console stuff really drove me crazy more than once

try to replace this
Code:
ShowConsoleMsg( sprintf(#, "%d", strlen(results)) );
by this
Code:
sprintf(str, "%d", strlen(results));
ShowConsoleMsg(str);
Sprintf store the result in a variable. Here, it's str.
X-Raym is offline   Reply With Quote
Old 02-10-2015, 08:49 AM   #68
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

sprintf also returns the string, the approach i was using works for other variables.

changing it got the same output - it seems like the 'results' string is empty.

i also confirmed this by attempting to run a match() looking for something in the results string that definitely shouldve been there, and it failed.

ultimately what im trying to do is match "glue_group_container:n:" anywhere in the items notes string, but im only interested in the number between the colons... im not sure how to do regexp style backreferencing either.
__________________
[sun sprites] spotify facebook
matthewjumpsoffbuildings is offline   Reply With Quote
Old 02-10-2015, 09:32 AM   #69
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Is that what you are looking for ?

X-Raym is offline   Reply With Quote
Old 02-10-2015, 09:39 AM   #70
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

ye thats exactly it. i had a trailing colon ( glue_group_container:5: ) but i cant remember why i did that originally. its probably cleaner to just do glue_group_container:5 with no trailing colon
__________________
[sun sprites] spotify facebook
matthewjumpsoffbuildings is offline   Reply With Quote
Old 02-10-2015, 09:41 AM   #71
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

Yeah, I saw it

here is my code :

Code:
            extension_api("ULT_GetMediaItemNote", #notes, item);
            match("*glue_group_container:%d:*", #notes, results);

            match("*glue_group_container:%d*", #notes, results) ? (
                ShowConsoleMsg("match\n");
                ShowConsoleMsg( sprintf(#, "%d", results) );
                ShowConsoleMsg("\n");
            ):(
                ShowConsoleMsg("No Match\n");
            );
Hope it can help !

ps : I wonder if this would work if glue_group_container is something like 10. (two numbers)
X-Raym is offline   Reply With Quote
Old 02-10-2015, 10:04 AM   #72
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

i copy pasted your code and it works, thanks

though i honestly cant tell what the significant difference is? what was i doing wrong?
__________________
[sun sprites] spotify facebook
matthewjumpsoffbuildings is offline   Reply With Quote
Old 02-10-2015, 10:11 AM   #73
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

Quote:
Originally Posted by X-Raym View Post
ps : I wonder if this would work if glue_group_container is something like 10. (two numbers)
yep, it worked with 999999999. id imagine that would be enough
__________________
[sun sprites] spotify facebook
matthewjumpsoffbuildings is offline   Reply With Quote
Old 02-10-2015, 10:14 AM   #74
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

  • trailing :
  • strlen(results) instead of results.
    strlen
    returns string lengh, so it not what we want, and so, result is not a string but a decimal.
Note that if you use my console functions script,
Code:
                ShowConsoleMsg("match\n");
                ShowConsoleMsg( sprintf(#, "%d", results) );
                ShowConsoleMsg("\n");
could simply become
Code:
msg_tvold("match", results, "%d", 0, debug);


EDIT : 999999999 ? But I needed 1000000000 !!
X-Raym is offline   Reply With Quote
Old 02-10-2015, 10:19 AM   #75
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

of course, i assumed the result of match using "glue_group_container:%d" would be the entire string match, eg "glue_group_container:22" and not just 22. i was treating the result variable as a string the whole time when it was a decimal. i assumed that i had to do something else to get the backreferencing ala regexp.

thanks
__________________
[sun sprites] spotify facebook
matthewjumpsoffbuildings is offline   Reply With Quote
Old 02-11-2015, 12:30 PM   #76
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

another issue - i dont seem to be having any success with the SetMediaItemNote function. the GetMediaItemNote is working fine, but Set seems to do nothing.

can anyone else confirm that they can get this working?
__________________
[sun sprites] spotify facebook
matthewjumpsoffbuildings is offline   Reply With Quote
Old 02-11-2015, 01:21 PM   #77
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

it works for me !

Code:
  i = 0;
  loop(CountSelectedMediaItems(0),
    (item = GetSelectedMediaItem(0, i)) ? (
      #note = "bonjour2";
      extension_api("ULT_SetMediaItemNote", item, #note);
    );
    i += 1;
  );
don't hesitate to show us your script in beta to help you debug what you are doing :P
X-Raym is offline   Reply With Quote
Old 02-12-2015, 09:08 AM   #78
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

heres the function im using
Code:
function setItemGlueGroup(item, glue_group, not_container) local(key)
(
	key = not_container ? "glue_group:" : "glue_group_container:";

	#notes = "";
	#notes += key;
	#notes += sprintf(#, "%d", glue_group);

	ShowConsoleMsg(#notes);
	ShowConsoleMsg("\n");

	extension_api("ULT_SetMediaItemNote", item, #notes);
);
its definitely receiving the item variable correctly because if i do a ULT_GetMediaItemNote it returns the correct notes.

but if i do a Set, it does nothing.
__________________
[sun sprites] spotify facebook
matthewjumpsoffbuildings is offline   Reply With Quote
Old 02-12-2015, 09:13 AM   #79
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,875
Default

and ShowConsoleMsg(#notes) display the right thing ?
X-Raym is offline   Reply With Quote
Old 02-12-2015, 09:13 AM   #80
matthewjumpsoffbuildings
Human being with feelings
 
Join Date: Mar 2013
Posts: 463
Default

yes it shows glue_group_container:34 or whatever
__________________
[sun sprites] spotify facebook
matthewjumpsoffbuildings is offline   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 04:37 PM.


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