-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsclog.txt
More file actions
129 lines (89 loc) · 6.11 KB
/
sclog.txt
File metadata and controls
129 lines (89 loc) · 6.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
sclog
=====
Author: Ioannis Zannos
Date: 2011-05-10 13:55:28 EEST
Table of Contents
=================
* DONE Summary of ideas in this lib :doc:
CLOSED: [2011-05-10 Tue 13:55]
+ ServerPrep
- Obviate the need to boot the server when starting synths
- Ensure that Buffers and SynthDefs are allocated / sent to the server
before starting synths, efficiently.
- Provide a safe way for starting synth and routine processes when the server boots
or when the tree is inited, ensuring that SynthDefs and Buffers will be loaded first
Classes involved:
- ServerPrep
- ServerActionLoader
- SynthLoader
- DefLoader
- BufLoader
- RoutineLoader
- UniqueBuffer
- Udef
+ UniqueSynth
- Simplify the creation and control of Synths by storing them in a dictionary
for later access, and by providing utility methods for controlling the duration
and release time, for synchronizing the execution and life time of routines
pertaining to a synth, and for attaching other objects that react to the
start and end of a synth.
Example of how UniqueSynth can simplify the code required:
Without Symbol:mplay
(
{
loop {
{ var synth;
synth = Synth(\default, [\freq, (25..50).choose.midicps]);
0.1.wait;
synth.release(exprand(0.01, 1.0));
}.fork;
[0.1, 0.2].choose.wait;
};
}.fork;
)
Using Symbol:mplay
(
{
loop {
\default.mplay([\freq, (25..50).choose.midicps]).dur(0.1, exprand(0.01, 1.0));
[0.1, 0.2].choose.wait;
};
}.fork;
)
+ EventStream, Function:sched and Function:stream
Simplify the creation and access of Streams from Patterns and their use with Routines and Functions scheduled for repeated execution.
Example: Simplify the above code even further, while enabling control of dtime (and any other parameters) via patterns:
(
{ // Symbol:stream creates and / or accesses the stream as appropriate:
\default.mplay([\freq, \freq.prand((25..50), inf).midicps]).dur(0.1, exprand(0.01, 1.0));
\duration.stream(Prand([0.1, 0.2], 20)); // play 20 events only
}.stream;
)
Note: symbol.stream(Prand(...)) is equivalent to \symbol.prand(...)
+ Object methods for easy messaging via NotificationCenter
Simplify the connection of objects for sending messages to each other via NotificationCenter. Automate the creation of mutual NotificationCenter registrations to messages, and their removal when an object receives the message objectClosed.
One beneficial effect of this is that it is no longer needed to check whether an object stored in a variable is nil in order to decide whether to send it a message. One can create messaging interconnections between objects without storing one in a variable of the other, and one can safely send a message to an object before it is created or after it is no longer a valid receiver of that message.
+ Code
Enable the selection of parts of a SuperCollider document separated by comments followed by :, the movement between such parts, and the execution of those parts through keyboard shortcuts. Additionally, wrap these code parts in a routine so that number.wait messages can be written straight in the code, without wrapping them in { }.fork or Routine({ }).
Also ensure that the code will run after the default server is booted and the Buffers and SynthDefs defined as Udefs in a Session have been loaded.
Shortcuts provided are:
Command-shift-x: Evaluate the code in an AppClock routine, after booting the default server if needed
Command-shift-alt-x: Evaluate the code in a SystemClock routine, after booting the default server if needed
Command-shift-v: Evaluate and post the results of the code, without routine or server booting
Command-shift-j: Select the next code part
Command-shift-k: Select the previous code part
+ Panes
Arrange Document windows on the screen conveniently for maximum view area on the screen. Provide 2 layouts: single pane and 2 panes side by side, with keyboard shortcuts for switching between them. Provide an auto-updating document list palette for selecting documents by mouse or by string search. Provide a way for switching between a dark colored document theme and the default document theme via keyboard shortcuts, with automatic updating of the coloring of all relevant documents.
+ Dock
Provide some useful shortcuts for common tasks:
browseUserClasses : Open a list of all classes defined in the user's Application Support
directory. Typing return on a selected item opens the code file with the definition of this class.
insertClassHelpTemplate : Insert a template for documenting a class named after the name of the
document. Inserts listings of superclasses, class and instance variables and methods.
openCreateHelpFile : Open a help file for a selected user class. Automatic creation of the file
is reserved to code residing outside the distribution files of this library.
showDocListWindow : An auto-updating window listing all open Documents, with selection by mouse click
or by text search.
closeDocListWindow : Close the document list window
+ Spectrograph
An example application showing some of the features of this library. Creates a window showing a live running spectrogram of one of the audio channels. The fft polling process for the spectrogram is persistent, that is, it starts as soon as the server boots and re-starts if the server's processes are killed by Command-. It (optionally) stops when the Spectrograph window is closed.