![]() Var w, h = 400, v = 400, seed = ed, run = true There are screen drawing facilities using the Pen class There is a MovieView too, but it doesn't work particularly well. (credit: many of the GUI objects were introduced into SuperCollider by Jan Trutzschler. Note that there may be differences between 3.5 and 3.6 in what is available. There are also interesting help files for many other GUI objects. W.corator = f = FlowLayout(w.view.bounds) You can command click on a control to drag its value to another control for cocoa, or control click for swing create a GUI window with some NumberBoxes. Warning: some examples may not use the more recent implementation free formulation, and involve different calls. open("examples/GUI examples/GUI_examples2.scd" ) open("examples/GUI examples/GUI_examples1.scd" ) open( "examples/GUI examples/GUI_examples1.scd" ) //on a Mac with SC3.5 or earlier this should open it straight awayĭocument. W.refresh //refresh updates the appearance of the window and the slider disappearsįor demos of Drag and Drop and other UI facilities see the examples/GUI examples folderĭocument. W. //nothing happens visually immediately W.view.children //slider should be in the list, even though we didn't store any reference to the slider object in a global variable (like w) ourselves You can dynamically add and remove views from a window. How does this give the different grid positions as div for integer division, try the code in isolation: if worried by the use of % for modulo and. Slid= Slider (w, Rect (10,10,180,40)) //a basic slider object of size 180 by 40 appears 10 pixels in from the left, and 10 pixels down from the top A 200 by 100 window appears at screen co-ordinates (100, 500) However, this time the co-ordinates are no longer relative to the screen, but relative to the top left corner of the window, and x and y positions indicate distance from left and from top respectively. We pass in the window we wish the control to appear in and use a Rect again to specify where in the window the control will appear and how large it is. We add controls to our window, defining any parameters of their use. Note that we count on the y axis from screen origin at bottom left, to the bottom left corner of the window. W.front //this line is needed to make the window actually appear A 200 by 200 window appears at screen co-ordinates (100, 500) as screenx, screeny, windowwidth, windowheight, where screeny is 0 at the bottom The Rect(angle) takes the initial screen position and the window size make sure SwingOSC server is running if you are using that, before you run any GUI code: swing //will only work if SwingOSC is installed, see instructions with SwingOSC Test which GUI library you are using by default: On OS X, a native Cocoa implementation is built into the standard language environment for SC3.5 and earlier. You can call the standard cross-platform GUI class names, like Slider, Window, View, without worrying about which of qt, Cocoa or SwingOSC is operative.īoth qt and SwingOSC act like servers, sending and receiving messages from the language app. Historically, there are also OS X ('cocoa') specific classes (usually with prefix SC before the class names used here) and SwingOSC ('swing') Java cross platform classes (usually with prefix JSC). Just in case you want to know more about the implementation:īecause GUIs tend to be quite operating system specific, under the surface, there are different main GUI implementations available.įrom SC 3.6, the standard GUI library is qt. There may be slight differences between versions of SuperCollider on the available GUI capabilities. This file will use code which should work on all platforms without any worry about the underlying implementation (SC 3.3.1 on). GUI classes include various forms of slider, buttons, dials, drop down lists, drag and drop facilities and many more custom views. They are a convenient way to create custom virtual synths, and package up novel programs for ourselves and other users. Graphical user interface capabilities in SC let us build frontends for our computer music projects. Graphical User Interface Classes for SuperCollider
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |