File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -7,14 +7,17 @@ var monoSynth;
7
7
8
8
function setup ( ) {
9
9
monoSynth = new p5 . MonoSynth ( ) ;
10
+
11
+ createCanvas ( 400 , 400 ) ;
12
+ text ( 'press to play a random note at a random velocity' , 20 , 20 ) ;
10
13
}
11
14
12
- function keyPressed ( ) {
15
+ function mousePressed ( ) {
13
16
// pick a random midi note
14
17
var midiVal = round ( random ( 50 , 72 ) ) ;
15
18
monoSynth . triggerAttack ( midiVal , random ( ) ) ;
16
19
}
17
20
18
- function keyReleased ( ) {
21
+ function mouseReleased ( ) {
19
22
monoSynth . triggerRelease ( ) ;
20
- }
23
+ }
Original file line number Diff line number Diff line change @@ -241,7 +241,6 @@ define(function (require) {
241
241
// this.oscillator.frequency.cancelScheduledValues(now);
242
242
243
243
if ( rampTime === 0 ) {
244
- // this.oscillator.frequency.cancelScheduledValues(now);
245
244
this . oscillator . frequency . setValueAtTime ( val , tFromNow + now ) ;
246
245
} else {
247
246
if ( val > 0 ) {
You can’t perform that action at this time.
0 commit comments