• jon@schemawound.com

SW_Gui – A customizable GUI for Supercollider

I have been searching for a better way to organize a GUI in Supercollider as you may know from my posts about Superscope and SlimLauncher.  While I found these to be a useful start I was still juggling way too many windows.  This has led to my new solution SW_Gui.

SW_Gui is a tabbed GUI interface that keeps the most useful tools at your fingertips in a single window and has a customizable launcher so you can access anything else you may need.

DISCLAIMER: This has really been built for my own use so far.  There may be bugs and the interfaces may change in the future.  I have only tested using SC3.5 on Windows 7 using the QT GUI.  If you find any bugs, have any feature requests or find this to be useful to you, please contact me at schemawound@yahoo.com .

To Install:

  1. This code relies on several Quarks: AllGui, cruciallib, crucialviews, ServerTools, TabbedView and wslib.  Please install these using the usual manner.  I will be doing a post here describing how to install Quarks on windows.
  2. Download SchemawoundLib.zip
  3. Unzip and place the SchemawoundLib directory in your extensions folder.
  4. The included startup.scd file shows an example of how to include SW_Gui in your startup.  You can incorporate this into your own startup or use this file if you do not have a startup file yet.

Overview:

SW_GUI – This is the main class that creates a tabbed interface including SW_Scope, SW_Internals and SW_Launcher.

When creating a new instance of SW_Gui it expects 3 parameters:

userButtonsDef – Since this is only used by SW_Launcher it is described in more detail in the description of that class.

bounds – Bounds of the tabbed window.

alwaysOnTop – Show this window always on top of other windows.  Defaults to true.

SW_Scope – This is a scope window that is an evolution of my previous post about Superscope.  It displays 4 things on the window – a stereo scope, a phase scope, a freq scope and the input and output meters for the first 8 busses.

When creating a new instance it takes 2 parameters:

window – window to display the SW_Scope on, if none is provided it will create a new window.

bounds – The bounds of the SW_Scope.

SW_Scope

SW_Internals – This is a window that contains information on many of the internal things going on inside of Supercollider.  A nodetree, an AllGui and a GlobalsGui.  Please see the help files for each of these quarks for more details about their use.

When creating a new instance it takes 1 parameter:

bounds – The bounds of the SW_Scope.

SW_Internals

SW_Launcher – This is a customizable launcher for frequently used windows.

When creating a new instance it takes 6 parameters:

window – window to display the SW_Launcher on, if none is provided it will create a new window.

name – name of the window to be created.

bounds– The bounds of the SW_Launcher.

userButtonsDef – An array of SW_LauncherButtonDef.

showPositionButton – Show the position button?  This button posts the current bounds of all windows for user setup purposes.

showGlobalButtons – Show the ‘Show All’ and ‘Hide All’ buttons?

SW_Launcher

SW_LauncherButtonDef – This class represents a button that will be created on the launcher window.

When creating a new instance it takes 5 parameters:

name –Display name for the button.

alwaysOnTop – true/false – window should always be on top?

bounds -Bounds for the window the button creates.  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: POS BUTTON ONLY WORKS FOR WINDOWS, NOT VIEWS)

openOnGlobal – true/false – should this window open when the Show All button is pressed?

showButton – The function that should be called to show your window.  Should return a window or a view for other functions to work correct.

Besides new I have included a number of preset creation methods that each take only the bounds and set the other values for the SW_LauncherButtonDef.  These preset methods are presetEQ, presetClassBrowser, presetSynthDefBrowser, presetScCodeBrowser.

Below is an example of how I use SW_GUI in my startup file:

~launcherButtons = [
	SW_LauncherButtonDef.presetEQ(Rect(569, 359, 305, 220)),
	SW_LauncherButtonDef.presetClassBrowser(Rect(346, 64, 717, 805)),
	SW_LauncherButtonDef.presetSynthDefBrowser(Rect(346, 64, 717, 805)),
	SW_LauncherButtonDef.presetScCodeBrowser(Rect(346, 64, 717, 805)),
	SW_LauncherButtonDef(name: "The Tunnel", alwaysOnTop: true, bounds: Rect(8, 730, 116, 140), openOnGlobal: false, 
		showButton: {var synth = SW_TheTunnel().makeWindow(); synth.window})
];

s.waitForBoot({
	var launcherBounds = Rect(
		Window.availableBounds.width - 522,
		Window.availableBounds.height - 805,
		512,
		805
	);
	
	~superTabGui = SW_Gui(~launcherButtons, launcherBounds, alwaysOnTop: true)
		.window
		.front
});