File: PitchShift.schelp

package info (click to toggle)
supercollider 1%3A3.13.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 80,292 kB
  • sloc: cpp: 476,363; lisp: 84,680; ansic: 77,685; sh: 25,509; python: 7,909; makefile: 3,440; perl: 1,964; javascript: 974; xml: 826; java: 677; yacc: 314; lex: 175; objc: 152; ruby: 136
file content (100 lines) | stat: -rw-r--r-- 1,917 bytes parent folder | download | duplicates (4)
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
class:: PitchShift
summary:: Time domain pitch shifter.
categories::  UGens>Filters>Pitch


Description::

A time domain granular pitch shifter. Grains have a triangular amplitude
envelope and an overlap of 4:1, and use linear interpolation of the buffer.


classmethods::

method::ar

argument::in

The input signal.


argument::windowSize

The size of the grain window in seconds. This value cannot be
modulated. The minimum value is 3 sample periods. If you supply a smaller
value, it will be rounded up to the minimum.


argument::pitchRatio

The ratio of the pitch shift. Must be from 0 to 4.


argument::pitchDispersion

The maximum random deviation of the pitch from the

code::pitchRatio:: .


argument::timeDispersion

A random offset of from zero to

code::timeDispersion::  seconds is added to the
delay of each grain. Use of some dispersion can alleviate a hard
comb filter effect due to uniform grain placement. It can also be
an effect in itself.
code::timeDispersion::  can be
no larger than
code::windowSize:: .


argument::mul

Output will be multiplied by this value.


argument::add

This value will be added to the output.


Examples::

code::

(
play({
	z = Blip.ar(800, 6, 0.1);
	PitchShift.ar(z, 0.02, Line.kr(0.1,4,20), 0, 0.0001)
}))

(
// pitch shift input - USE HEADPHONES to prevent feedback.
play({
	PitchShift.ar(
		SoundIn.ar([0, 1]),	// stereo audio input
		0.1, 			// grain size
		MouseX.kr(0,2),	// mouse x controls pitch shift ratio
		0, 				// pitch dispersion
		0.004			// time dispersion
	)
}))

(
// use PitchShift to granulate input - USE HEADPHONES to prevent feedback.
// upper left corner is normal playback. x = pitch dispersion, y = time dispersion
var grainSize;
grainSize = 0.5;
play({
	PitchShift.ar(
		SoundIn.ar([0, 1]),
		grainSize,
		1,						// nominal pitch rate = 1
		MouseX.kr(0,1), 			// pitch dispersion
		MouseY.kr(0, grainSize)	// time dispersion
	)
}))

::