Skip to content

Commit a4735f2

Browse files
removing p5.signal from codebase (inital) (#576)
* removing p5.signal from codebase (inital) * add missing import Co-authored-by: Jason Sigal <[email protected]>
1 parent 2fd6a90 commit a4735f2

File tree

6 files changed

+9
-191
lines changed

6 files changed

+9
-191
lines changed

src/amplitude.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,6 @@ class Amplitude {
164164
p5sound.meter.connect(this._workletNode);
165165
}
166166

167-
// if it is a p5.Signal
168-
else if (source instanceof p5.Signal) {
169-
source.output.connect(this._workletNode);
170-
}
171167
// connect to the sound if it is available
172168
else if (source) {
173169
source.connect(this._workletNode);

src/app.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ p5.Amplitude = Amplitude;
5858
import FFT from './fft';
5959
p5.FFT = FFT;
6060

61-
import './signal';
62-
6361
import Oscillator, { SinOsc, TriOsc, SawOsc, SqrOsc } from './oscillator';
6462
p5.Oscillator = Oscillator;
6563
p5.SinOsc = SinOsc;

src/audioWorklet/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const moduleSources = [
66
];
77
const ac = p5sound.audiocontext;
88

9-
109
function loadAudioWorkletModules() {
1110
return Promise.all(
1211
moduleSources.map(function (moduleSrc) {

src/envelope.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -800,9 +800,7 @@ p5.Envelope.prototype.connect = function (unit) {
800800
//set the initial value
801801
unit.setValueAtTime(0, p5sound.audiocontext.currentTime);
802802
}
803-
if (unit instanceof p5.Signal) {
804-
unit.setValue(0);
805-
}
803+
806804
this.output.connect(unit);
807805
};
808806

src/pulse.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import Signal from 'Tone/signal/Signal';
2+
import Multiply from 'Tone/signal/Multiply';
3+
14
import p5sound from './master';
25
import Oscillator, { SawOsc } from './oscillator';
36

@@ -102,10 +105,11 @@ class Pulse extends Oscillator {
102105
this.dcGain.gain.value = 1.7 * (0.5 - this.w);
103106
} else {
104107
w.connect(this.dNode.delayTime);
105-
var sig = new p5.SignalAdd(-0.5); //repalce it with tones Signals Method
106-
sig.setInput(w);
107-
sig = sig.mult(-1);
108-
sig = sig.mult(1.7);
108+
let sig = new Signal(-0.5); //repalce it with tones Signals Method
109+
w.connect(sig);
110+
let mult1 = new Multiply(-1);
111+
let mult2 = new Multiply(1.7);
112+
sig = sig.connect(mult1).connect(mult2);
109113
sig.connect(this.dcGain.gain);
110114
}
111115
}

src/signal.js

Lines changed: 0 additions & 177 deletions
This file was deleted.

0 commit comments

Comments
 (0)