Old 05-27-2013, 02:14 AM   #1
Arteo
Human being with feelings
 
Join Date: May 2013
Posts: 1
Default ReaScript - Superglue

Hello!
I’m new REAPER user and I like this DAW, but I miss some features. One of that is some kind of item container, because I like to make my drums from audio samples straight into timeline. I think it’s faster way to program beats, than using some drum sampler, then import samples, create MIDI, route outputs etc. But the problem was that if there are a lot small pieces of audio it’s hard to move them across the Project while you working on arrangement. So, the logic step is to glue them together. But if you later want to do some edits or make some fills it’s impossible, because you can’t restore original parts.
I discovered that there is ReaScript API, and maybe I can make this feature by myself. And so I did it! Introducing - the Superglue. I’m a not a very experienced programmer, in fact it is my second Python script ever. It took me two evenings to figure out the API and do programming. So I want to share it, because maybe others can improve it, if someone else misses this feature.
So, what this script really does? Essential it is the regular REAPER glue function which remembers the glued items and their state.

For example, here you have single items. In one track audio in second MIDI. You can’t glue together MIDI and audio items.
[IMG]http://**************/a/img199/8122/26828207.png[/IMG]

Made some edits.
[IMG]http://**************/a/img839/3361/89237070.png[/IMG]

Then I glued them together using my Superglue. You can’t glue across the tracks, because API returns nothing if you call REAPER functions, so I don’t know how then get and identify glued items.
[IMG]http://**************/a/img854/8467/50127464.png[/IMG]

Now you can do whatever you can do with items in REAPER (Move, Copy, Loop, Reverse, etc.). And then if you want to restore the original parts, you just do Remove Superglue and it will replace the item with restored parts. If you looped the item, it will restore parts only for first item in loop, but then you can glue it together again and loop it.
[IMG]http://**************/a/img833/5889/96417917.png[/IMG]

How it works? Very simple, it’s stores the glued items states in SQLLite file (superglues.db) in your project directory and adds GID tag to glued item name, so you can get parts later. GID is just a timestamp, I think it’s enough random for this kind of use and there is no need for complex hashes. You even possibly can copy the GID tag and paste it in different item which you want to replace with corresponding parts.
[IMG]http://**************/a/img42/6876/95966260.png[/IMG]

Try and use this script on your own risk of course! It’s not damaging to project in any way, it’s a regular glue function that can remember what it did. If you move the project you should move the superglues.db file along manually, or you can try to experiment importing it in your media bay and disable its use in any way.

I used Python 2.7.5 and Windows 7 32bit PC.

There are two script files, one for adding Superglue (add_superglue.py) and other for removing Superglue (remove_superglue.py).

Good day for everyone!
Attached Files
File Type: zip Superglue.zip (2.8 KB, 297 views)
Arteo is offline   Reply With Quote
Old 05-27-2013, 03:50 PM   #2
sfzgeek
Human being with feelings
 
sfzgeek's Avatar
 
Join Date: Feb 2009
Location: Dunedin, New Zealand
Posts: 205
Default

Quote:
Originally Posted by Arteo View Post
One of that is some kind of item container, because I like to make my drums from audio samples straight into timeline. I think it’s faster way to program beats, than using some drum sampler, then import samples, create MIDI, route outputs etc. But the problem was that if there are a lot small pieces of audio it’s hard to move them across the Project while you working on arrangement.
After years of loading sliced beats into samplers, I came to the same conclusion.

A few years ago I built a solution that used a combination of AutoHotkey (for a GUI) and ReaScript (Perl). It worked really well but, of course, Perl is no longer supported and I haven't found the time to port over to Python. If I spent the time I could probably eliminate the AutHotkey part and use Python to create the GUI.

I really like your ideas here! I'll definitely be looking into how you did this... I wish I could share my solution to this problem with you! Maybe one day...
__________________
My rawk band: The Hidden Venture.
sfzgeek is offline   Reply With Quote
Old 01-26-2015, 09:43 AM   #3
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default

One comment only !
but... This is brillant !
not bad for a first script :P

Thanks for sharing, will test it as soon as possible !
X-Raym is offline   Reply With Quote
Old 01-26-2015, 09:52 AM   #4
plamuk
Human being with feelings
 
Join Date: Feb 2007
Posts: 3,221
Default

samples on the timeline are great. now if only someone would figure out a way to drop/place the actual audio items onto the timeline upon midi-assigned input, rather than recording midi. perhaps drawing from the RSk5 sample bank loaded on the track.

as separate instances of the hits, rather than 1 big recorded output file.
plamuk is offline   Reply With Quote
Old 01-26-2015, 10:07 AM   #5
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default

@nym
I have to admit that's a pretty nice idea

It could probably done in two basic steps.
  • setting a sampler with midi keys and your samples.
  • convert the recorded midi file into items an another track, depending on the in put key.
There is a lot of MIDI functions in the API.
I don't really know how reaper would know what sample to load, but I guess if the items are already in project (within a certain track name, and with item name based on the desire note ?) it is possible.



I could not personally do that, I didn't make any MIDI ReaScript programming.
X-Raym is offline   Reply With Quote
Old 01-26-2015, 10:17 AM   #6
witti
Human being with feelings
 
witti's Avatar
 
Join Date: May 2012
Posts: 1,216
Default

Quote:
Originally Posted by nym View Post
samples on the timeline are great. now if only someone would figure out a way to drop/place the actual audio items onto the timeline upon midi-assigned input, rather than recording midi. perhaps drawing from the RSk5 sample bank loaded on the track.

as separate instances of the hits, rather than 1 big recorded output file.
Copy a media file from the windows explorer/reaper's media explorer to the clipboard and try this macro:

