This file is indexed.

/usr/share/SuperCollider/HelpSource/Classes/TDuty.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
class:: TDuty
summary:: Demand results as trigger from demand rate UGens.
related:: Classes/Demand, Classes/Duty
categories::  UGens>Demand


Description::

A value is demanded each UGen in the list and output as a trigger
according to a stream of duration values. The unit generators in the list
should be 'demand' rate.


When there is a trigger at the reset input, the demand rate UGens in the
list and the duration are reset. The reset input may also be a demand
UGen, providing a stream of reset times.


classmethods::

method::ar, kr

argument::dur

Time values. Can be a demand UGen or any signal. The next trigger
value is acquired after duration.


argument::reset

Trigger or reset time values. Resets the list of UGens and the
duration UGen when triggered. The reset input may also be a
demand UGen, providing a stream of reset times.


argument::level

Demand UGen providing the output values.


argument::doneAction

A doneAction that is evaluated when the duration stream ends. See

link::Reference/UGen-doneActions::  for more detail.


argument::gapFirst
when 0 (default), the UGen does the first level poll immediately and then waits for the first durational value. When this is 1, the UGen initially polls the first durational value, waits for that duration, and then polls the first level (along with polling the next durational value). So gapFirst > 0 makes TDuty behave like link::Classes/TDuty_old::.

Examples::

code::

// examples

s.boot;


// play a little rhythm

{ TDuty.ar(Dseq([0.1, 0.2, 0.4, 0.3], inf)) }.play; // demand ugen as durations



// amplitude changes
(
	{
		var trig;
		trig = TDuty.ar(
				Dseq([0.1, 0.2, 0.4, 0.3], inf), // demand ugen as durations
				0,
				Dseq([0.1, 0.4, 0.01, 0.5, 1.0], inf) // demand ugen as amplitude
			);
		Ringz.ar(trig, 1000, 0.1)

	}.play;
)

(
	{
		var trig;
		trig = TDuty.ar(
				MouseX.kr(0.001, 2, 1), // control rate ugen as durations
				0,
				Dseq([0.1, 0.4, 0.01, 0.5, 1.0], inf)
			);
		Ringz.ar(trig, 1000, 0.1)

	}.play;
)




// demand ugen as audio oscillator

(
	{
		var a, trig, n=5, m=64;
		a = {
			var x;
			x = { 0.2.rand2 } ! m;
			x = x ++ ({  Drand({ 0.2.rand2 } ! n) } ! m.rand);
			Dseq(x.scramble, inf)
		} ! n;
		trig = TDuty.ar(
				MouseX.kr(1, 2048, 1) * SampleDur.ir * [1, 1.02],
				0,
				Dswitch1(a, MouseY.kr(0, n-1))
			);
		Ringz.ar(trig, 1000, 0.01)

	}.play;
)


// single impulses

(
SynthDef("delta_demand", { arg amp=0.5, out;
	OffsetOut.ar(out,
		TDuty.ar(Dseq([0]), 0, amp, 2)
	)
}).add;
)

fork { 10.do { s.sendBundle(0.2, ["/s_new", "delta_demand", -1]); 1.0.rand.wait } };


// chain of impulses
(
SynthDef("delta_demand2", {
	OffsetOut.ar(0,
		TDuty.ar(Dgeom(0.05, 0.9, 20), 0, 0.5, 2)
	)
}).add;
)

fork { 10.do { s.sendBundle(0.2, ["/s_new", "delta_demand2", -1]); 1.0.rand.wait } };



// multichannel expansion

(
	{
		var t;
		t = TDuty.ar(
				Drand([Dgeom(0.1, 0.8, 20), 1, 2], inf) ! 2,
				0,
				[Drand({ 1.0.rand } ! 8, inf), Dseq({ 1.0.rand } ! 8, inf)] * 2
			);
		x = Ringz.ar(t, [400, 700], 0.1) * 0.1;

	}.play;
)

::