It can be used for practically anything sound related, whether that is scientific study of sound, instrument building, DJing, generative composition, or creating interactive installations. Similarily to the architectural ideas presented in Class11.SuperCollider is a very open environment. = ARCHITECTURE: MODEL-VIEW-CONTROLLER = Wslib // a quark library with many - and the best looking - GUIs Here is a list with some useful GUI quarks that you may want to get: Also, if you want to write your own GUI widget classes, look here:
![supercollider gui supercollider gui](https://static.macupdate.com/products/30548/m/supercollider-logo.png)
open("examples/GUI examples/GUI_examples2.scd" ) open("examples/GUI examples/GUI_examples1.scd" )ĭocument. For more, have a look at the following files:ĭocument. All GUIs have an action method that may contain a function to be evaluated when a user interacts with the GUIĪ.action= //clean up if the window closes For resizing GUIs when resizing their window, look at resize Change font on 0-15 buttons (you will need to refocus on the Window to see the effect): use an array to be able to access the elements afterwardsīutton( window, Rect((i%mod) * size + offset, i.div(mod) * size + offset, size - 5, size - 5))
SUPERCOLLIDER GUI MOD
Window = Window( "Algorithmically created", Rect( 128, 64, (size * mod) + offset, (size * btnAmt) / mod + offset )) Nevertheless, doing this algorithmically will always be more precise and versatile Try uncommenting the FlowLayout line - what a mess! Here Button returns the button class for the current kitī = Button( w, Rect( rrand( 20, 300 ), rrand( 20, 300 ), 75, 24 )) ī.states = , w.addFlowLayout // you can use this instead of the above line for brevity. W.corator = FlowLayout( w.view.bounds ) // comment this out for no decorator Window returns the window class for the current kit Instead of manually defining where UI elements should be positioned inside a window, you could also use FlowLayout to position things for you: You can add any GUI element to the window: W = Window( "Test window", Rect( -300, -500, 300, 100)) // use Window for cross-kit compatibility you could also use screenbounds to position something according to the size of the screen W.front //this line is need to make the window actually appear W = Window ( "Test window", Rect (400, 50, 300, 100)) // use Window for cross-platform compatibility * Coordinates are and instance of Rect, calculated as: make a 300x100 window at 400x50 screen co-ordinates. For more on gui kits, see the GUI helpfile swing // use swing in subsequent GUI creation procedures NOTE: If you do not have SwingOSC installed, you get a warning only, and do not switch so you cannot accidentally disable your (mac) gui system. cocoa // use cocoa in subsequent GUI creation procedures You can switch the GUI kit by calling the appropriate clas method: Check which one you 're using at the moment: You can ask the class what schemes are available in your machine: GUI is a class providing the means for writing platform-independent code, doing all the necessary translation from one scheme to the other. For a table of all gui classes and their kit-dependent equivalents, see GUI-Classes. Window), which makes them work in any platform.
![supercollider gui supercollider gui](https://static.macupdate.com/screenshots/241615/m/supercollider-screenshot.png)
Luckily, you can write platform independent GUIs by using the classes without their prefix (ex. SCWindow), and the Swing kit uses the JSC or J prefix (ex.
![supercollider gui supercollider gui](https://static.macupdate.com/screenshots/241614/m/supercollider-screenshot.png)
There are specific subclasses for each GUI kit: the CocoaGUI kit uses the SC prefix (ex.
SUPERCOLLIDER GUI FOR MAC OS
You may remember from class 1 that there are different types of gui servers that one can use in SC: the standard CocoaGUI for Mac OS X, and SwingGUI (in Java it is installed by default in Windows, but can also be used on Linux and OS X, although you will have to install it yourself) Swing OSC acts like a server, sending/receiving messages to/from sclang. Just drag anything in the window, toggle edit, and try it out.In this way, you can actually drag and drop and then position GUI widgets as you like in a window, and then get an automatically generated code! In Mac OS X, you can press shift+cmd+N to see what the available GUI widgets are.
SUPERCOLLIDER GUI CODE
Truth be told, it can take some lines of code to write GUIs. SuperCollider is probably least famous for its GUI capabilities, but in all truth, it can be very powerful, allowing you to take advantage of its algorithmic functionality and language power to create some very good looking GUIs. = GRAPHIC USER INTERFACES IN SUPERCOLLIDER = Graphic User Interfaces (GUI) in SuperCollider