PureScript FFI bindings to @spotify/basic-pitch — a small TensorFlow.js model that transcribes audio into polyphonic note events (a whole chord at once, unlike monophonic pitch detection).
model <- loadModel (ModelPath "/model/model.json") -- once
notes <- transcribe defaultOptions model samples -- per recorded burst
chord = pitches notes -- :: Array MidiPitchsamples must be MONO Float32Array at sampleRate (22050 Hz). basic-pitch
processes a 2-second window, so feed it a recorded burst — resample mic audio to
sampleRate first.
bun install
spago test