Old 11-24-2018, 11:55 AM   #1
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
Default Folderify fx.lua

https://forum.cockos.com/showpost.ph...01&postcount=2

Any tips if this exists already? It seems this did not exist yet, here a first experiment. This works only with first track so far. Use case example, take any track with more than 1 fx, e.g. 17 fx. Select this first track, run folderify_fx.lua and you will get 17 subchildren tracks, in each child track only 1 fx, in reverse order, so your original first fx will be in last subfolder track, traveling from there up, so your midi items you should place in this lowest level folder track, so the signal/notes can travel up to the highest folder. Advantages: Experimentation field. You can render from any serial node position, you can route from any serial node position. Easily. All in view, plus you get space to add/change/modify things, after each serial node. This space is missing otherwise.

Next step would be making this work from any track position. Tried a little, did not work yet. Suggestion is, take a track template, load it, folderify it, save as a new track template, use in other projects this new folderified structure. This structure allows also track selection based recordings, from any serial node position. At some point I can make a short video.

folderify_fx.lua
PHP Code:
function msg(m)
   
reaper.ShowConsoleMsg(tostring(m) .. "\n")
end

local selectedTrackCount 
reaper.CountSelectedTracks(0)
if 
selectedTrackCount 1 then
   msg
("please select a track first, thanks. And it should be the first track in project otherwise this script does not work correctly yet, hehe, TonE")
   return 
nil
end

local fromFx 
0   
local fromTrackIdx 
0
-- local fromTrack reaper.GetTrack(0,fromTrackIdx)

-- 
msg("selected track is, fromTrack: " .. fromTrack)

