Is this possible? I have been searching the documentation but found no functions doing this.
Is it possible to add an existing Song to and existing Setlist in a GP script?
No itâs not possible. Only via the user interface.
Thanks!! I found another very fast and easy way so no need for me to do it in a script
Would love details
The background is a bit complex and I hope I donât bore you.
It is about restarting GP very quickly in case of a chrash when Iâm live on stage. The solution is to split the big gig file for a band (I have 3 bands in total and lets say 70âŚ100 rackspaces per band in this big gig file) into smaller ones for each gig. So when next gig has 4 sets A, B, C, D of lets say 10 songs (=rackpaces) in each set then I would like to only load a small gig file right before we start performing each of this 4 sets. Complete loading time then takes about 8âŚ10 seconds.
Then after starting GP Iâm monitoring the healthy of GP process with a watchdog script. In case of a crash this watchdog (windows batch file) automatically restarts GP with latest gig file and also immediately swithces GP to most recently selected rackspace in this gig (by sending SelectRackSpace via OSC). So when GP chrashes (happened sometimes once per show) then I have a break of only 8âŚ10 seconds (instead of 30âŚ60 seconds). Furthermore this small gig files also have reduced the frequency of chrashes significantly.
So I was wondering how I can easily setup this small gig files from the big one again and again for each gig. And pianopaul has pointed me to the setlists which allow to cerate those small gig files from small setlists. Thanks once more more to Paul for this nice tip! So in my big gig file (100 rackspaces used 1:1 for 100 songs) I created 100 songs and assigned them to the 100 rackspaces 1:1.
And since Iâm managing all my music projects in a big excel sheet for many many years (500 songs in 1500 variations in about 30 years) I was using OSC and UI automation in excel in order to do a lot of this song creation and rackspace assignment in GP not manually but automatically.
And the last step now is about how to recreate this small setlists A B C and D right before each gig as easy a possible. This excel sheet knows all songs and also the mapping to the sets A B C and D for each gig. The name of the songs in this sheet exactly matches the names of the songs and rackspaces in GP. So I was wondering if I can add the songs to the sets by a selfdefined OSC user messages sent from excel to GP and some scripting in GP. But as you told me there is no function available for this in GP scripting.
So I used UI automation instead. I did it by manually opening e.g. an empty setlist A in GP and then press CTRL+SHIFT+F to open the dialog for adding songs to current setlist. Then I select all songs for set A in this excel sheet and let it send keystrokes to GP with each songname + ENTER which forces GP to add them all to set A (takes less than 1 second). Then I do the same for Set B, C and D. And then I use this 4 sets to create the 4 very small gig files for next gig.
For each gig I will repeat this steps which I think is done in a minute or less.
I really start loving GP and scripting!
You donât bore us and what youâre doing is rather clever.
That said, if you have tested your gigfile thoroughly in advance of a show, you should not be experiencing any crashes - would love to know what crashes you have encountered.
Okay, I can load old backups of my very big Gig files and deal with them a bit like I do during a show which is switching from one Rackspace to another and playing songs on my Keyboards.
If I will be able to force a crash this way I will send a report. I just have to figure out how to send a report, but I guess itâs not so complicated.
This could probably help:
It would be nice to be able to have a look at this scriptâŚ
What does send this OSC message? Why donât you use the GP general option to reopen the last active Rackspace?
We would also be curious to have a look at the excel script. Does Excel really send OSC? Or do you run an external OSC software from Excel?
How do you do that?
Wow great, looks easy, thanks!
You can find the content of this script at the end of this post but it is quiet quick and dirty and absolutely not recommended to use it as it is. So I am absolutely not responsible for any damage caused by using of any of the lines in this batch file at the end of this post!!! And please donât make jokes about some stupid coding But may be any of the ideas insight might be helpful for others, may be, may be not, donât know. So please do not try to understand the whole thing, there are too many undocumented dependencies. And donât care for âFF, TB, HHâŚâ. This are only 2 character shortcuts I use for my Bands here, in filenames and also as part of the âkeysâ for the song entries in the excel sheet, e.g. Song Key âFF-B4â means this entry is for my Band âFunky Fusionâ (name is made up) set B song No 4. And a file Valerie@FF.docm is the âValerieâ lead sheet for band FunkyFusion, same for audio files and othersâŚ
And inititally this batch file was just intended as a gig performer starter which just makes sure that I have not forgotten to plug in the laptop AC adaptor I used windows management interface to check this (WMIC) and the lines at the end are only for some documentation. I really forgot to plug in this AC Adapter once on a gig and right in the middle of song no 2 the laptop shutdown⌠very awkward! :((
Later I added the âwatchdogâ feature using this nice tool âcmdowâ which can check for or do actions on processes and windows. You will find it at loop â:waitâ.
The call to âD:\GigPerformerSetRackspace.batâ is just for automatically selecting the current rackspace after restarting GP due to a crash. It just contains a single command line written by GP itself each time GP selects another gig by the event handler:
// Called when you switch to another rackspace
On Rackspace(oldRackspaceIndex : integer, newRackspaceIndex : integer)
var ret : boolean
ret=SaveStringToTextFile (âD:/GigPerformerSetRackspace.batâ, "C:/Users/marku/Downloads/sendosc-win-1.0.2/sendosc.exe 192.168.178.34 54341 /GigPerformer/SwitchToRackSpace i " + IntToString(newRackspaceIndex) )
End
The file âLastGig.batâ is just to make the name to the most recently used gig file non volatile (and also known by this script for a renaming of the GP window title bar for easier processing/identifying in this scripts)
And this is content of âwatchdogâ batch file:
@echo off
rem SETLOCAL EnableDelayedExpansion
TASKKILL /F /FI âWINDOWTITLE eq GP-STARTâ
title GP-START
mode con: cols=100 lines=15
d:\cmdow âLNâ /ACT /RES 2> nul
d:\cmdow âTBâ /ACT /RES 2> nul
d:\cmdow âHHâ /ACT /RES 2> nul
d:\cmdow âFFâ /ACT /RES 2> nul
set RESTART=0
del D:\GigPerformerSetRackspace.bat
:loop
FOR /F âUSEBACKQâ %%F IN (WMIC PATH Win32_Battery Get BatteryStatus ^| grep [0-9]
) DO (
cls
echo.
echo.
if â%%Fâ==â2â (
color 2
echo ################################################
echo # #
echo # #
echo # Akku OK #
echo # #
echo # #
echo ################################################
echo.
echo.
echo checking GigPerformer4!
tasklist /fi âImageName eq GigPerformer4.exeâ /fo csv 2>NUL | find /I âGigPerformer4.exeâ>NUL
if not errorlevel 1 (
echo GigPerformer4.exe is still running!!!
powershell Start-Sleep -m 2000
goto :loop
) else (
echo â%~f0â %1 > C:\Users\Marku\LastGig.bat
:restart
cls
echo %TIME%: Starting %1 âŚ
cmd /C start ââ âC:\Program Files\Gig Performer 4\GigPerformer4.exeâ %1
REM SETX requires a process restart of Predator sense in order to load updated environment!!!
REM setx LAST_GIG â%1âpowershell Start-Sleep -m 200 d:\cmdow "Gig Performer Error Reporter" /ACT 2> nul powershell Start-Sleep -m 200 d:\cmdow "Gig Performer Error Reporter" /CLS 2> nul powershell Start-Sleep -m 200 rem for %%f in (%1) do D:\CMDOW.EXE "%%~nf" /REN "GigPerformer - %%~nf" for /L %%i in (1,1,250) do ( powershell Start-Sleep -m 200 rem echo "TRY Rename GP WIndows Title=%~n1 %%i/20" D:\CMDOW.EXE "%~n1" /REN "GigPerformer - %~n1" 2> nul if not errorlevel 1 goto :cont REM timeout 1 > nul )
:cont
cls
echo %TIME%: WAIT for GP to crashâŚ
if â%RESTART%â==â1â (
if exist D:\GigPerformerSetRackspace.bat (
powershell Start-Sleep -m 200
call D:\GigPerformerSetRackspace.bat
)
)
:wait
powershell Start-Sleep -m 200
D:\CMDOW.EXE âGigPerformer - %~n1â 1> nul
if not errorlevel 1 goto :waitcls set RESTART=1 goto :restart exit )
)
color 4
echo. ################################################
echo. # #
echo. # #
echo. # Akku ist nicht angeschlossen!!! #
echo. # #
echo. # #
echo. ################################################
ping -w 2000 -n 1 192.168.178.99 > nul
)
goto :loopgoto :EOF
WMIC PATH Win32_Battery Get Availability
WMIC PATH Win32_Battery Get BatteryRechargeTime
WMIC PATH Win32_Battery Get BatteryStatus
WMIC PATH Win32_Battery Get Caption
WMIC PATH Win32_Battery Get Chemistry
WMIC PATH Win32_Battery Get ConfigManagerErrorCode
WMIC PATH Win32_Battery Get ConfigManagerUserConfig
WMIC PATH Win32_Battery Get CreationClassName
WMIC PATH Win32_Battery Get Description
WMIC PATH Win32_Battery Get DesignCapacity
WMIC PATH Win32_Battery Get DesignVoltage
WMIC PATH Win32_Battery Get DeviceID
WMIC PATH Win32_Battery Get ErrorCleared
WMIC PATH Win32_Battery Get ErrorDescription
WMIC PATH Win32_Battery Get EstimatedChargeRemaining
WMIC PATH Win32_Battery Get EstimatedRunTime
WMIC PATH Win32_Battery Get ExpectedBatteryLife
WMIC PATH Win32_Battery Get ExpectedLife
WMIC PATH Win32_Battery Get FullChargeCapacity
WMIC PATH Win32_Battery Get InstallDate
WMIC PATH Win32_Battery Get LastErrorCode
WMIC PATH Win32_Battery Get MaxRechargeTime
WMIC PATH Win32_Battery Get Name
WMIC PATH Win32_Battery Get PNPDeviceID
WMIC PATH Win32_Battery Get PowerManagementCapabilities
WMIC PATH Win32_Battery Get PowerManagementSupported
WMIC PATH Win32_Battery Get SmartBatteryVersion
WMIC PATH Win32_Battery Get Status
WMIC PATH Win32_Battery Get StatusInfo
WMIC PATH Win32_Battery Get SystemCreationClassName
WMIC PATH Win32_Battery Get SystemName
WMIC PATH Win32_Battery Get TimeOnBattery
WMIC PATH Win32_Battery Get TimeToFullCharge
Yes I know this feature but for some reason I needed to known this name also in the scripts.
Uhh this excel makro has been growing over tenth of years and is quiet big. It is not only for communicating with GP but also for reuse of work in one band from another, automatically creating leadsheets from word templares, doing some automatic google for song texts, youtube videos and other ressources for a given song, documentation of tempo and tune, who sings which volcal lines in this band for planing of rehersals and many other meta info⌠Even copying all relevant sheets for a given gig in the correct order to the tablet is done automatically by this excel monster with just a mouse click.
But regarding your question on OSC in excel, no excel of course was written only for bosses and freaks making numbers and money not for making music. So in excel when the corresponding cell is selected then I just do a âshell â which is calling another batch file like this:
If InStr(1, Command, "GPS") = 1 And Target.row > 3 And Target.Column = 3 And Target.Columns.Count = 1 Then Verb = Mid(Command, 4) Application.StatusBar = "GigPerformer: " + Verb + "..." Select Case Verb Case "create" Application.StatusBar = "Creating..." For Each cell In Target If Not cell.EntireRow.Hidden Then Application.EnableEvents = False: cell.Select: Application.EnableEvents = True Song = Selection.Value Arr = Split(Song, " ") If UBound(Arr) > 2 Then RackSpace = Arr(0) + " " + Arr(1) + " " + Arr(2) Else RackSpace = Song End If If Song <> "" Then Application.StatusBar = "Creating " & Song SyncShell "d:\GigPerformerCreateSong.bat " + Q(Song) + " " + Q(RackSpace), vbNormalFocus End If End If Next
And GigPerformerSwitchSong.bat is just using the sendosc.exe tool as you already have assumed.
C:/Users/marku/Downloads/sendosc-win-1.0.2/sendosc.exe 192.168.178.34 54341 /GigPerformer/SwitchToSong s â%~1â
AppActivate "GigPerformer - "
SendKeys âValerieâ
SendKeys â{ENTER}â
@Markus, I can tell you that next time a band member tells to me that I do complicated things, I will show him this topic
Yes I know what you mean, it looks a bit crazy