Old 01-07-2022, 01:56 PM   #2681
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Quote:
Originally Posted by loreto.z View Post
Ok, I got it to work somewhat. I got the fx icon in the midi editor tool bar,so far so good, but on the midi items that have their own fx assigned it will not open that fx.Problem is it opens up the track´s FX and not the midi item´s FX. I have some tracks with fx that control the midi items within, and that´s when it works, but I have tracks that only have the fx chosen in each midi item within other tracks, and in those midi editor toolbars the fx icon does nothing.
Holy moly I hope I am explaining myself correctly.

Can I upload a video showing what I mean? Is there a size limit that the video can be?
my script exploring closer FX marked as instrument up to the tree. Sorry, I didn't get what you are trying to do and which fx specifically don't float for you you supposed to be floating.
mpl is offline   Reply With Quote
Old 01-07-2022, 02:00 PM   #2682
loreto.z
Human being with feelings
 
loreto.z's Avatar
 
Join Date: Nov 2021
Location: south of Spain
Posts: 29
Default

Quote:
Originally Posted by mpl View Post
my script exploring closer FX marked as instrument up to the tree. Sorry, I didn't get what you are trying to do and which fx specifically don't float for you you supposed to be floating.
No fx will float from midi editor if fx is marked in midi item, if fx is marked in main track header then it will float that fx
loreto.z is offline   Reply With Quote
Old 01-07-2022, 02:36 PM   #2683
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Quote:
Originally Posted by loreto.z View Post
No fx will float from midi editor if fx is marked in midi item, if fx is marked in main track header then it will float that fx
Do I get you right? You want the script start tree searching from take FX, then search track FX and upper (parent tracks in the structure)?
mpl is offline   Reply With Quote
Old 01-07-2022, 02:39 PM   #2684
loreto.z
Human being with feelings
 
loreto.z's Avatar
 
Join Date: Nov 2021
Location: south of Spain
Posts: 29
Default

Quote:
Originally Posted by mpl View Post
Do I get you right? You want the script start tree searching from take FX, then search track FX and upper (parent tracks in the structure)?
I just need to open fx in midi editor, yes
if I can make video I will show you, but I am having problems making video, will not recognize mic in sharex
loreto.z is offline   Reply With Quote
Old 01-09-2022, 05:14 AM   #2685
Dragonetti
Human being with feelings
 
Join Date: Feb 2017
Location: Kiel
Posts: 974
Default

Is it possible to get this data (Archies counter timer) into the Media Explorer?
Perhaps someone knows a trick, such as how to temporarily overwrite the Project Notes.
or with a user column
Thanks
Dragonetti is offline   Reply With Quote
Old 01-09-2022, 08:25 AM   #2686
loreto.z
Human being with feelings
 
loreto.z's Avatar
 
Join Date: Nov 2021
Location: south of Spain
Posts: 29
Default

Quote:
Originally Posted by loreto.z View Post
I just need to open fx in midi editor, yes
if I can make video I will show you, but I am having problems making video, will not recognize mic in sharex
I have made a very short video but when I try to upload it I get this message..
(Your submission could not be processed because a security token was missing.

If this occurred unexpectedly, please inform the administrator and describe the action you performed before you received this error.)
Lets see if the administrator can help
loreto.z is offline   Reply With Quote
Old 01-15-2022, 11:29 AM   #2687
loreto.z
Human being with feelings
 
loreto.z's Avatar
 
Join Date: Nov 2021
Location: south of Spain
Posts: 29
Default

Quote:
Originally Posted by loreto.z View Post
I have made a very short video but when I try to upload it I get this message..
(Your submission could not be processed because a security token was missing.

If this occurred unexpectedly, please inform the administrator and describe the action you performed before you received this error.)
Lets see if the administrator can help
Yes I have done so, but I have recieved no reply
loreto.z is offline   Reply With Quote
Old 01-16-2022, 04:57 PM   #2688
sly
Human being with feelings
 
Join Date: Feb 2009
Location: Denmark
Posts: 111
Default Script request: Group humanizer jsfx

Hello bright minds,