-- 
MediaTrack reaper.GetSelectedTrack(ReaProject projinteger seltrackidx)
-- 
Get a selected track from a project (proj=for active projectby selected track count (zero-based). This function ignores the master tracksee GetSelectedTrack2.

local fromTrack reaper.GetSelectedTrack(00) -- get selected track
local fx 
reaper.TrackFX_GetCount(fromTrack)

local i 0
local move 
1
while (fx 0) do
   
1
   
-- create a new track as last track
   
-- TrackInsert new track40001
   
-- reaper.Main_OnCommand(400010)

   -- 
Scriptme2beats_Create child track.lua
   
-- _RS68d2637109357d48b10e1ac29d681ba6e7220dd9
   reaper
.Main_OnCommand(reaper.NamedCommandLookup('_RS68d2637109357d48b10e1ac29d681ba6e7220dd9'), 0) -- Scriptme2beats_Create child track.lua

   
-- Xenakios/SWSSelect next tracks
   
-- _XENAKIOS_SELNEXTTRACK
   reaper
.Main_OnCommand(reaper.NamedCommandLookup('_XENAKIOS_SELNEXTTRACK'), 0) -- Xenakios/SWSSelect next tracks
   
   
-- integer reaper.GetNumTracks()
   
local tracks reaper.GetNumTracks()
   
local last_track tracks 1
   
-- msg("project has so many tracks: " .. tracks)

   -- 
local toTrackIdx 1
   
-- local toTrackIdx last_track
   
-- local toTrackIdx fromTrackIdx i
   
-- msg("last track: " .. last_track .. " and i: " .. i)
   
local fromTrackIdx reaper.GetMediaTrackInfo_Value(fromTrack'IP_TRACKNUMBER')
   -- 
using math.floor for converting to integer
   
-- msg("fromTrackIdx of fromTrack: " .. math.floor(fromTrackIdx))
   
local toTrackIdx -- + math.floor(fromTrackIdx)
   -- 
fx_id reaper.TrackFX_GetByName(dest_track'ReaEQ (Cockos)'false)

   
   -- 
MediaTrack reaper.GetTrack(ReaProject projinteger trackidx)
   -- 
get a track from a project by track count (zero-based) (proj=for active project)
   
local destTrack reaper.GetTrack(0,toTrackIdx)

   -- 
msg("destTrack: " .. tostring(destTrack))
   -- 
msg("so many fx track still has: " .. fx)
   -- 
msg("i: " .. i)

   -- 
reaper.TrackFX_CopyToTrack(fromTrackfromFxdestTrackreaper.TrackFX_GetCount(destTrack), move)
   -- 
Get FX name
   local ret
name reaper.TrackFX_GetFXName(fromTrackfx-1"")
   -- 
msg("fx name is: " .. name)
   
reaper.TrackFX_CopyToTrack(fromTrackfx-1destTrackreaper.TrackFX_GetCount(destTrack), move)
   
reaper.GetSetMediaTrackInfo_String(destTrack"P_NAME"nametrue) -- true is setting track namefalse is getting track name
   fx 
fx 1

   
-- security if things go wrong stopping after 140 rounds not to continue infinitely

   
if (140then
      
break
   
end
end 
A short video showing what it does.

https://www.youtube.com/watch?v=8Jbod_BCw5k

But what is it good for? If you want to create crazy machines, like stuff Vangelis is doing and switching with his foot pedals, you can do similar experiments with tools available inside Reaper, using all jsfx or pizmidi kind vst tools. You can observe the system inner details, by recording after each fx, e.g. the output, and you could reroute this component to elsewhere, another bus or midi channel and so on, just experimenting with Reaper tools for creating complex systems/tools. Or creating something like Zyklus MPS-1 Midi Performance System.


https://www.youtube.com/watch?v=GlfW...2MfElL0FS-u02q


30 years back to the future.

https://www.youtube.com/watch?v=p_iZEtGzPGU

Tools to consider (will be updated over time, suggestions are welcome):
- impyC
- ReaRack
- BlueARP, arp!0
- Midi Vocoder
- Midi Harmony (https://geraintluff.github.io/jsfx/#MIDI%20Harmony)

Last edited by TonE; 02-17-2020 at 12:08 PM. Reason: Midi Harmony added
TonE is offline   Reply With Quote
Old 03-17-2019, 12:13 PM   #2
TonE
Human being with feelings
 
Join Date: Feb 2009
Location: Reaper HAS send control via midi !!!
Posts: 4,032
Default

New version of folderify, which works for any track, hopefully. But still this is dependent on default settings for a new track, as it is using me2beats_Create child track.lua which is exactly this.

PHP Code:
-- go to next computer shop if your computer explodes because of this script
function msg(m)
   
reaper.ShowConsoleMsg(tostring(m) .. "\n")
end

local selectedTrackCount 
reaper.CountSelectedTracks(0)
if 
selectedTrackCount 1 then
   msg
("Please select a track first, thanks. Attention this script is dependent on your default settings for a new track, TonE")
   return 
nil
end

sel_tr_count 
reaper.CountSelectedTracks(0)
if 
sel_tr_count ~= nil then
    
for 1sel_tr_count do
       
local fromTrack reaper.GetSelectedTrack(0j-1)
       if 
fromTrack ~= nil then
          
-- do something
          local fx 
reaper.TrackFX_GetCount(fromTrack)
          
local i 0
          local move 
1
          
while (fx 0) do
             
1
             reaper
.Main_OnCommand(reaper.NamedCommandLookup('_RS68d2637109357d48b10e1ac29d681ba6e7220dd9'), 0) -- Scriptme2beats_Create child track.lua
             reaper
.Main_OnCommand(reaper.NamedCommandLookup('_XENAKIOS_SELNEXTTRACK'), 0) -- Xenakios/SWSSelect next tracks
             local fromTrackIdx 
reaper.GetMediaTrackInfo_Value(fromTrack'IP_TRACKNUMBER')
             --
msg("fromTrackIdx: " .. math.floor(fromTrackIdx))
             
local toTrackIdx math.floor(fromTrackIdx) - 1
             
--msg("toTrackIdx: " .. toTrackIdx)

             -- 
MediaTrack reaper.GetTrack(ReaProject projinteger trackidx)
             -- 
get a track from a project by track count (zero-based) (proj=for active project)
             
local destTrack reaper.GetTrack(0,toTrackIdx)

             -- 
Get FX name
             local ret
name reaper.TrackFX_GetFXName(fromTrackfx-1"")
             
reaper.TrackFX_CopyToTrack(fromTrackfx-1destTrackreaper.TrackFX_GetCount(destTrack), move)
             
reaper.GetSetMediaTrackInfo_String(destTrack"P_NAME"nametrue) -- true is setting track namefalse is getting track name
             fx 
fx 1

             
-- security if things go wrong stopping after 140 rounds not to continue infinitely
             
if (140then
                
break
             
end
          end
       end
    end
end 
TonE 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 07:42 AM.


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