Old 06-09-2019, 01:48 PM   #1
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: Southern Vermont
Posts: 864
Default Dfk's Transient Guru (v1.1)

Disclaimer:
Test/use my scripts at your own risk. While it is atypical that a REAPER Lua script would damage or harm your hardware/software/data, I will not accept any liability if this were to occur. The download, installation, and operation of my scripting code and its structures are strictly an operative of free will, and signify an agreement to these terms. You are responsible for any damages that might occur, however unlikely. All my scripts are licensed as GPL v.3.

The script requires Reaper [5.978+], SWS/S&M [2.10.0+], and js_ReaScriptAPI [.987+].

Video (v1.02):



Goodies:

Accuracy:
Accuracy is the time-length of audio in samples used to formulate the average db and average frequency values. Left-click this button to set the "Accuracy" length to the length of your time selection. It is best to ensure this value is set large enough to maintain accurate transient detection, yet small enough to eliminate the possibility of reading transients that potentially may be nearby your stretch-markers (a.k.a., the ‘sweet spot’).
Threshold:
The threshold refers to the variable amount that each stretch-marker may differ from your chosen stretch-marker's average db or frequency (or else it will get removed!). For instance, a value of 10 threshold would mean that all stretch-markers within the workflow item must range within a multiplied variance of 10 in order to remain. Threshold defaults a 10000, which essentially just ensures that no stretch-markers are removed prior to a user deliberation.
Choose SM:
In order to select a stretch-marker, left-click the "Choose SM" button and hold: move your mouse over the desired stretch-marker inside your workflow item, and release.
[UP/DOWN] Keys:
These keys micro-adjust the threshold variable when the script window is focused. Focus the window simply by clicking inside the window, or on its title-bar.
Settings:
Settings contains three different options for calculation of/and stretch-marker removal.

1 (default): Calculation is based off both the average db and average frequency values.
2 (spectrum): Calculation is determined using only the average frequency data.
3 (volume): Calculation is determined using only the average db data.
Create Dyn. Midi:
Creates a MIDI track item and populates with midi notes correlating to stretch-marker data. These notes are velocity sensitive, and are PPQ accurate.
Extra Notes:
Right-click the "Threshold" value to adjust the db threshold used to calculate average frequency.

Right-click the "Accuracy" value to manually input a positive integer accuracy value.

Shoutout to X-Raym for the portion of his code I used to figure out the frequency detection portion of this script. https://forum.cockos.com/showthread.php?t=213286
Release Log:
[v1.01]
-Altered algorithm for transient detection.
-Fixed issue where mouse would active buttons on the GUI even if window wasn't focused.
-Removed the ability to input "0" as an accuracy value (pointless, and caused errors.)
-Added support for stereo tracks.
-Added "Update SM's" button to the GUI.
-Added support for pre-stretched stretch-markers.
[v1.02]
-Added "average frequency" detection.
-Added 3 settings for stretch-marker filtration.
-Added shadows to GUI.
-Added maximum-limit for accuracy setting of 1-second of samples (typically 44100+).
-Bolstered "Help" documentation.
-Removed minor bugs.
-Removed all calls to Main_OnCommand.
-Removed stretch-marker "Slope" viewer-detail.
-Improved script speed/efficiency
[v1.03]
-Removed "Fingerprint" nonsense, replaced with factual content.
-Configured “out-of-bound” stretch-marker message only to show when applicable.
-Added an undo point at startup of script for renewing any undesired removal of stretch-markers.
-Bolstered "Help" documentation.
[v1.1]
-NEW FEATURE: "Create Dyn. Midi"
-Optimized script. Now handles multiple items/tracks simultaneously.
-Enhanced overall script speed.
Attached Files
File Type: lua Dfk's Transient Guru.lua (32.1 KB, 238 views)

Last edited by Dafarkias; 03-26-2020 at 03:44 AM. Reason: N/A
Dafarkias is offline   Reply With Quote
Old 06-11-2019, 01:23 PM   #2
HoJo
Human being with feelings
 
Join Date: Dec 2007
Location: Germany
Posts: 253
Default

Hi.

This looks really good, but actually I wonder what situations this might be used at?
Can you point me in the right direction?
What is this useful for. And how to use it.

Thx.

BR,
HoJo
HoJo is offline   Reply With Quote
Old 06-11-2019, 04:13 PM   #3
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: Southern Vermont
Posts: 864
Default

Quote:
Originally Posted by HoJo View Post
Hi.

This looks really good, but actually I wonder what situations this might be used at?
Can you point me in the right direction?
What is this useful for. And how to use it.

Thx.

BR,
HoJo
Hi Hojo, thanks for the comment.

I made this script specifically for my own use, but I decided to share it in case someone/anyone might find it useful.

Essentially what I set out to make was a script that adds EQ/frequency detection to Reaper's "Dynamic Split."

Currently, Reaper's "Dynamic Split" detects based on an unbiased audio threshold (I'm pretty sure), meaning that it has no settings or ability to do the following:

Hey Reaper, only place stretch markers at transients with a similar EQ to a specifically chosen transient!

This script was designed with the intention to combat that inability, by, after running the script and following its moderately confusing instructions, removing all stretch markers from a selected item that don't meet the user's criteria a.k.a. threshold.

This feature can also be used to split audio takes too, for those of you who haven't aren't crazy about stretch markers and prefer good old fashioned "slip-editing," simply because Reaper has "split item(s) at stretch marker(s)" capabilities.