Ableton Live users have access to a m4l-plugin called "Group Humanizer"(https://www.maxforlive.com/library/d...roup-humanizer). It allows for MIDI notes to be dynamically humanized in relation to each other, thereby approximating the timing negotitioan that happens when humans are playing together.


I think such a plugin is massively useful, but unfortunately I do not use Live in my workflow. Luckily someone has made a puredata port of the original project: https://github.com/enricguso/group_humanizer


This is great! But unlikely the m4l device which would work as a MIDI effect, the pd version is designed to be connected to the DAW via virtual MIDI cables such as loopmidi or loop2be. This works but is quite cumbersome to use, and it can cause issues with MIDI jitter.


I have tried to run the pd patch as a VST via Camomile (https://github.com/pierreguillot/Camomile) but no luck.


Could it be made relatively easy as a JSFX? The m4l and pd patches are there to use as inspiration, and in the repo of the pd version, there is a document that describes the math behind the algorithm.


If this would be an easy and/or interesting task for one of you talented people - oh my, it would be a boon!


Kind regards
sly
sly is offline   Reply With Quote
Old 01-21-2022, 05:43 AM   #2689
TorlanDelta
Human being with feelings
 
Join Date: Jul 2019
Posts: 30
Default

Hello!

I was trying to write a script that takes a focused floating FX and pushes it up or down (two separate actions) in the pin connectors. So, say, I have a ReaEQ that has Inputs on 1 and 2, Outputs on 3 and 4. I'd like to have an action that would move Inputs to 3 and 4, and Outputs to 5 and 6. And the opposite action.

If you'd run "Channels up" from the original position, it'd keep the inputs on 1 and 2, and move outputs to 1 and 2 as well.

I've kinda figured out the necessary API calls and stuff, but I'm very confused with the bitmasks, I've never worked with those. Combine that with the fact that I'm not too positive on how lua data types work, and there's no surprise I'm asking you for help with this :c

I'd greatly appreciate this! It would fit really well with kawa's TrackFX routing matrix, that, as is, requires you to click all 4 channels through manually (and not get confused midway).
TorlanDelta is offline   Reply With Quote
Old 01-22-2022, 02:07 PM   #2690
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

Quote:
Originally Posted by TorlanDelta View Post
Hello!

I was trying to write a script that takes a focused floating FX and pushes it up or down (two separate actions) in the pin connectors. So, say, I have a ReaEQ that has Inputs on 1 and 2, Outputs on 3 and 4. I'd like to have an action that would move Inputs to 3 and 4, and Outputs to 5 and 6. And the opposite action.

If you'd run "Channels up" from the original position, it'd keep the inputs on 1 and 2, and move outputs to 1 and 2 as well.

I've kinda figured out the necessary API calls and stuff, but I'm very confused with the bitmasks, I've never worked with those. Combine that with the fact that I'm not too positive on how lua data types work, and there's no surprise I'm asking you for help with this :c

I'd greatly appreciate this! It would fit really well with kawa's TrackFX routing matrix, that, as is, requires you to click all 4 channels through manually (and not get confused midway).
Very rough example of lua Shift focused FX IO pins 2 channel further:

Code:
  function main()
     retval, tracknumber, itemnumber, fxnumber = reaper.GetFocusedFX()
    if not retval then return end
     track =  reaper.CSurf_TrackFromID( tracknumber, false )
     retval, inputPins, outputPins = reaper.TrackFX_GetIOSize( track, fxnumber )
    for pin = 0, inputPins do
      local low32bits, hi32bits  = reaper.TrackFX_GetPinMappings( track, fxnumber, 0, pin )
      reaper.TrackFX_SetPinMappings( track, fxnumber, 0, pin, low32bits<<2, hi32bits<<2 )
    end    
    for pin = 0, outputPins do
      local low32bits, hi32bits  = reaper.TrackFX_GetPinMappings( track, fxnumber, 1, pin )
      reaper.TrackFX_SetPinMappings( track, fxnumber, 1, pin, low32bits<<2, hi32bits<<2 )
    end
  end 
  
  main()
mpl is offline   Reply With Quote
Old 01-23-2022, 12:00 AM   #2691
TorlanDelta
Human being with feelings
 
Join Date: Jul 2019
Posts: 30
Default

Quote:
Originally Posted by mpl View Post
Very rough example of lua Shift focused FX IO pins 2 channel further:

Code:
  function main()
     retval, tracknumber, itemnumber, fxnumber = reaper.GetFocusedFX()
    if not retval then return end
     track =  reaper.CSurf_TrackFromID( tracknumber, false )
     retval, inputPins, outputPins = reaper.TrackFX_GetIOSize( track, fxnumber )
    for pin = 0, inputPins do
      local low32bits, hi32bits  = reaper.TrackFX_GetPinMappings( track, fxnumber, 0, pin )
      reaper.TrackFX_SetPinMappings( track, fxnumber, 0, pin, low32bits<<2, hi32bits<<2 )
    end    
    for pin = 0, outputPins do
      local low32bits, hi32bits  = reaper.TrackFX_GetPinMappings( track, fxnumber, 1, pin )
      reaper.TrackFX_SetPinMappings( track, fxnumber, 1, pin, low32bits<<2, hi32bits<<2 )
    end
  end 
  
  main()
Omg thank you so much! Haha, I have almost worked out how bitwise & and shifts work, but I didn't know how to make sure the shift stays in bounds!

Why is it that you used CSurf_TrackFromID, and not GetTrack? My (not finished) code used GetTrack(0, tracknumber-1) and it appeared to be effective..

Now I'm going to try and code the "Up by 2 pins" myself, and deepen my understanding of bitwise stuff in the process! Thank you so much!


EDIT: Ok, I've completed the "FXPinsDown" action, added the loopback code that resets the pins in case they are lost. (it only works up to 32 bits, I've found your code from https://forum.cockos.com/showthread.php?t=219958 here, but I probably won't implement it because TrackFX's script supports up to 32 channels anyway (and I don't know how lmao).

Code:
    --only works up to 32 bits for now because so does TrackFX, also kinda hard  to shift stuff from low to high
  function main()
      retval, tracknumber, itemnumber, fxnumber = reaper.GetFocusedFX()
      if not retval then return end
      
      track =  reaper.CSurf_TrackFromID( tracknumber, false )
      
      --Let's check if we have enough channels and add some?
      numOfChannels = math.min( reaper.GetMediaTrackInfo_Value(track, "I_NCHAN"), 32 )
      --
      retval, inputPins, outputPins = reaper.TrackFX_GetIOSize( track, fxnumber )
      for pin = 0, inputPins-1 do
        local low32bits, hi32bits  = reaper.TrackFX_GetPinMappings( track, fxnumber, 0, pin )
        if low32bits+hi32bits==0 then 
          --Spawning typical ladder thing (idk how to send "reset I/O")
          reaper.TrackFX_SetPinMappings( track, fxnumber, 0, pin, 2^pin, 0 )
        else
          reaper.TrackFX_SetPinMappings( track, fxnumber, 0, pin, low32bits<<2, hi32bits<<2 )
          --calc minimum needed channels to perform this to update UI
          local numNeeded = math.floor(math.log(low32bits<<2,2))
          --if numNeeded % 2 ~= 0 then numNeeded=numNeeded+1 end
          if numNeeded >numOfChannels then 
            reaper.SetMediaTrackInfo_Value(track, "I_NCHAN", numOfChannels+2)
            numOfChannels=numOfChannels+2
          end
        end
      end    
      for pin = 0, outputPins-1 do
        local low32bits, hi32bits  = reaper.TrackFX_GetPinMappings( track, fxnumber, 1, pin )
        --reaper.ShowMessageBox(tostring(low32bits)+tostring(hi32bits), "test", 0)
        if low32bits+hi32bits==0 then 
          --Spawning typical ladder thing (idk how to send "reset I/O")
          reaper.TrackFX_SetPinMappings( track, fxnumber, 1, pin, 2^pin, 0 )
        else
          reaper.TrackFX_SetPinMappings( track, fxnumber, 1, pin, low32bits<<2, hi32bits<<2 )
          --calc minimum needed channels to perform this to update UI
          local numNeeded = math.floor(math.log(low32bits<<2,2))
          --if numNeeded % 2 ~= 0 then numNeeded=numNeeded+1 end
          if numNeeded >numOfChannels then 
            reaper.SetMediaTrackInfo_Value(track, "I_NCHAN", numOfChannels+2)
            numOfChannels=numOfChannels+2
          end
        end
      end
  end 
    
 
  main()
Decided not to add loopback to code for "FXPinsUP" because no matter the settings, the channel amount stays at 64 and they would loop outside of view in most cases. I rarely even use it anyway. But I am going to make it so that when you spam "FXPinsUP" when there are no pins, it will reduce the amount of channels by 2 each time. I'd find it handy.

EDIT 2:
Here I have it just in case anyone else finds it useful! I LOVE being able to control my FX chain with simple WASD + modifiers. I have also made a version of these scripts that move only the output (to have absolute control!!) and now I'm going to make a script that moves focused FX up or down the chain itself..
Code:
function main()
     retval, tracknumber, itemnumber, fxnumber = reaper.GetFocusedFX()
     if not retval then return end
     track =  reaper.CSurf_TrackFromID( tracknumber, false )
     --We'll use this number to reduce channel amount in case no other change necessary
     numOfChannels = math.min( reaper.GetMediaTrackInfo_Value(track, "I_NCHAN"), 32 )
     isGridEmpty = true
     retval, inputPins, outputPins = reaper.TrackFX_GetIOSize( track, fxnumber )
     for pin = 0, inputPins-1 do
      local low32bits, hi32bits  = reaper.TrackFX_GetPinMappings( track, fxnumber, 0, pin )
      if low32bits+hi32bits ~= 0 then
        reaper.TrackFX_SetPinMappings( track, fxnumber, 0, pin, low32bits>>2, hi32bits>>2 )
        isGridEmpty = false
      end
     end 
     
     for pin = 0, outputPins-1 do
      local low32bits, hi32bits  = reaper.TrackFX_GetPinMappings( track, fxnumber, 1, pin )
      if low32bits+hi32bits ~= 0 then
        reaper.TrackFX_SetPinMappings( track, fxnumber, 1, pin, low32bits>>2, hi32bits>>2 )
        isGridEmpty = false
      end
     end
     
     --if the grid was empty all along - let's reduce channel amount - it's what He wanted (the cow)
     if isGridEmpty then reaper.SetMediaTrackInfo_Value(track, "I_NCHAN", math.max(2, numOfChannels-2)) end
  end 
  
  main()
EDIT3: and yes, I've made it and I'm stopping my spamming spree. Here's the code for the Focused Floating FX moving down the chain.

Code:
function main()
  retval, tracknumber, itemnumber, fxnumber = reaper.GetFocusedFX()
  if not retval then return end
  track =  reaper.CSurf_TrackFromID( tracknumber, false )
  target = fxnumber
  target = target + 1
  reaper.TrackFX_CopyToTrack(track, fxnumber, track, target, true)
end
main()
All in all, I can do this now: https://imgur.com/a/YoPPIuo

Last edited by TorlanDelta; 01-23-2022 at 10:41 AM.
TorlanDelta is offline   Reply With Quote
Old 01-25-2022, 01:00 PM   #2692
Loulou92
Human being with feelings
 
Loulou92's Avatar
 
Join Date: Sep 2015
Location: Paris
Posts: 544
Default cut / paste selected track sends and associated automation items

Hello

I'm looking for a pair of script that work together :

-cut selected track sends and its sends envelope content if any (automation items)
-paste saved sends and envelope content to the selected track

I'm pretty sure it's not possible to do with action or already existing script right now...

It would be useful for me to quickly cleanly transfer sends from one track to another track, transfering also every automation item (volume and mute mainly) that are related to the sends. It seems trivial I know, but right now, to do it manually it takes me 3-5 minutes each time. You have to do lots of actions to get a proper "send transfer" from one track to another. It can be very tedious if I'm a t the end of a mix and I have lots of automation and sends to transfer manually.

Hopefully that is do-able via script ?
Have a nice day !
xxxxxxxxx

Last edited by Loulou92; 01-27-2022 at 02:49 PM.
Loulou92 is offline   Reply With Quote
Old 01-27-2022, 01:07 PM   #2693
clepsydrae
Human being with feelings
 
clepsydrae's Avatar
 
Join Date: Nov 2011
Posts: 3,409
Default stop play cursor and keep position

Hi scripters!

I want to hit space bar, have transport stop, and have the cursor stay where it is.

I'm aware of play/pause, and that's what I use all the time, but pausing has some plugin-related ramifications that I don't like, so I'd like a "true" stop-and-keep-position method.

If transport is stopped, space bar just starts playback.

If transport is active, space bar stops the cursor at the current location and keeps it there.

Seems like it'd be pretty easy to do?

I thought to do it with a custom action, e.g. pause, store cursor location using Xenakios' SWS action, stop, return cursor to stored location... but I don't know how to toggle that based on transport state (i.e. what happens when starting playback.)
clepsydrae is offline   Reply With Quote
Old 01-27-2022, 01:29 PM   #2694
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,970
Default

Quote:
Originally Posted by clepsydrae View Post
I thought to do it with a custom action, e.g. pause, store cursor location using Xenakios' SWS action, stop, return cursor to stored location... but I don't know how to toggle that based on transport state (i.e. what happens when starting playback.)
That bit of logic can be done with a SWS Cycle Action:

cfillion is offline   Reply With Quote
Old 01-27-2022, 01:47 PM   #2695
clepsydrae
Human being with feelings
 
clepsydrae's Avatar
 
Join Date: Nov 2011
Posts: 3,409
Default

Thanks! Out of curiosity, I tried to make this myself... any obvious mistake? It's not working:

Code:
function playstop()
  if (reaper.GetPlayState()&1) then
    reaper.Main_OnCommand(1008, 0) --Transport: Pause
    cur_pos = reaper.GetPlayPosition()
    reaper.Main_OnCommand(1016, 0) --Transport: Stop
    reaper.MoveEditCursor(cur_pos, false)
  else
    reaper.Main_OnCommand(1007, 0) --Transport: Play
  end
end

reaper.defer(playstop())
When I run via IDE it just moves the cursor forward a regular distance every time. When I run via action menu nothing happens.
clepsydrae is offline   Reply With Quote
Old 01-27-2022, 01:53 PM   #2696
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,970
Default

In Lua everything except nil and false is truthy, so reaper.GetPlayState()&1 is always true even if it's 0. The condition should explicitly check for a non-zero value:

Code:
reaper.GetPlayState() & 1 ~= 0
Running from the action list is disabled when it's being edited in the IDE. Also that defer call does nothing as playstop is called immediately rather than given as an argument to reaper.defer.

Code:
if reaper.GetPlayState() & 1 ~= 0 then
  local cur_pos = reaper.GetPlayPosition()
  reaper.Main_OnCommand(1016, 0) -- Transport: Stop
  reaper.SetEditCurPos(cur_pos, false, false)
else
  reaper.Main_OnCommand(1007, 0) -- Transport: Play
end

Last edited by cfillion; 01-27-2022 at 02:01 PM.
cfillion is offline   Reply With Quote
Old 01-27-2022, 02:05 PM   #2697
clepsydrae
Human being with feelings
 
clepsydrae's Avatar
 
Join Date: Nov 2011
Posts: 3,409
Default

D'oh of course, thanks, and thanks for SetEditCursorPos which I confused with MoveEditCursor.

Quote:
Also that defer call does nothing as playstop is called immediately rather than given as an argument to reaper.defer.
Ah right. But don't I want to "prevent an undo point", at least as done in many examples I've seen? This is what I have now:

Code:
function playstop()
  if (reaper.GetPlayState()&1 == 1) then
    reaper.Main_OnCommand(1008, 0) --Transport: Pause
    cur_pos = reaper.GetPlayPosition()
    reaper.Main_OnCommand(1016, 0) --Transport: Stop
    reaper.SetEditCurPos(cur_pos, false, false)
  else
    reaper.Main_OnCommand(1007, 0) --Transport: Play
  end
end

reaper.defer(playstop)
clepsydrae is offline   Reply With Quote
Old 01-27-2022, 02:42 PM   #2698
Loulou92
Human being with feelings
 
Loulou92's Avatar
 
Join Date: Sep 2015
Location: Paris
Posts: 544
Default


i use this if it can help, works great 4 me.
Loulou92 is offline   Reply With Quote
Old 01-27-2022, 03:20 PM   #2699
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 4,970
Default

Quote:
Originally Posted by clepsydrae View Post
But don't I want to "prevent an undo point", at least as done in many examples I've seen?
The old trick to disable the implicit non-descript "ReaScript: Run" undo point usually is deferring an empty function:

Code:
doSomething() -- do the work immediately

-- then defer an empty function to be run ~33ms later
-- disabling the implicit undo point as a side effect
reaper.defer(function() end)
A better solution is using Undo_BeginBlock/Undo_EndBlock. The undo point is created only if the project changed and following the user's undo preferences.

https://forum.cockos.com/showthread.php?p=2084802

Code:
reaper.Undo_BeginBlock()

if reaper.GetPlayState() & 1 ~= 0 then
  local cur_pos = reaper.GetPlayPosition()
  reaper.Main_OnCommand(1016, 0) -- Transport: Stop
  reaper.SetEditCurPos(cur_pos, false, false)
else
  reaper.Main_OnCommand(1007, 0) -- Transport: Play
end

reaper.Undo_EndBlock("Play/stop (move edit cursor to play position)", 0)
cfillion is offline   Reply With Quote
Old 01-27-2022, 04:09 PM   #2700
clepsydrae
Human being with feelings
 
clepsydrae's Avatar
 
Join Date: Nov 2011
Posts: 3,409
Default

Many thanks for the help!
clepsydrae is offline   Reply With Quote
Old 02-02-2022, 05:09 PM   #2701
Vincent Sermonne
Petit manitou
 
Vincent Sermonne's Avatar
 
Join Date: Feb 2009
Location: Mars
Posts: 7,356
Default JS cymbal choke for Reasamplomatic

Hello ! I would like a JS for my drum sample bank with Reasamplomatic that could mute the eDrum cymbals by their aftertouch pressure. Like the hihat JS or the choke JS but with the cymbal mute control triggered by the aftertouch.
__________________
Vincent
http://www.tchackpoum.fr
Vincent Sermonne is offline   Reply With Quote
Old 02-08-2022, 02:48 AM   #2702
Loulou92
Human being with feelings
 
Loulou92's Avatar
 
Join Date: Sep 2015
Location: Paris
Posts: 544
Default Sendcrossfader

Forum user Twenty9 posted this fx in 2008 in the forum. It's a tool that enables a crossfade between two sends. Now I wondered if there exists a tool to crossfade between more sends. I'd need a tool that allow an equal power crossfade betwwen 5 sends.

Maybe someone could mod the Twenty9 FX to have more sends to crossfade to ?

Here is the thread with the FX :

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


thank you
Loulou92 is offline   Reply With Quote
Old 02-13-2022, 01:16 PM   #2703
Loulou92
Human being with feelings
 
Loulou92's Avatar
 
Join Date: Sep 2015
Location: Paris
Posts: 544
Default Add receives of selected track(s) to the current track selection

Hello !

I'd like to request a script that adds the receives of the selected track(s) to the track selection.

So basically when you have one track (or several tracks) selected & you launch this script, it would add to the current track selection, all the tracks (if any) that are sending something (audio or midi) to the currently selected tracks.

I'm pretty sure there is nothing in the action list right now to do this.
Would be very useful for a cycle action I'm working on.

Thanks
xxxxxxxx
Louis
Loulou92 is offline   Reply With Quote
Old 02-13-2022, 01:37 PM   #2704
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 612
Default

Quote:
Originally Posted by Loulou92 View Post
Hello !

I'd like to request a script that adds the receives of the selected track(s) to the track selection.

So basically when you have one track (or several tracks) selected & you launch this script, it would add to the current track selection, all the tracks (if any) that are sending something (audio or midi) to the currently selected tracks.

I'm pretty sure there is nothing in the action list right now to do this.
Would be very useful for a cycle action I'm working on.

Thanks
xxxxxxxx
Louis
Need more technical specifications, I think. To describe more precisely:
1) If one or more tracks are selected, create sends (or reсeives, depending on which side you look at) from all the remaining tracks. Did I understand correctly?
2) If I understand correctly, what exactly parameters should contain these sends or receives? There are many parameters among them - stereo and mono channels, etc. for audio sends, channel number for midi sends. If different parameters are needed, then how to implement their choice?
3) It is not clear which track should send a signal to which
Thanks!
Yanick is offline   Reply With Quote
Old 02-13-2022, 01:51 PM   #2705
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 612
Default

