• jon@schemawound.com

Supercollider SlimLauncher

One thing that has always bugged me about not have a dedicated GUI for Supercollider is not having quick access to all the windows I frequently need.  For a long time I would include every one of these in my startup file but I would end up getting overrun by windows I didn’t need.  Eventually I would end up closing them and not have access to them when I needed them.  

I decided what I needed to create was a small launcher app that would sit on top of the code window and save the preferred screen locations for the windows I wanted to launch.  This allows me to toggle windows out of my way when I need the space.  I tried to write it in such a way as it could be customized to meet the needs of others.

To install it Download the SlimLauncher.sc file and place it in your extentions folder. The SlimLauncer class will not be available until the next time you restart Supercollider.

SlimLauncher

SlimLauncher has only one method: SlimLauncher.Show(userButtonsDef, launcherBounds, showPositionButton, showGlobalButtons)

userButtonsDef – expects an array of events with the following fields:

  • buttonName: Display name for the button
  • alwaysOnTop: true/false – window should always be on top?
  • bounds: Bounds for the window.  This is something you will want to change based on the resolution of your machine and your personal preferences. In order to find the proper values set the windows the way you like them and hit the POS button.  This will post the current bounds for each window to the post window.  You can then edit the code with these values to set it for the future. (NOTE: ONLY WORKS FOR WINDOWS, NOT VIEWS)
  • showButton: The function that should be called to show your button.  Should return a window or a view for other functions to work correctly.

launcherBounds: The bounds for the launcher window

showPositionButton: true/false – display position button.  This is used for setting up the position of your buttons.  See the description of bounds above.  My recommendation is to only display it when first setting up a new machine.

showGlobalButtons: This is a pair of buttons to show/hide all windows.

EXAMPLE:
	var userButtons = [
		(buttonName: "Server",		alwaysOnTop: true,	bounds: Rect(1285, 490, 290, 100),	showButton: {
			var window = Server.internal.makeWindow; 
			window.window
		}),
		(buttonName: "Scope", 		alwaysOnTop: true,	bounds: Rect(1285, 203, 290, 250), 	showButton: {
			var window = Server.internal.scope; 
			window.window
		}),
		(buttonName: "Freq", 		alwaysOnTop: true,	bounds: Rect(1610, 78, 712, 250), 	showButton: {
			var window = FreqScope.new; 
			window.window
		}),
		(buttonName: "Class", 		alwaysOnTop: true,	bounds: Rect(1608, 366, 712, 697), 	showButton: {
			var window; 
			Object.browse; 
			Window.allWindows.do{|win| 
				if(win.name == "class browser", {window = win})
			}; 
			window
		}),
		(buttonName: "SynthDef",	alwaysOnTop: true,	bounds: Rect(1608, 366, 712, 697), 	showButton: {
			var window;
			SynthDescLib.global.read; 
			SynthDescLib.global.browse; 
			Window.allWindows.do{|win| 
				if(win.name == "SynthDef browser", {window = win})
			};
			window
		}),
		(buttonName: "SCCode",		alwaysOnTop: true,	bounds: Rect(2335, 135, 535, 986), 	showButton: {
			WebView()
				.bounds_(Rect(2335, 135, 535, 986))
				.url_("http://doc.sccode.org/Search.html")
				.front
		})
	];
	SlimLauncher.show(userButtons, Rect(1409, 923, 182, 205), false, true);

SlimLauncher

Please let me know if you have any questions or comments.