-
-
Notifications
You must be signed in to change notification settings - Fork 682
/
app.js
155 lines (118 loc) · 3.61 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
import 'audioworklet-polyfill';
import './shims';
import { getAudioContext, userStartAudio } from './audiocontext';
p5.prototype.getAudioContext = getAudioContext;
p5.prototype.userStartAudio = userStartAudio;
import './main';
import {
sampleRate,
freqToMidi,
midiToFreq,
noteToFreq,
soundFormats,
disposeSound,
_checkFileFormats,
_mathChain,
convertToWav,
interleave,
writeUTFBytes,
safeBufferSize,
saveSound,
} from './helpers';
p5.prototype.sampleRate = sampleRate;
p5.prototype.freqToMidi = freqToMidi;
p5.prototype.midiToFreq = midiToFreq;
p5.prototype.noteToFreq = noteToFreq;
p5.prototype.soundFormats = soundFormats;
p5.prototype.disposeSound = disposeSound;
p5.prototype._checkFileFormats = _checkFileFormats;
p5.prototype._mathChain = _mathChain;
p5.prototype.convertToWav = convertToWav;
p5.prototype.interleave = interleave;
p5.prototype.writeUTFBytes = writeUTFBytes;
p5.prototype.safeBufferSize = safeBufferSize;
p5.prototype.saveSound = saveSound;
// register removeSound to dispose of p5sound SoundFiles, Convolvers,
// Oscillators etc when sketch ends
p5.prototype.registerMethod('remove', p5.prototype.disposeSound);
import './errorHandler';
import './audioWorklet';
import Panner from './panner';
p5.Panner = Panner;
import SoundFile, { loadSound } from './soundfile';
p5.SoundFile = SoundFile;
p5.prototype.loadSound = loadSound;
// register preload handling of loadSound
p5.prototype.registerPreloadMethod('loadSound', p5.prototype);
import Amplitude from './amplitude';
p5.Amplitude = Amplitude;
import FFT from './fft';
p5.FFT = FFT;
import Oscillator, { SinOsc, TriOsc, SawOsc, SqrOsc } from './oscillator';
p5.Oscillator = Oscillator;
p5.SinOsc = SinOsc;
p5.TriOsc = TriOsc;
p5.SawOsc = SawOsc;
p5.SqrOsc = SqrOsc;
import './envelope';
import Noise from './noise';
p5.Noise = Noise;
import Pulse from './pulse';
p5.Pulse = Pulse;
import AudioIn from './audioin';
p5.AudioIn = AudioIn;
import Effect from './effect';
p5.Effect = Effect;
import Filter, { LowPass, HighPass, BandPass } from './filter';
p5.Filter = Filter;
p5.LowPass = LowPass;
p5.HighPass = HighPass;
p5.BandPass = BandPass;
import EQ from './eq';
p5.EQ = EQ;
import Listener3D from './listener3d';
p5.Listener3D = Listener3D;
import Panner3D from './panner3d';
p5.Panner3D = Panner3D;
import Delay from './delay';
p5.Delay = Delay;
import { Reverb, Convolver, createConvolver } from './reverb';
p5.Reverb = Reverb;
p5.Convolver = Convolver;
p5.prototype.createConvolver = createConvolver;
p5.prototype.registerPreloadMethod('createConvolver', p5.prototype);
import Metro from './metro';
p5.Metro = Metro;
import { Phrase, Part, Score } from './looper';
p5.Phrase = Phrase;
p5.Part = Part;
p5.Score = Score;
import SoundLoop from './soundLoop';
p5.SoundLoop = SoundLoop;
import Compressor from './compressor';
p5.Compressor = Compressor;
import peakDetect from './peakDetect';
p5.peakDetect = peakDetect;
import SoundRecorder from './soundRecorder';
p5.SoundRecorder = SoundRecorder;
import Distortion from './distortion';
p5.Distortion = Distortion;
import Gain from './gain';
p5.Gain = Gain;
import Envelope from './envelope';
p5.Envelope = Envelope;
import Env from './deprecations/Env';
p5.Env = Env;
import AudioVoice from './audioVoice';
p5.AudioVoice = AudioVoice;
import MonoSynth from './monosynth';
p5.MonoSynth = MonoSynth;
import OnsetDetect from './onsetDetect';
p5.OnsetDetect = OnsetDetect;
import PolySynth from './polysynth';
p5.PolySynth = PolySynth;
import PeakDetect from './peakDetect';
p5.PeakDetect = PeakDetect;
// Following are the deprecated classes
import Signal from './deprecations/Signal';
p5.Signal = Signal;