This file is indexed.

/usr/share/SuperCollider/HelpSource/Classes/Stethoscope.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
CLASS:: Stethoscope
summary:: An oscilloscope
categories:: GUI>Interfaces
related:: Classes/ScopeView, Classes/FreqScope

DESCRIPTION::

Stethoscope provides a complete oscilloscope GUI. It displays a window containing a bus-plotting link::Classes/ScopeView:: and an interface to configure the plotting and choose among the buses.

SUBSECTION:: Creation by message .scope

Several classes provide a convenient 'scope' method that creates a Stethoscope to display their data. See for example: link::Classes/Server#-scope::, link::Classes/Bus#-scope::, link::Classes/Function#-scope::.

SUBSECTION:: Keyboard shortcuts

The following keyboard shortcuts may be used when focused on the Stethoscope display:

table::
## strong::Shortcut:: || strong::Action::
## J || one channel back
## K || switch rate (audio vs. control)
## L || one channel forward
## O || jump to first hardware output channel and adjust numChannels to hardware
## I || jump to first hardware input channel and adjust numChannels to hardware
## space || run, if not running already
## . (period) || stop
## M || toggle screen size
## + / - || zoom horizontally
## * / _ || zoom vertically
## S || change style between parallel and overlay
## Shift+S || change style to lissajou
## Shift+A || allocate buffer size so it fills the screen (to next power of two) (this can be dangerous, might crash)
::

CLASSMETHODS::

PRIVATE:: key

METHOD:: new

    Create a Stethoscope, either as a window, or placed on a given parent view.

    argument:: server
        A valid Server (either a local or the internal server), or code::nil::, in which case the code::Server.default:: is used.
    argument:: numChannels
        An integer. Default value is 2.
    argument:: index
        The offset index. An Integer. Default is nil.
    argument:: bufsize
        The size of the analysis buffer. Default is 4096. See also link::#-bufsize::.
    argument:: zoom
        Horizontal magnification of the displayed wave. Default is 1. See also link::#-xZoom::.
    argument:: rate
        \audio or \control. Default is \audio.
    argument:: view
        The optional parent view. Default is nil. If nil, then it will open in its own Window.
    argument:: bufnum
        The id number of the Buffer to analyze. Default value is nil. If nil, then a Buffer of size bufSize is allocated.

    discussion:
    Example:
code::
s.boot
{SinOsc.ar([330,440], 0, 0.4)}.play;
Stethoscope(s,2);
::


METHOD:: isValidServer

    Tests whether Stethoscope can operate on the given server (any local server. See link::Classes/Server#-isLocal::).

    argument::
        A link::Classes/Server::.
    returns::
        A Boolean.

METHOD:: ugenScopes

    Returns an array of the running ugen scopes.

code::
s.boot
{[SinOsc.ar.scope,WhiteNoise.ar(0.5).scope]*0.1}.scope(2);
Stethoscope.ugenScopes; // returns the ugen scopes
::

METHOD:: tileBounds

    A utility method used by link::Classes/UGen#-scope:: to tile scope windows.

    returns::
        A Rect.



INSTANCEMETHODS::


SUBSECTION:: Data

METHOD:: server
    The server on which the scope operates.

METHOD:: rate
    Whether to operate on audio or control busses.
    argument::
        One of the two symbols: code::\audio:: or code::\control::.

METHOD:: index
    The starting index of the busses to scope.
    argument::
        An Integer.

METHOD:: numChannels
    The amount of adjacent busses to scope (from link::#-index:: on).
    argument::
        An Integer.

METHOD:: bufsize
   Defines the maximum allowed link::#-cycle::.

METHOD:: cycle
    note:: Only available in Qt GUI ::

    The exact scoping period, in signal frames. Reciprocal to what is also known as emphasis::sweep speed:: in analog oscilloscopes. It is dynamically adjustable while the scope is running.

    Data from scoped signals will be accumulated into a buffer until it reaches code::cycle:: amount frames, at which point the buffering will immediately restart. The view will repeatedly display the entire buffer; it may skip a cycle if the drawing is too slow to keep up with the speed of incoming data, but the cycle boundaries will never shift with respect to signals.

    If you are scoping a periodic signal, setting code::cycle:: to match the signal's period will keep the waveform locked in place.

SUBSECTION:: Display

METHOD:: window
    The (parent) Window of the scope.

METHOD:: size
    Sets the width and the height of the scope window.
    argument::
        An Integer (the window is square).

METHOD:: toggleSize

    Toggle between small and large size.

METHOD:: zoom
    A synonym for link::#-xZoom::.

METHOD:: xZoom
    Magnifies the displayed wave horizontally to the given factor.

    This sets link::#-cycle:: to code::1024 * xZoom.reciprocal::.

    argument::
        A Float.

METHOD:: yZoom
    Magnifies the displayed wave vertically to the given factor.

    argument::
        A Float.

METHOD:: style
    The plotting style:
    list::
    ## 0 = the channels are vertically spaced
    ## 1 = the channels are overlaid
    ## 2 = lissajou; the first two channels are used for 2D plotting (as streams of x and y coordinates).
    ::

    argument::
        One of the above Integers.


SUBSECTION:: Operation

METHOD:: run

    Starts the scope, if not already running.

METHOD:: quit

    Closes the window, and cleans up any used synths and buffers.

SUBSECTION:: Convenience

METHOD:: setProperties

    Sets several properties at once: link::#-numChannels::, link::#-index::, link::#-bufsize::, link::#-zoom::, and link::#-rate::.



EXAMPLES::

SUBSECTION:: A step-by-step example
code::
s.boot;
(
{
    SinOsc.ar([225, 450, 900], 0, 0.2)
    + LPF.ar(
        LFPulse.ar(226 * [1, 2, 5],[0,0.1,0.1],0.2, 0.2),
        MouseX.kr(20, 10000, 1)
        )
}.scope;
)

// server.scope only changes the properies explicitly given:

s.scope(numChannels:5);
s.scope(index:12);
s.scope(zoom:4);
s.scope(index:0);

s.scopeWindow.size = 600;
s.scopeWindow.size = 222;

// scoping buses:

a = Bus.audio(s, 4);
{ WhiteNoise.ar(0.2.dup(4)) }.play(s, a);

a.scope;

c = Bus.control(s, 3);
{ WhiteNoise.kr(1.dup(4) * MouseX.kr) }.play(s, c);

c.scope;

// note that scoping control rate buses shows block size interpolation (this is due to the
// fact that ScopeOut.kr doesn't work yet.)
::

SUBSECTION:: Embedded use
You can pass your own view in to add a stethoscope to it:

code::
w = Window.new("my own scope", Rect(20, 20, 400, 500));
w.view.decorator = FlowLayout(w.view.bounds);
c = Stethoscope.new(s, view:w.view);
w.onClose = { c.free }; // don't forget this
w.front;
::