-move edit cursor to play cursor
-xenakios/sws: insert media from clipboard

You should select a track first. Assign a midi note to that macro.
witti is offline   Reply With Quote
Old 01-26-2015, 10:55 AM   #7
Quest The Wordsmith
Human being with feelings
 
Quest The Wordsmith's Avatar
 
Join Date: May 2011
Location: Shaolin => NJ
Posts: 1,213
Default

Quote:
Originally Posted by nym View Post
samples on the timeline are great. now if only someone would figure out a way to drop/place the actual audio items onto the timeline upon midi-assigned input, rather than recording midi. perhaps drawing from the RSk5 sample bank loaded on the track.

as separate instances of the hits, rather than 1 big recorded output file.
This sounds like a cool idea. I use Poise as my drum sampler (really sample loader / trigger'er) of choice. Since Reaper loads the vsti with all associated midi & audio channels properly routed, what would be the advantage to having something load samples on the timeline as opposed to the midi way of doing things now?
__________________
freestylefam.com
Quest The Wordsmith is offline   Reply With Quote
Old 01-26-2015, 11:11 AM   #8
Win Conway
Human being with feelings
 
Join Date: Dec 2010
Posts: 3,826
Default

Quote:
Originally Posted by witti View Post
Copy a media file from the windows explorer/reaper's media explorer to the clipboard and try this macro:

-move edit cursor to play cursor
-xenakios/sws: insert media from clipboard

You should select a track first. Assign a midi note to that macro.
No need to use the clipboard, use SWS media slots

But if you want a really slick way to do it, then just buy the Playtime addon/VST
__________________
Stop posting huge images, smaller images or thumbnail, it's not rocket science!
Win Conway is offline   Reply With Quote
Old 01-26-2015, 11:23 AM   #9
witti
Human being with feelings
 
witti's Avatar
 
Join Date: May 2012
Posts: 1,216
Default

Forgot about the media slots. The method i've posted is nice but far from being ideal, as you can't hear a sound while pasting. (Unfortunately)
But i've created another/similar macro which pastes from the clipboard to a track under mouse cursor at mouse cursor. A very quick way to add samples to the arrange view. (From anywhere of your HD.)
witti is offline   Reply With Quote
Old 01-26-2015, 02:34 PM   #10
Win Conway
Human being with feelings
 
Join Date: Dec 2010
Posts: 3,826
Default

The reason i mentioned slots is that you can play and add to track.

However nothing competes with Playtime if you are interested in inserting audio or midi on the timeline as you jam, it is the best solution by far.
__________________
Stop posting huge images, smaller images or thumbnail, it's not rocket science!
Win Conway is offline   Reply With Quote
Old 01-26-2015, 02:49 PM   #11
witti
Human being with feelings
 
witti's Avatar
 
Join Date: May 2012
Posts: 1,216
Default

Never heard about 'Playtime'. Googled it and it seems to be payware. Interesting, but i can't afford it ! Yes, i'm just a poor musician !
witti is offline   Reply With Quote
Old 01-26-2015, 03:52 PM   #12
musicbynumbers
Human being with feelings
 
musicbynumbers's Avatar
 
Join Date: Jun 2009
Location: South, UK
Posts: 14,214
Default

I might have got this wrong (stick end of the thread) but there is an action to place the last selected file in media explorer into the arrange under the mouse.

Or you can make reaper in media explorer use the last selected as the pen like "control and drag" item creation function in the arrange.

Don't think that's what you want but useful
__________________
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 01-26-2015, 06:40 PM   #13
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default

@musivbynumbers
the idea suggested by nym in post4 (which is not really the subject of the post1) is actually to be able to insert (and play) items in the timeline whith midi note inputs. So, it would be abble to define more than one items, and should be playable in realtime

@gpunk_w
OMG, Playtime ! I never heard about this !!
A whole plugin dedicated to REAPER !
It looks awesome !
Do you have any other hidden gems like that ?
X-Raym is offline   Reply With Quote
Old 01-27-2015, 03:14 PM   #14
jrp
Human being with feelings
 
Join Date: Nov 2014
Posts: 194
Default

this script is brilliant!
jrp is offline   Reply With Quote
Old 01-27-2015, 04:56 PM   #15
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default

Yes, sad to see it was the only post of its author !
X-Raym is offline   Reply With Quote
Old 03-24-2015, 12:56 PM   #16
Pasajeromoronmoreno
Human being with feelings
 
Join Date: Nov 2013
Location: Argentina
Posts: 326
Default

Sadly, don´t work for me me... It says this:

Script execution error

Traceback (most recent call last):
File "C:\Python34\Lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_t able)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 80: character maps to <undefined>

Edit: Im pretty sure of the existence of other script doing something similar to this, but i don´t download at that time, and can´t find it anywhere. Can´t recall the name of the script neither...
__________________
Living la vida loca

Last edited by Pasajeromoronmoreno; 03-24-2015 at 01:12 PM.
Pasajeromoronmoreno is offline   Reply With Quote
Old 03-24-2015, 03:19 PM   #17
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,874
Default

Yes, and this script isn't supported anymore. Look for a thread called non destructive blue in feature request forum. It is a modern version of this script by matthewjumpsoffthe buildings.
X-Raym is offline   Reply With Quote
Old 04-30-2022, 12:05 PM   #18
MonkeyBars
Human being with feelings
 
MonkeyBars's Avatar
 
Join Date: Feb 2016
Location: Hollyweird
Posts: 2,630
Default

Oops I didn't see that this name was already taken!

Sorry about that. Well, I ended up perfecting matthewjumpsoffbuildings's project and unknowingly used the same name. Enjoy!
MonkeyBars 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 02:10 AM.


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