c@66: c@66: program plotfile; c@66: c@66: af = load may.stream.audiofile; c@66: plot = load may.plot; c@66: cm = load may.matrix.complex; c@66: mat = load may.matrix; c@66: c@66: { cqt } = load cqt; c@66: c@66: plotfile f = c@66: (testStream = af.open f; c@66: eprintln "Opened file stream..."; c@66: cq = cqt { c@66: maxFreq = testStream.sampleRate/2, c@66: minFreq = 50, c@66: binsPerOctave = 24 c@66: } testStream; c@66: eprintln "Generated kernel and primed transform, now calculating..."; c@66: bigM = mat.concatHorizontal (map cm.magnitudes cq.output); c@66: eprintln "Plotting..."; c@66: \() (plot.plot [Contour bigM])); c@66: c@66: usage () = c@66: (eprintln "\nUsage: plotfile file.wav"; c@66: eprintln "\n Loads audio from file.wav and plots a 24bpo Constant-Q spectrogram"; c@66: eprintln " from 50Hz up to half the file samplerate"); c@66: c@66: case (list _argv) of c@66: file::[]: plotfile file; c@66: _: usage (); c@66: esac; c@66: