// Script: pauseAll.ltgs // Description: Pause the song at the end of all loops (Second recorded loop) // This script is meant to be used with Looper emulator scripts // Will only work If the $gSecondRecordLoopID global variable has been created (normally by an looper emulator script) // Warning: Once instantiated, a global variable will exist until LoopToGo is close so this script will // still run If a song is loaded after the use of looper script emulation and will bring strange result// Arguments: // none // // Author : LoopToGo loadScript Looptogo\aliases.txt alias aMarkerName PauseMarker getLoopStart loopStart $gSecondRecordLoopID if $loopStart variable loopRefID $gSecondRecordLoopID else variable loopRefID $gFirstRecordLoopID endIf print loopRefID : $loopRefID if $loopRefID // We check If the last marker was a pause marker. If yes, we suppose the user changed his mind and remove it getMarkerName markerName $lastCreatedMarkerID if $markerName = aMarkerName deleteMarker aMarkerName endScriptDynamic endIf // If the song is playing or recording, we will add a Pause marker at the end of the Second recorded loop if $isRecording + $isPlaying getLoopEnd loopEnd $loopRefID deleteAllMarkers 2049 // delete Function marker if-any //shortcut O // Out of jam mode!!! addTemporaryPauseMarker $loopEnd 1 // 1 = remove after action setMarkerColor $lastCreatedMarkerID yellow setMarkerName $lastCreatedMarkerID aMarkerName // We give a name to be able to check If it's there else // Song is paused or stopped, we start recording if $gFirstRecordLoopStart print jumpTo $gFirstRecordLoopStart jumpTo $gFirstRecordLoopStart // A jumpTo is better that setBar (no audio glitch) else print jumpTo Start of song! jumpTo 1.0 endIf record // Start recording (from Looptogo\aliases.txt) endIf endIf