Quote:
Originally Posted by Loulou92 View Post
Hello !

I'd like to request a script that adds the receives of the selected track(s) to the track selection.

So basically when you have one track (or several tracks) selected & you launch this script, it would add to the current track selection, all the tracks (if any) that are sending something (audio or midi) to the currently selected tracks.

I'm pretty sure there is nothing in the action list right now to do this.
Would be very useful for a cycle action I'm working on.

Thanks
xxxxxxxx
Louis
Or should the script not create any sends? But should select all tracks that have any receives while not deselecting any other tracks that have been selected
Yanick is offline   Reply With Quote
Old 02-13-2022, 02:33 PM   #2706
Loulou92
Human being with feelings
 
Loulou92's Avatar
 
Join Date: Sep 2015
Location: Paris
Posts: 544
Default

Quote:
Originally Posted by Yanick View Post
Or should the script not create any sends? But should select all tracks that have any receives while not deselecting any other tracks that have been selected
Ok sorry, my explanation is wonky. so actually the script would consider the currently selected track(s). It would look if these track(s) have receives. If it finds receives, the script would find the tracks from where these receives are from, and select them, along with the track selection that was here before the script was used.

It's just a script that goes in the project to find the tracks that are sending something to the selected track(s).

But actually now that I think about it, it should not look for parent send / child receive and rather only look for sends and receives configured manually in the IO window of the track. Because if the script also consider the "parent send" (the tick box top left of routing window) this script would end up selecting the children of the currently selected tracks, and it's not really what I'm after. I mean, that could be a very interesting option to get in the script, as it could serve a purpose in another situation than the one I'm in. But if possible, I'd like to target all receives BUT children ones.

Last edited by Loulou92; 02-13-2022 at 02:38 PM.
Loulou92 is offline   Reply With Quote
Old 02-14-2022, 05:54 AM   #2707
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 612
Default

Quote:
Originally Posted by Loulou92 View Post
Ok sorry, my explanation is wonky. so actually the script would consider the currently selected track(s). It would look if these track(s) have receives. If it finds receives, the script would find the tracks from where these receives are from, and select them, along with the track selection that was here before the script was used.

It's just a script that goes in the project to find the tracks that are sending something to the selected track(s).

But actually now that I think about it, it should not look for parent send / child receive and rather only look for sends and receives configured manually in the IO window of the track. Because if the script also consider the "parent send" (the tick box top left of routing window) this script would end up selecting the children of the currently selected tracks, and it's not really what I'm after. I mean, that could be a very interesting option to get in the script, as it could serve a purpose in another situation than the one I'm in. But if possible, I'd like to target all receives BUT children ones.
Try this

Code:
function bla() end function nothing() reaper.defer(bla) end

local test_SWS = reaper.CF_EnumerateActions
if not test_SWS then
  reaper.MB('Please install or update SWS extension', 'Error', 0) nothing() return
end

if reaper.CountSelectedTracks(0) == 0 then
  nothing() return
end

reaper.Undo_BeginBlock()
reaper.PreventUIRefresh(1)

