You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-169Lines changed: 1 addition & 169 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,172 +42,4 @@ Effect list:
42
42
Usage
43
43
====
44
44
45
-
Start by creating a new Tuna object like so:
46
-
47
-
```javascript
48
-
var context =newAudioContext();
49
-
var tuna =newTuna(context);
50
-
```
51
-
52
-
You need to pass the audio context you're using in your application. Tuna will be using it to create its effects.
53
-
54
-
You create a new tuna node as such:
55
-
56
-
```javascript
57
-
var chorus =newtuna.Chorus({
58
-
rate:1.5,
59
-
feedback:0.2,
60
-
delay:0.0045,
61
-
bypass:0
62
-
});
63
-
```
64
-
You can then connect the tuna node to native Web Audio just as you would normally:
65
-
66
-
```javascript
67
-
var input =context.createGain();
68
-
var output =context.createGain();
69
-
gain.connect(chorus);
70
-
chorus.connect(output);
71
-
```
72
-
73
-
Tuna masquerades as a normal web audio node so you can
74
-
seamlessly connect with AudioNodes created by the AudioContext.
75
-
76
-
77
-
The nodes
78
-
====
79
-
80
-
A basic chorus effect.
81
-
```javascript
82
-
var chorus =newtuna.Chorus({
83
-
rate:1.5, //0.01 to 8+
84
-
feedback:0.2, //0 to 1+
85
-
delay:0.0045, //0 to 1
86
-
bypass:0//the value 1 starts the effect as bypassed, 0 or 1
87
-
});
88
-
```
89
-
90
-
A delay effect with feedback and a lowpass filter applied to the delayed signal.
91
-
```javascript
92
-
var delay =newtuna.Delay({
93
-
feedback:0.45, //0 to 1+
94
-
delayTime:150, //how many milliseconds should the wet signal be delayed?
95
-
wetLevel:0.25, //0 to 1+
96
-
dryLevel:1, //0 to 1+
97
-
cutoff:2000, //cutoff frequency of the built in lowpass-filter. 20 to 22050
98
-
bypass:0
99
-
});
100
-
```
101
-
102
-
A basic phaser effect.
103
-
```javascript
104
-
var phaser =newtuna.Phaser({
105
-
rate:1.2, //0.01 to 8 is a decent range, but higher values are possible
106
-
depth:0.3, //0 to 1
107
-
feedback:0.2, //0 to 1+
108
-
stereoPhase:30, //0 to 180
109
-
baseModulationFrequency:700, //500 to 1500
110
-
bypass:0
111
-
});
112
-
```
113
-
114
-
A basic overdrive effect.
115
-
```javascript
116
-
var overdrive =newtuna.Overdrive({
117
-
outputGain:0.5, //0 to 1+
118
-
drive:0.7, //0 to 1
119
-
curveAmount:1, //0 to 1
120
-
algorithmIndex:0, //0 to 5, selects one of our drive algorithms
121
-
bypass:0
122
-
});
123
-
```
124
-
125
-
A compressor with the option to use automatic makeup gain.
126
-
```javascript
127
-
var compressor =newtuna.Compressor({
128
-
threshold:0.5, //-100 to 0
129
-
makeupGain:1, //0 and up
130
-
attack:1, //0 to 1000
131
-
release:0, //0 to 3000
132
-
ratio:4, //1 to 20
133
-
knee:5, //0 to 40
134
-
automakeup:true, //true/false
135
-
bypass:0
136
-
});
137
-
```
138
-
139
-
A convolver with high- and lowcut. You can find a lot of impulse resonses <ahref="http://chromium.googlecode.com/svn/trunk/samples/audio/impulse-responses/">here</a>, or by searching for "free impulse response files".
140
-
```javascript
141
-
var convolver =newtuna.Convolver({
142
-
highCut:22050, //20 to 22050
143
-
lowCut:20, //20 to 22050
144
-
dryLevel:1, //0 to 1+
145
-
wetLevel:1, //0 to 1+
146
-
level:1, //0 to 1+, adjusts total output of both wet and dry
147
-
impulse:"impulses/impulse_rev.wav", //the path to your impulse response
0 commit comments