Skip to content

Commit 13e185a

Browse files
therewasaguyjvntf
authored andcommitted
monosynth_basic example uses mouse
1 parent dd4420b commit 13e185a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

examples/monosynth_basic/sketch.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ var monoSynth;
77

88
function setup() {
99
monoSynth = new p5.MonoSynth();
10+
11+
createCanvas(400, 400);
12+
text('press to play a random note at a random velocity', 20, 20);
1013
}
1114

12-
function keyPressed() {
15+
function mousePressed() {
1316
// pick a random midi note
1417
var midiVal = round( random(50,72) );
1518
monoSynth.triggerAttack(midiVal, random() );
1619
}
1720

18-
function keyReleased() {
21+
function mouseReleased() {
1922
monoSynth.triggerRelease();
20-
}
23+
}

src/oscillator.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ define(function (require) {
241241
// this.oscillator.frequency.cancelScheduledValues(now);
242242

243243
if (rampTime === 0) {
244-
// this.oscillator.frequency.cancelScheduledValues(now);
245244
this.oscillator.frequency.setValueAtTime(val, tFromNow + now);
246245
} else {
247246
if (val > 0 ) {

0 commit comments

Comments
 (0)