plugin v1.0.0
This commit is contained in:
1 parent
12c5b55bce
commit
44fce48bb5
12 files changed
+1316
-635
No files matched your search
@@ -0,0 +1,49 @@
|
||||
import * as Tone from "https://esm.sh/tone";
|
||||
|
||||
export class Lb302 {
|
||||
constructor(toneContext, data = {}) {
|
||||
this.params = data.lb302 || data || {};
|
||||
|
||||
// O som clássico do 303 é Sawtooth ou Square com filtro ressonante
|
||||
const wave = this.params.wave === 1 ? "square" : "sawtooth";
|
||||
|
||||
this.synth = new Tone.MonoSynth({
|
||||
oscillator: { type: wave },
|
||||
envelope: {
|
||||
attack: 0.01,
|
||||
decay: 0.3,
|
||||
sustain: 0.1,
|
||||
release: 0.2
|
||||
},
|
||||
filterEnvelope: {
|
||||
attack: 0.01,
|
||||
decay: 0.3,
|
||||
sustain: 0.1,
|
||||
release: 0.2,
|
||||
baseFrequency: 200,
|
||||
octaves: 4,
|
||||
exponent: 2
|
||||
},
|
||||
filter: {
|
||||
Q: 6, // Alta ressonância (o "grito" do acid)
|
||||
type: "lowpass",
|
||||
rolloff: -24
|
||||
}
|
||||
});
|
||||
|
||||
this.output = this.synth;
|
||||
}
|
||||
|
||||
triggerAttackRelease(note, duration, time) {
|
||||
// O LB302 é monofônico, mas aceita trigger normal
|
||||
this.synth.triggerAttackRelease(note, duration, time);
|
||||
}
|
||||
|
||||
connect(dest) {
|
||||
this.output.connect(dest);
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this.synth.dispose();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user