Old 11-08-2019, 05:51 AM   #1
klonoastudio
Human being with feelings
 
Join Date: Nov 2019
Posts: 4
Default Substitute a Word for Another on a Script?

hello everyone, I know nothing about coding. but I wanted to experimental on something. I want to be able to select all notes with the same Length on Midi editor. I got a reaper script: "SELECT ALL NOTES WITH THE SAME PITCH" I wonder If I can use that script and substitute Pitch for "SAME LENGTH" do you think I would work?
klonoastudio is offline   Reply With Quote
Old 11-08-2019, 06:17 AM   #2
domzy
Human being with feelings
 
Join Date: Feb 2017
Posts: 3,387
Default

why not try it? i doubt you'll break anything

or try the scripting forum

https://forum.cockos.com/forumdisplay.php?f=3
domzy is offline   Reply With Quote
Old 11-08-2019, 08:55 AM   #3
domzy
Human being with feelings
 
Join Date: Feb 2017
Posts: 3,387
Default

i'm not a scripter so i probably shouldn't have chipped in before, but having thought about it, i'm guessing it's not as simple as replacing some text - a pitch command is a definite note on message but a length would need a calculation (the time it takes for a note off after the note on message) - just speculation on my part though.
domzy is offline   Reply With Quote
Old 11-08-2019, 09:10 AM   #4
Lokasenna
Human being with feelings
 
Lokasenna's Avatar
 
Join Date: Sep 2008
Location: Calgary, AB, Canada
Posts: 6,551
Default

^ correct.

Which script is it? I had a quick look on ReaPack and didn't find anything matching that description.
__________________
I'm no longer using Reaper or working on scripts for it. Sorry. :(
Default 5.0 Nitpicky Edition / GUI library for Lua scripts / Theory Helper / Radial Menu / Donate
Lokasenna is offline   Reply With Quote
Old 12-02-2020, 04:08 AM   #5
pepe44
Human being with feelings
 
pepe44's Avatar
 
Join Date: Jul 2013
Location: Portugal
Posts: 1,431
Default

Could you guys lead me to a script that substitutes on word from a track name to another ?
Lets say i have 10 tracks:

ABC - Vocals1
ABC - Vocals2
ABC - Guitar 1
ABC - Guitar 2
etc...etc..

Substitute ABC for EFG all at once in one pass, for example.
Harrison mixbus has it. i think its a lua script included.
__________________
Intel core i7 6700K - socket 1151 LGA - Chipset z170 - 16G DDR4 - Nvidia GTX 1060 -Merging Anubis converter
pepe44 is offline   Reply With Quote
Old 12-02-2020, 04:15 AM   #6
pepe44
Human being with feelings
 
pepe44's Avatar
 
Join Date: Jul 2013
Location: Portugal
Posts: 1,431
Default

Found this script in reapack. Work ok for prefix words.
Script: Archie_Track; Remove prefix name of selected track.lua

Would be nice to be able to remove prefix OR rename prefix.
__________________
Intel core i7 6700K - socket 1151 LGA - Chipset z170 - 16G DDR4 - Nvidia GTX 1060 -Merging Anubis converter
pepe44 is offline   Reply With Quote
Old 12-02-2020, 02:15 PM   #7
pepe44
Human being with feelings
 
pepe44's Avatar
 
Join Date: Jul 2013
Location: Portugal
Posts: 1,431
Default

In Harrison mixbus there is a lua script that makes exactly what i was looking for.
I searched the hard drive for this script and found it.

This is the code:

Please tell me if the MIT licence allows one to change this code to another program like i am trying to do!
I dont want any problems regarding this code.

Code:
ardour {
	["type"] = "EditorAction",
	name = "Batch Rename",
	author = "Nikolaus Gullotta",
	license = "MIT",
	description = [[Removes user-defined text from track names, and replaces them (if applicable).]]
} 

function factory (params) 
	return function ()
		local dialog_options = {
			{ type = "entry", key = "text", title = "Text to be removed", default = "Audio" },
			{ type = "entry", key = "replacement", title = "Replacement text (if any)", default = "" },
		}
		local rv = LuaDialog.Dialog ("Batch Rename Tracks", dialog_options):run ()
		if not rv then return end -- cancel

		Session:save_state("(Backup) Before batch_rename")
		
		local text = rv["text"] or nil
		local repl = rv["replacement"] or ""
		
		local digest = string.gsub(text, "(%W)","%%%1") -- tags characters that are not alphanumeric for gsub to handle later
		
		for t in Session:get_tracks():iter() do
            local name = t:name()
            local new_name = string.gsub(name, digest, repl)
            t:set_name(new_name)
        end -- end for all tracks
	
	end -- end function

end --end factory
Is it possible to make this work in Reaper ?
__________________
Intel core i7 6700K - socket 1151 LGA - Chipset z170 - 16G DDR4 - Nvidia GTX 1060 -Merging Anubis converter
pepe44 is offline   Reply With Quote
Old 12-02-2020, 10:04 PM   #8
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,803
Default

Try ReaNamer.
__________________
Most of my scripts can be found in ReaPack.
If you find them useful, a donation would be greatly appreciated! Thank you! :)
amagalma is offline   Reply With Quote
Old 12-03-2020, 02:37 AM   #9
pepe44
Human being with feelings
 
pepe44's Avatar
 
Join Date: Jul 2013
Location: Portugal
Posts: 1,431
Default

Oh! That is EXCELENT!
Thanks
__________________
Intel core i7 6700K - socket 1151 LGA - Chipset z170 - 16G DDR4 - Nvidia GTX 1060 -Merging Anubis converter
pepe44 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 05:01 PM.


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