/usr/share/SuperCollider/HelpSource/Classes/SCEnvelopeEdit.schelp is in supercollider-common 1:3.8.0~repack-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | class:: SCEnvelopeEdit
summary:: An envelope editor view
categories:: GUI>Kits>Cocoa
related:: Classes/EnvelopeView
description::
An editable Envelope view.
subsection:: Some Important Issues Regarding SCEnvelopeEdit
The breakpoints are color coded as follows:
table::
## blue || normal
## red || sustain node
## green || loop node
::
classmethods::
method:: new
argument:: parent
The parent view.
argument:: bounds
An instance of link::Classes/Rect::, or a link::Classes/Point:: indicating code::width@height::.
argument:: env
The envelope. An instance of link::Classes/Env::.
argument:: pointsPerSegment
The resolution in points per segment. Default value is 10.
method:: paletteExample
argument:: parent
argument:: bounds
subsection:: Subclassing and Internal Methods
The following methods are usually not used directly or are called by a primitive. Programmers can still call or override these as needed.
method:: viewClass
instancemethods::
method:: refresh
If the link::Classes/Env:: object is modified directly, this needs to be called to update the GUI.
maxLevel
Changes maximum level shown in editor.
argument:: level
An instance of link::Classes/Float::.
method:: minLevel
Changes minimum level shown in editor.
argument:: level
An instance of link::Classes/Float::.
method:: minTime
Changes minimum time (sec) shown in editor. Negative times are okay because link::Classes/Env:: uses inter-node durations.
argument:: sec
An instance of link::Classes/Float::. Seconds.
method:: maxTime
Changes maximum time (sec) shown in editor.
argument:: sec
An instance of link::Classes/Float::. Seconds.
subsection:: Subclassing and Internal Methods
The following methods are usually not used directly or are called by a primitive. Programmers can still call or override these as needed.
method:: defaultMouseDownAction
argument:: x
argument:: y
argument:: modifiers
argument:: buttonNumber
argument:: clickCount
method:: env
argument:: e
method:: addBreakPoint
argument:: level
method:: insertAtTime
argument:: time
argument:: level
method:: pointsPerSegment
method:: initSCEnvelopeEdit
argument:: argEnv
argument:: argPPS
argument:: setMinMax
method:: redraw
method:: updateAll
method:: updateSegment
argument:: segNum
method:: clear
examples::
Make a basic editor:
code::
(
e = Env([1, 2], [10]);
w = Window("Env Editor", Rect(200, 200, 300, 200));
v = SCEnvelopeEdit(w, w.view.bounds.moveBy(20, 20).resizeBy(-40, -40), e, 20).resize_(5);
w.front;
)
v.addBreakPoint;
(
v.clear;
v.redraw;
v;
)
v.maxLevel_(2); // to give more headroom
v.maxTime_(2); // to increase release point
v.minTime_(-1); // to increase attack time
e.curves_('sin'); // env object is changed
v.refresh; // must refresh editor
::
Controlling a Synth
code::
s.boot;
(
e = Env([0, 1, 0.7, 0.9, 0], [0.03, 0.03, 0.03, 0.03], 'sin');
f = Env([0, 1, 0.7, 0.9, 0], [0.03, 0.03, 0.03, 0.03], 'sin');
w = Window("Shards", Rect(100, 100, 500, 400));
v = SCEnvelopeEdit(w, w.view.bounds.resizeBy(-20, -200), e, 10).resize_(2);
StaticText(w, v.bounds).string_(" amplitude").resize_(2);
x = SCEnvelopeEdit(w, v.bounds.moveBy(0, 200), f, 10).resize_(2);
StaticText(w, x.bounds).string_(" frequency").resize_(2);
w.front;
)
(
SynthDef("sineBlip", {
arg freq = 440, vol = 0.1, la0, la1, la2, la3, la4, ta0, ta1, ta2, ta3, crva,
lf0, lf1, lf2, lf3, lf4, tf0, tf1, tf2, tf3, crvf;
var signal, fenv, aenv;
fenv = EnvGen.ar(Env([lf0, lf1, lf2, lf3, lf4], [tf0, tf1, tf2, tf3], crvf));
aenv = EnvGen.ar(Env([la0, la1, la2, la3, la4], [ta0, ta1, ta2, ta3], crva), doneAction: 2);
signal = SinOsc.ar([freq, freq*2] * fenv) * aenv * vol;
Out.ar(0, signal.dup);
}).add;
)
(
Routine({
var par, indices;
indices = (2..21);
loop({
par = (indices +++ (
v.env.levels ++
v.env.times ++
v.env.curves ++
x.env.levels ++
x.env.times ++
x.env.curves)).flatten;
s.sendBundle(s.latency, [\s_new, "sineBlip", -1, 1, 1, \freq, exprand(4e3,11e3)] ++ par);
0.04.wait;
});
}).play;
)
::
|