Old 09-06-2016, 04:06 PM   #1
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,684
Default ReaScript: Song switcher for live use

The purpose of this script is to quickly switch between songs in a single project during live shows. It is a replacement for the slow SWS Snapshots (visibility + mute).

Usage

Each song must be in a top-level folder track named "#. Song Name" ("#" being any number).

After selecting a song, Song Switcher mutes and hides all songs in the project except for the current one. Other tracks/folders that are not part of a song's top-level folder are left untouched.
Song Switcher can also optionally stop playback and/or seek to the first item in the song when switching.

This script works best with REAPER settings "Do not process muted tracks" and "Track mute fade" enabled.

The following additional actions are included for communicating to the main script:
  • cfillion_Song switcher - Switch to previous song.lua
  • cfillion_Song switcher - Switch to next song.lua
  • cfillion_Song switcher - Switch song by MIDI CC.lua
  • cfillion_Song switcher - Switch to queued song.lua
  • cfillion_Song switcher - Reset data.lua
A web browser interface is also installed as song_switcher.html for remote use (this feature requires REAPER v5.30+ and ReaPack v1.1+). Note that the timecode displayed in the web interface always starts at 00:00 for convenience. This means that a song spanning from 7:45 to 9:12 in the project is displayed as 00:00 to 01:26 on the web interface.

Download

This script is shared through the ReaTeam Scripts community repository, available from ReaPack.

Screenshots

Demo in docked mode:



Windowed mode:



Web browser interface:


Last edited by cfillion; 05-19-2019 at 01:27 PM.
cfillion is online now   Reply With Quote
Old 09-06-2016, 09:46 PM   #2
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 7,449
Default

Seems like a good idea !

But
Quote:
Originally Posted by cfillion View Post
Each song must be in a top-level folder ...
I either do pre-planned song productions. Here each song is a reaper project anyway. Maybe consisting of multiple "Takes" that reside in a Project one after the other (the machine "just runs" while the musicians play.

Or I do live recordings. Here the machine "just runs" as well, the songs reside in the project one after the other.

A script jumping to take or song positions might be helpful (i.e. using a named list of markers or similar).

-Michael
mschnell is offline   Reply With Quote
Old 10-14-2016, 11:59 AM   #3
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 5,279
Default

thanks cfillion
This is great

I've added
Code:
  reaper.Main_OnCommand(40042,0) -- go to start of project
  reaper.Main_OnCommand(1016,0) -- stop
in setCurrentIndex function, to go to start and stop each time you switch. But it could be optional. Or maybe just the stop optional.
__________________
HeDaScripts for REAPER
heda is offline   Reply With Quote
Old 10-14-2016, 03:58 PM   #4
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,684
Default

Nice idea heda! I've added a "onswitch" option.

Code:
v1.1
+ add onswitch setting (no action, seek, seek+stop) [p=1742908]
+ exit filter mode if empty when pressing backspace
+ reduce scrolling when there is enough space
cfillion is online now   Reply With Quote
Old 10-15-2016, 03:33 AM   #5
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 5,279
Default

thanks for the update

I've discovered a bug in REAPER. If I put a video in a child track, along with the backing track. The video is still displayed even if I switch to another song and the parent is muted. But maybe as a workaround, the script could also mute all children tracks, and not only the parent track, or at least mute tracks that have videos on it.
__________________
HeDaScripts for REAPER
heda is offline   Reply With Quote
Old 10-15-2016, 04:05 AM   #6
heda
Human being with feelings
 
heda's Avatar
 
Join Date: Jun 2012
Location: Spain
Posts: 5,279
Default

I was thinking, another solution would be to put all tracks in sequential spacing, not all from the beginning of the project. This way there would be no problem with the video tracks. But then the seek feature should seek the first item in the children tracks. And maybe it is better performance if it mutes all video tracks.
Another advantage of putting songs in sequential order, is that you can also insert tempo in the tempo tracks to match the tempo of each song. It's not a big issue since I also render click tracks as you have in your gif. But it can help if you have delay effects in sync with the backing track.
__________________
HeDaScripts for REAPER
heda is offline   Reply With Quote
Old 04-25-2019, 07:16 AM   #7
SebyMusic
Human being with feelings
 
Join Date: Apr 2018
Posts: 107
Default Drag and Drop

Hi sir, very nice script for live band, tks.
I was wondering, is there by any chance a way to REMAKE a set list.
So some night we play those songs in that order and the other night in that order, etc...
Would be nice to be able to create SetList or at least move songs by drag and drop on the playlist script.

Do you think it's doable?
tks
Seby
SebyMusic is offline   Reply With Quote
Old 04-25-2019, 09:12 AM   #8
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,684
Default

That's a very nice idea! I've added drag and drop reordering in the latest update, available now.

cfillion is online now   Reply With Quote
Old 04-25-2019, 09:47 AM   #9
SebyMusic
Human being with feelings
 
Join Date: Apr 2018
Posts: 107
Default

Quote:
Originally Posted by cfillion View Post
That's a very nice idea! I've added drag and drop reordering in the latest update, available now.

WOW, what a nice services!
If you have time someday, a way to save sets would be great.
Tks sir
Merci
Seby
SebyMusic is offline   Reply With Quote
Old 05-07-2019, 07:06 AM   #10
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 7,449
Default

Quote:
Originally Posted by cfillion View Post
The following actions are included:
  • cfillion_Song Switcher.lua: This is the main script. It must be open to use the others.
  • cfillion_Song Switcher (previous).lua: Goes to the previous song
  • cfillion_Song Switcher (next).lua: Goes to the next song
  • cfillion_Song Switcher (reset).lua: Rebuilds the song list
I am not at all knowledgeable with Scripts but I did a miniature one that takes a 7 bit parameter derived from a Midi CC message that is assigned to an action the script provides. The script acts according to this value.

Does the song switcher provide such an action that would allow to start a dedicated song selected by a Midi message ?

-Michael
mschnell is offline   Reply With Quote
Old 05-07-2019, 07:41 AM   #11
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,684
Default

I don't use/have those fancy MIDI controllers with CC-sending knobs, so I haven't implemented that. You can do it with a script:
  1. Obtain which MIDI message triggered it using reaper.get_action_context
  2. Signal song switcher to activate a song using one of the two commands below
Code:
-- activates the next song (current song + n, n can by negative to go backwards)
reaper.SetExtState('cfillion_song_switcher', 'relative_move', '1', false)

-- activates the song with a given title (partial match)
reaper.SetExtState('cfillion_song_switcher', 'filter', '17. Autumn Serenade', false)
reaper.SetExtState('cfillion_song_switcher', 'filter', '17', false)
reaper.SetExtState('cfillion_song_switcher', 'filter', 'Autumn Serenade', false)
I can add an absolute_move command to activate a specific song index (rather than trackname-based) if necessary.

Last edited by cfillion; 05-07-2019 at 08:18 AM.
cfillion is online now   Reply With Quote
Old 05-08-2019, 02:47 AM   #12
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 7,449
Default

To me an "absolute move" sees very appropriate for a range of applications that thrive to remote-control the playback either directly from some hardware, or by messages resulting from some kind of pre-processing. (A "stop" also seems like desirable.)

Right now, for me this was just a theoretical question, as I don't intend to add any playback feature to my live setup. But triggered by a discussion in another thread, I do thinks that if I would consider to use such a functionality, I supposedly would like to us a kind of MIDI controller to selectively start a song or sound snippet.

(See -> https://forum.cockos.com/showthread.php?t=213568#3 )

Thanks for listening,
Michael

Last edited by mschnell; 05-08-2019 at 03:03 AM.
mschnell is offline   Reply With Quote
Old 05-08-2019, 05:45 AM   #13
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,684
Default

I'll see what I can do next week, once my own show is over.

(I consider Song switcher to be more about switching between sets of VSTi tracks and MIDI/audio routing than as a playback system... though it can be used as that too)

Last edited by cfillion; 05-08-2019 at 05:58 AM.
cfillion is online now   Reply With Quote
Old 05-08-2019, 08:40 AM   #14
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 7,449
Default

In the "Live Usage" subforum there are multiple threads with questions how to do a live (e.g. keyboard-) setup that not only can switch sounds / patches to be played, but additionally allows to fire "Backgourd tracks" or sound snippets that are not generated by a VST but have been pre-recorded by the artist. In many cases the artists does not use a computer screen/mouse/keyboard during the show.

Obviously some kind of sampler can be used for that issue, but to me it seems more appropriate / easier doable, to use Reaper tracks to hold the content (which now even can be Midi or multiple audio tracks).
Here the "Song Switcher" seems like a perfect tool.

-Michael
mschnell is offline   Reply With Quote
Old 05-12-2019, 04:56 PM   #15
Ravine
Human being with feelings
 
Ravine's Avatar
 
Join Date: May 2019
Location: England
Posts: 1
Default Pause/play feature?

Hi, this is a wonderful script thank you, the folder system is good way of organising lots of songs in one project as a set/play list. The drag and drop reordering feature is a huge plus!

I'm placing my songs along the timeline at tempo change markers with an audio and midi track in each folder. The very top Reaper track (outside all folders and common to all songs) contains empty items which I'm using for lyrics with 'Note Reader' (so it can read everything on the same track).

This means that Song Switcher continues playing at the end of each selected song (except for the last in the line). Is there any way to make the player stop playing at the end of a track/folder and go to the next song on the list, selected ready to play?

Also, say for instance while song #03 is playing, I use the up/down arrows to choose my next song, for example song #09. Song #09 flashes as if it is cued-up but I have to press 'enter' to actually select it, if I do this while song #03 is playing it will be cut off. Even at the end of song #03 I still have to press enter and then the space bar. It would fantastic if in this example when song #03 ends, song #09 is automatically selected ready to play.

I used a thing called "Sweet Midi player" for many years that does just that, it was called 'Jukebox' mode.

These extra features in your script would be a huge benefit for live performance.

Best Regards.
Ravine is offline   Reply With Quote
Old 05-14-2019, 07:50 AM   #16
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 7,449
Default

I might want to use the song switcher together with my (rather complex) Live Setup done in Reaper. As the Live project already features a lot of tracks, I would like to use the song switcher in a differently managed scope. I think the optimal scope would be another project tab.

Now the signals for switching the "songs" would come in via Midi and are received by a track in the main (Live) project.

Is there a way to "route" Midi messages or Reaper actions from one project tab to another and there to the song switcher to have it start and stop audio / Midi tracks that are located in that project tab ?

Thanks for any comment,
-Michael

Last edited by mschnell; 05-14-2019 at 09:51 PM.
mschnell is offline   Reply With Quote
Old 05-15-2019, 09:52 PM   #17
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 7,449
Default

... bump ...
-Michael
mschnell is offline   Reply With Quote
Old 05-19-2019, 01:25 PM   #18
cfillion
Human being with feelings
 
cfillion's Avatar
 
Join Date: May 2015
Location: Québec, Canada
Posts: 2,684
Default

Quote:
Originally Posted by mschnell View Post
Let me know when you publish an update and I'll be happy to test it.
Done! The latest update adds a "Switch song by MIDI CC" action. Let me know if this works with your MIDI controller.

Quote:
Originally Posted by Ravine View Post
This means that Song Switcher continues playing at the end of each selected song (except for the last in the line). Is there any way to make the player stop playing at the end of a track/folder and go to the next song on the list, selected ready to play?

Also, say for instance while song #03 is playing, I use the up/down arrows to choose my next song, for example song #09. Song #09 flashes as if it is cued-up but I have to press 'enter' to actually select it, if I do this while song #03 is playing it will be cut off. Even at the end of song #03 I still have to press enter and then the space bar. It would fantastic if in this example when song #03 ends, song #09 is automatically selected ready to play.
I would use SWS marker actions for this (http://sws-extension.org/). Creating a marker named !1016 would run the action "Transport: Stop" after the play cursor reaches it with up to 33 ms of jitter.

I've added a "Switch to queued song" action to help with this. You can have it run at any point in a song by adding a marker named !_RS0845295095eb2b87e149f040514acb7ebbcf61f4. Switch to next song is !_RS1f1c5f5406d0a36f4b780fd6ab7b54a8006b9e69.
cfillion is online now   Reply With Quote
Old 05-19-2019, 02:19 PM   #19
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 7,449
Default

Sounds great !!!
Any idea about the "other Project Tab" issue ?

Thanks again,

-Michael
mschnell 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:24 AM.


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