File tree Expand file tree Collapse file tree 3 files changed +392
-386
lines changed Expand file tree Collapse file tree 3 files changed +392
-386
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,10 @@ p5.prototype.getAudioContext = getAudioContext;
6
6
p5 . prototype . userStartAudio = userStartAudio ;
7
7
8
8
import './master' ;
9
- import './helpers' ;
9
+
10
+ import { freqToMidi } from './helpers' ;
11
+ p5 . prototype . freqToMidi = freqToMidi ;
12
+
10
13
import './errorHandler' ;
11
14
import './audioWorklet' ;
12
15
import './panner' ;
@@ -66,4 +69,5 @@ p5.AudioVoice = AudioVoice;
66
69
import MonoSynth from './monosynth' ;
67
70
p5 . MonoSynth = MonoSynth ;
68
71
69
- import './polysynth' ;
72
+ import PolySynth from './polysynth' ;
73
+ p5 . PolySynth = PolySynth ;
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ p5.prototype.sampleRate = function () {
27
27
* above Middle C is 440Hz
28
28
* @return {Number } MIDI note value
29
29
*/
30
- p5 . prototype . freqToMidi = function ( f ) {
30
+ export const freqToMidi = function ( f ) {
31
31
var mathlog2 = Math . log ( f / 440 ) / Math . log ( 2 ) ;
32
32
var m = Math . round ( 12 * mathlog2 ) + 69 ;
33
33
return m ;
You can’t perform that action at this time.
0 commit comments