Make recording survive cmd+period

I’m trying to record SuperCollider’s main output using s.record, but the recording stops whenever you do a cmd+period. Is there an easy way to make the recording process survive it? Just putting it in a SkipJack isn’t enough (it just stops the recording and starts recording to a new file immediately after).

My use case: Ideally, I would like to hit record at the beginning of a sound design session, record everything to a single file and stop recording after I’m done. I don’t really want to mess around with lots of tiny files or have to go the extra mile of combining them after I’m done, if possible, and it would be neat to be able to do this within SC and not have to rely on external recording software.

I use an alternative function to free Synths running in my default group (along with stopping patterns etc)

{ 
	s.freeMyDefaultGroup;
	fork{
		s.latency.wait;
		TempoClock.all.do(_.clear);
		SystemClock.clear;
	};
}

then put Synths I want to survive in the RootNode using

target:RootNode(s)

I have the above function and command-. mapped to adjacent key commands (I’m using scnvim) - and also accessible from a control surface.

Its nice to have both levels of “stop” available

2 Likes

Thank you, I didn’t think of just rolling my own cleanup function, but that works perfectly for me!
I’m in the process of switching to Linux/scnvim anyway, but ScIDE users can paste the following in their startup.scd file (File -> Open startup file) to define a global key bind which runs the alternate cleanup function (I wonder if there is an easier way to define custom shortcuts?):

~ctrlComma = {
	s.defaultGroup.set(\gate, 0); // this gets rid of some "Node not found" errors with running Pbinds
	s.freeMyDefaultGroup;
	fork{
		s.latency.wait;
		TempoClock.all.do(_.clear);
		SystemClock.do(_.clear);
	};
};
Document.globalKeyDownAction = {
	arg document, char, modifiers, unicode, keycode;
	if (modifiers.isCtrl && keycode == 188) { // ctrl+,
		~ctrlComma.value;
	}
};

This uses ctrl+, to run the alternate cleanup function, but you can figure out your own key binds using this tool (click on the window that pops up and press any key/modifier-combo on your keyboard):

(
w = Window.new("Keycode finder");
w.view.keyDownAction = {
	arg view, char, modifiers, unicode, keycode;
	var mod;

	mod = case
		{ modifiers.isCaps } { "caps" }
		{ modifiers.isShift } { "shift" }
		{ modifiers.isCtrl } { "ctrl" }
		{ modifiers.isAlt } { "alt" }
		{ modifiers.isCmd } { "cmd" }
		{ modifiers.isNumPad } { "numPad" }
		{ modifiers.isHelp } { "help" }
		{ modifiers.isFun } { "fun" }
		{ modifiers == 0 } { "none" };

	"char: %\t\tkeycode: %\t\tmodifiers: %\n".postf(char, keycode, mod)
};
w.front;
)
3 Likes
CmdPeriod

.clearClocks_

(
	false
)

.freeServers_

(
	false
)

.freeRemote_

(
	false
)

.removeAll

/*

.objects_

*/

.add

{
	postln
	
	(
		CmdPeriod.era
	)
}

.doOnce

{
	CmdPeriod.objects.do{ |x| x.def.sourceCode.inform }
}
1 Like