for i=0, reaper.CountSelectedTracks(0)-1 do
  local track = reaper.GetSelectedTrack(0,i)
  if reaper.GetTrackNumSends(track, -1) > 0 then
    for i2=0, reaper.GetTrackNumSends(track, -1)-1 do
      local receive_track = reaper.BR_GetMediaTrackSendInfo_Track( track, -1, i2, 0)
      if reaper.IsTrackSelected(receive_track) == false then
        reaper.SetTrackSelected(receive_track, true)
      end
    end
  end
end

reaper.PreventUIRefresh(-1)
reaper.Undo_EndBlock("Select all tracks with receives to selected tracks", -1)
Yanick is offline   Reply With Quote
Old 02-14-2022, 06:03 AM   #2708
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 612
Default

Quote:
Originally Posted by Loulou92 View Post
Ok sorry, my explanation is wonky. so actually the script would consider the currently selected track(s). It would look if these track(s) have receives. If it finds receives, the script would find the tracks from where these receives are from, and select them, along with the track selection that was here before the script was used.

It's just a script that goes in the project to find the tracks that are sending something to the selected track(s).

But actually now that I think about it, it should not look for parent send / child receive and rather only look for sends and receives configured manually in the IO window of the track. Because if the script also consider the "parent send" (the tick box top left of routing window) this script would end up selecting the children of the currently selected tracks, and it's not really what I'm after. I mean, that could be a very interesting option to get in the script, as it could serve a purpose in another situation than the one I'm in. But if possible, I'd like to target all receives BUT children ones.
Although it looks like this script will be more correct