It's a very obscure script. Mainly good for editing drums, I would hazard to guess (if it's even good for that?), but it did seem to work okay when I tried it out in the unedited video I posted. Keep in mind I just banged this thing together in the last 3 days.

Thanks for your interest,

Dafark

[Add., 6/12/2019]

Just want to reiterate that I still plan on updating this script to the tune of adding compatibility with stereo items and "stretched" stretch markers. I also may include a dedicated "Calibrate/Update SM's" button in the GUI (as opposed to having to change the "accuracy" setting to update stretch marker edits).

I realize that this script is not for everyone, it won't be an overnight sensation, but that's okay because it wasn't intended to be! My favorite thing about Reaper is the sheer amount of obscure information you can find documented in this forum if you take a little time to research what you are looking for, its unprecedented of any audio software I've ever seen/used (My experience with DAW's is not all inclusive; I've dabbled in Garageband, Cakewalk 4, and for about 5+ years, Studio One).

...Back on track, expect the update within a few days, I reckon. Or don't.

Last edited by Dafarkias; 06-12-2019 at 03:17 AM. Reason: Update Info;
Dafarkias is offline   Reply With Quote
Old 06-13-2019, 01:24 PM   #4
HoJo
Human being with feelings
 
Join Date: Dec 2007
Location: Germany
Posts: 253
Default

Awesome. Really great. By accident, you started working on something I was hoping/asking for a while ago. See here:
https://forum.cockos.com/showthread....highlight=idea
HoJo is offline   Reply With Quote
Old 06-13-2019, 01:30 PM   #5
HoJo
Human being with feelings
 
Join Date: Dec 2007
Location: Germany
Posts: 253
Default

Awesome. Really great. By accident, you started working on something I was hoping/asking for a while ago. See here:
https://forum.cockos.com/showthread....highlight=idea
HoJo is offline   Reply With Quote
Old 06-13-2019, 02:06 PM   #6
HoJo
Human being with feelings
 
Join Date: Dec 2007
Location: Germany
Posts: 253
Default

Unfortunately, I get this type of error, when using it on Kick/Snare Tracks only...

Dfk Item; Stretch Marker; Transient Matcher.lua:169: attempt to call a nil value (field 'JS_Mouse_GetState')

Edit: I'm on MacBookPro, OSX, Sierra

Last edited by HoJo; 06-13-2019 at 02:12 PM.
HoJo is offline   Reply With Quote
Old 06-13-2019, 02:15 PM   #7
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 HoJo View Post
Unfortunately, I get this type of error, when using it on Kick/Snare Tracks only...

Dfk Item; Stretch Marker; Transient Matcher.lua:169: attempt to call a nil value (field 'JS_Mouse_GetState')

Edit: I'm on MacBookPro, OSX, Sierra
Do you have js_ReaScriptAPI extension installed?
Looks like this script requires it, assuming from the error message.

https://forum.cockos.com/showthread.php?t=212174

edit:
Yes, missed it in the opening post:
Quote:
FYI: It does require REAPER: 5.978, SWS/S&M 2.10.0, and js_ReaScriptAPI .987

Last edited by nofish; 06-13-2019 at 02:36 PM.
nofish is offline   Reply With Quote
Old 06-14-2019, 02:27 AM   #8
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: Southern Vermont
Posts: 864
Default

Quote:
Originally Posted by nofish View Post
Do you have js_ReaScriptAPI extension installed?
Looks like this script requires it, assuming from the error message.
Quote:
Originally Posted by HoJo View Post
Unfortunately, I get this type of error, when using it on Kick/Snare Tracks only...

Dfk Item; Stretch Marker; Transient Matcher.lua:169: attempt to call a nil value (field 'JS_Mouse_GetState')

Edit: I'm on MacBookPro, OSX, Sierra
nofish hit the nail on the head. I've boldened the font stating the script requirements, and I'm very interested if the script will work with your OS after having installed the extensions, I will highly appreciate any information that you give me regarding bugs or errors!

Hmmm. This is the unfortunate time that I have to admit I'm a reckless "programmer" and that the [up/down] key function of this script (probably) does not work for any OS other than Windows. It was a corner that I cut, and never went back to research and reprogram a fix for due to forgetfulness. I'll try and work on that.** There may be other OS compatibility issues that exists, but none that I'm aware of, and I'd be more than happy to try and fix them if there are!

On a more general note, I'd really like to bump up the professionalism and accuracy of this script (once again, just for my own use but I'll share if it works well) by adding discrete FFT algorithms for average frequency detection. I'm researching into it, but I'm not a mathematical genius, and I'd prefer a lua library (some exist, typically not updated or poor documentation for a newb like me).

I might ask around in the forum, I'm pretty sure MPL and Eugene have both used FFT in their scripts (probably almost all the SWS studs have), but I know that *unfortunately* Eugene has been on a Reascript "hiatus," of sorts.

[Add., 6/14/19]

I might have hit a little luck with a post* of the X-Raym regarding a bug he encountered, as it seems to provide valuable information regarding scripting the frequency detection of samples.

*https://forum.cockos.com/showthread.php?t=213286

[ADD. 6-15-19]
Had good success implementing several new features to the script, and after some trial-and-error it seems to be working okay, too! Going to bed now, but I'm not going to post the newer version right now because I want to update the documentation to accurately reflect the changes first. Hopefully will be done tomorrow.

G'nite!

**Now, my understanding is that the key codes I used should be compatible across OS platforms.

Last edited by Dafarkias; 06-16-2019 at 07:00 AM.
Dafarkias 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 08:21 AM.


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