Code:
function bla() end function nothing() reaper.defer(bla) end

local test_SWS = reaper.CF_EnumerateActions
if not test_SWS then
  reaper.MB('Please install or update SWS extension', 'Error', 0) nothing() return
end

if reaper.CountSelectedTracks(0) == 0 then
  nothing() return
end

reaper.Undo_BeginBlock()
reaper.PreventUIRefresh(1)

local t_tracks = {}

for i=0, reaper.CountSelectedTracks(0)-1 do
  t_tracks[#t_tracks+1] = reaper.GetSelectedTrack(0,i)
end

for i=1, #t_tracks do
  if reaper.GetTrackNumSends(t_tracks[i], -1) > 0 then
    for i2=0, reaper.GetTrackNumSends(t_tracks[i], -1)-1 do
      local receive_track = reaper.BR_GetMediaTrackSendInfo_Track(t_tracks[i], -1, i2, 0)
      if reaper.IsTrackSelected(receive_track) == false then
        reaper.SetTrackSelected(receive_track, true)
      end
    end
  end
end

reaper.PreventUIRefresh(-1)
reaper.Undo_EndBlock("Select all tracks with receives to selected tracks", -1)
Yanick is offline   Reply With Quote
Old 02-14-2022, 07:39 AM   #2709
Loulou92
Human being with feelings
 
Loulou92's Avatar
 
Join Date: Sep 2015
Location: Paris
Posts: 544
Default

Quote:
Originally Posted by Yanick View Post
Although it looks like this script will be more correct

Code:
function bla() end function nothing() reaper.defer(bla) end

local test_SWS = reaper.CF_EnumerateActions
if not test_SWS then
  reaper.MB('Please install or update SWS extension', 'Error', 0) nothing() return
end

if reaper.CountSelectedTracks(0) == 0 then
  nothing() return
end

reaper.Undo_BeginBlock()
reaper.PreventUIRefresh(1)

local t_tracks = {}

for i=0, reaper.CountSelectedTracks(0)-1 do
  t_tracks[#t_tracks+1] = reaper.GetSelectedTrack(0,i)
end

for i=1, #t_tracks do
  if reaper.GetTrackNumSends(t_tracks[i], -1) > 0 then
    for i2=0, reaper.GetTrackNumSends(t_tracks[i], -1)-1 do
      local receive_track = reaper.BR_GetMediaTrackSendInfo_Track(t_tracks[i], -1, i2, 0)
      if reaper.IsTrackSelected(receive_track) == false then
        reaper.SetTrackSelected(receive_track, true)
      end
    end
  end
end

reaper.PreventUIRefresh(-1)
reaper.Undo_EndBlock("Select all tracks with receives to selected tracks", -1)
So I tried the second version of the script and it is perfect. Thank you so much ! May I ask for an alternative version that unselect the initial track selection, and ends up with only the receives selected (or no track selected if no receives are detected) ?
Loulou92 is offline   Reply With Quote
Old 02-14-2022, 08:25 AM   #2710
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 612
Default

Quote:
Originally Posted by Loulou92 View Post
So I tried the second version of the script and it is perfect. Thank you so much ! May I ask for an alternative version that unselect the initial track selection, and ends up with only the receives selected (or no track selected if no receives are detected) ?
Yes, I'll do it now
Yanick is offline   Reply With Quote
Old 02-14-2022, 08:35 AM   #2711
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 612
Default

Quote:
Originally Posted by Loulou92 View Post
So I tried the second version of the script and it is perfect. Thank you so much ! May I ask for an alternative version that unselect the initial track selection, and ends up with only the receives selected (or no track selected if no receives are detected) ?
Try this

Code:
function bla() end function nothing() reaper.defer(bla) end

local test_SWS = reaper.CF_EnumerateActions
if not test_SWS then
  reaper.MB('Please install or update SWS extension', 'Error', 0) nothing() return
end

if reaper.CountSelectedTracks(0) == 0 then
  nothing() return
end

reaper.Undo_BeginBlock()
reaper.PreventUIRefresh(1)

local t_tracks = {}

for i=0, reaper.CountSelectedTracks(0)-1 do
  t_tracks[#t_tracks+1] = reaper.GetSelectedTrack(0,i)
end

for i=1, #t_tracks do
  if reaper.GetTrackNumSends(t_tracks[i], -1) > 0 then
    for i2=0, reaper.GetTrackNumSends(t_tracks[i], -1)-1 do
      reaper.SetTrackSelected(t_tracks[i], false)
      local receive_track = reaper.BR_GetMediaTrackSendInfo_Track(t_tracks[i], -1, i2, 0)
      if reaper.IsTrackSelected(receive_track) == false then
        reaper.SetTrackSelected(receive_track, true)
      end
    end
  end
end

reaper.PreventUIRefresh(-1)
reaper.Undo_EndBlock("Select all tracks with receives to selected tracks (unselect original tracks)", -1)
Yanick is offline   Reply With Quote
Old 02-14-2022, 09:10 AM   #2712
Loulou92
Human being with feelings
 
Loulou92's Avatar
 
Join Date: Sep 2015
Location: Paris
Posts: 544
Default

Quote:
Originally Posted by Yanick View Post
Try this

Code:
function bla() end function nothing() reaper.defer(bla) end

local test_SWS = reaper.CF_EnumerateActions
if not test_SWS then
  reaper.MB('Please install or update SWS extension', 'Error', 0) nothing() return
end

if reaper.CountSelectedTracks(0) == 0 then
  nothing() return
end

reaper.Undo_BeginBlock()
reaper.PreventUIRefresh(1)

local t_tracks = {}

for i=0, reaper.CountSelectedTracks(0)-1 do
  t_tracks[#t_tracks+1] = reaper.GetSelectedTrack(0,i)
end

for i=1, #t_tracks do
  if reaper.GetTrackNumSends(t_tracks[i], -1) > 0 then
    for i2=0, reaper.GetTrackNumSends(t_tracks[i], -1)-1 do
      reaper.SetTrackSelected(t_tracks[i], false)
      local receive_track = reaper.BR_GetMediaTrackSendInfo_Track(t_tracks[i], -1, i2, 0)
      if reaper.IsTrackSelected(receive_track) == false then
        reaper.SetTrackSelected(receive_track, true)
      end
    end
  end
end

reaper.PreventUIRefresh(-1)
reaper.Undo_EndBlock("Select all tracks with receives to selected tracks (unselect original tracks)", -1)
Yes, it's perfect. Thanks again for taking the time. I'll donate asap.
xxxxxxxxxxx
Louis
Loulou92 is offline   Reply With Quote
Old 02-14-2022, 11:53 AM   #2713
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 612
Default

Quote:
Originally Posted by Loulou92 View Post
Thanks again for taking the time.
If something goes wrong, please write
Yanick is offline   Reply With Quote
Old 02-15-2022, 12:58 PM   #2714
Loulou92
Human being with feelings
 
Loulou92's Avatar
 
Join Date: Sep 2015
Location: Paris
Posts: 544
Default

Behind the scene, Yanick also designed a duo of script :


Script: Yanick_Offline all FX from selected tracks - save previous_slot_n.lua
Script: Yanick_Offline all FX from selected tracks - restore previous_slot_n.lua

you can't break the behavior of the script, even if you try hard
datas are saved within the .rpp
you have infinite slots

this is a *killer script* for CPU mgmt. If you don't know, now you know ! Expect it to drop in Reapack soon. Donate to Yanick.

xxxxxxxxx

Last edited by Loulou92; 02-15-2022 at 01:26 PM.
Loulou92 is offline   Reply With Quote
Old 02-15-2022, 05:24 PM   #2715
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 612
Default

Quote:
Originally Posted by Loulou92 View Post
Behind the scene, Yanick also designed a duo of script :


Script: Yanick_Offline all FX from selected tracks - save previous_slot_n.lua
Script: Yanick_Offline all FX from selected tracks - restore previous_slot_n.lua

you can't break the behavior of the script, even if you try hard
datas are saved within the .rpp
you have infinite slots

this is a *killer script* for CPU mgmt. If you don't know, now you know ! Expect it to drop in Reapack soon. Donate to Yanick.

xxxxxxxxx
Already in Repack
But I decided to add another script

Code:
Yannick_Offline all FX from selected tracks - Clear all saves (slot n)
The fact is that for convenience, all track and FX data remains, but if you delete tracks and effects without returning and save new tracks and effects, then the old data may accumulate too much (theoretically), so you can completely clear this cache. Although I doubt that this cache will give any problems, and that this will significantly increaze the size of the project, but let there be such an opportunity
Yanick is offline   Reply With Quote
Old 02-15-2022, 09:02 PM   #2716
Rockum
Human being with feelings
 
Join Date: Apr 2009
Location: Nashville
Posts: 187
Default Drum Manager

I had an idea for a drum management script, but it is way out of my programming league. Made a video to explain it. The goal is to be able to reuse your favorite pads and keys for the same drums regardless the kit, find your favorite drums quickly, manage your kits, etc.



Mistakes
3:40 Should have said MIDI Note (Not MIDI channel)

Last edited by Rockum; 02-16-2022 at 06:41 AM.
Rockum is offline   Reply With Quote
Old 02-17-2022, 12:07 AM   #2717
Pink Wool
Human being with feelings
 
Pink Wool's Avatar
 
Join Date: Apr 2020
Posts: 1,524
Default

Hi! I'm looking for a script that would save a snapshot automatically whenever something is changed in the FXChain. I already asked here but was wondering if anyone here could do it as it's way too complicated for me...

Thanks in advance,
PW
Pink Wool is offline   Reply With Quote
Old 02-17-2022, 04:06 AM   #2718
Joe90
Human being with feelings
 
Join Date: Aug 2019
Posts: 855
Default

Could anyone please make me a script to alter the midi send source on the selected track's sends to channel 'x', with 'x' being a channel number I can edit within the script. I need it for a custom action. If 'x' is a pain, then just setting it to channel 5 would be fine too.

Cfillion has made them to select the midi bus number on sends, but not to select a midi channel number.

Ideally it would effect only the last added send, but it would also be fine if it effects all sends on the selected track like cfillion's script.

EDIT: if it can target the most recent send, then if it could also disable audio that would be even better.

EDIT2: And also make the send pre-fx.

Thank you!

Last edited by Joe90; 02-17-2022 at 04:48 AM.
Joe90 is offline   Reply With Quote
Old 02-17-2022, 06:00 AM   #2719
Dragonetti
Human being with feelings
 
Join Date: Feb 2017
Location: Kiel
Posts: 974
Default

Hello
Can someone modify this script so that it works reliably.
I think the midichord detection doesn't recognize overlapping chord tones.
Anyone know of another script? I've already searched the whole forum.

In this simple case, midi chord detection works worse than the same chords in audio (chordino). Definitely Am C

Thank you



Code:
-- Notation Events Chords to Regions
-- juliansader https://forum.cockos.com/member.php?u=14710

reaper.Undo_BeginBlock2(0)
--reaper.Main_OnCommand(40421,0) --Item: Select all items in track 40421
reaper.Main_OnCommand(40153,0) --Item: Open in built-in MIDI editor (set default behavior in preferences) 40153
hwnd = reaper.MIDIEditor_GetActive()
--reaper.MIDIEditor_OnCommand( hwnd, 40954 ) --Mode: Notation3
reaper.MIDIEditor_OnCommand( hwnd, 41281 ) --Notation: Identify chords on editor grid

reaper.SN_FocusMIDIEditor()
reaper.MIDIEditor_OnCommand(40954,0) --Mode: Notation3
reaper.MIDIEditor_OnCommand(41281,0) --Notation: Identify chords on editor grid

  
take = reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive())
reaper.MIDI_Sort(take)
MIDIOK, MIDI = reaper.MIDI_GetAllEvts(take, "")
tChords = {}
stringPos, ticks = 1, 0
while stringPos < MIDI:len() do
    offset, flags, msg, stringPos = string.unpack("i4Bs4", MIDI, stringPos)
    ticks = ticks + offset
    if msg:byte(1) == 0xFF then
        chord = msg:match("text (.+)")
        if chord then
            tChords[#tChords+1] = {chord = chord, ticks = ticks}
        end
    end
end
tChords[#tChords+1] = {ticks = ticks}
for i = 1, #tChords do
    tChords[i].time = reaper.MIDI_GetProjTimeFromPPQPos(take, tChords[i].ticks)
end
for i = 1, #tChords-1 do
    -- Set Region Color RGB > reaper.ColorToNative(55,118,235)
    if tChords[i].chord ~= last_chord then
       reaper.AddProjectMarker2(0, false, tChords[i].time, tChords[i+1].time, tChords[i].chord, 1, reaper.ColorToNative(89, 107, 95)|0x1000000) 
       last_chord = tChords[i].chord
    end
     
end

commandID2 = reaper.NamedCommandLookup("_SWSMARKERLIST13")
reaper.Main_OnCommand(commandID2, 0) -- SWS: Convert markers to regions
reaper.Undo_EndBlock2(0, "Chords from midi item", -1)
reaper.MIDIEditor_OnCommand( hwnd, 2 ) --File: Close window
Dragonetti is offline   Reply With Quote
Old 02-17-2022, 11:06 AM   #2720
Yanick
Human being with feelings
 
Yanick's Avatar
 
Join Date: May 2018
Location: Moscow, Russia
Posts: 612
Default

Quote:
Originally Posted by Joe90 View Post
I need it for a custom action.
And what kind of custom action is needed? Sometimes it's better to make a script right away
Try this
Pay attention to the parameters at the beginning of the scripts

Last edited by Yanick; 02-17-2022 at 11:12 AM.
Yanick 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 11:36 AM.


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