# HG changeset patch # User Chris Cannam # Date 1392387877 0 # Node ID 3d165bf186f19b251fe05d185a2b5a77215883fc # Parent bb1799a6d6902e50538b4b42cfd9ed5e150fe047 Add little program to plot cq of an audio file diff -r bb1799a6d690 -r 3d165bf186f1 yeti/plotfile.yeti --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/yeti/plotfile.yeti Fri Feb 14 14:24:37 2014 +0000 @@ -0,0 +1,33 @@ + +program plotfile; + +af = load may.stream.audiofile; +plot = load may.plot; +cm = load may.matrix.complex; +mat = load may.matrix; + +{ cqt } = load cqt; + +plotfile f = + (testStream = af.open f; + eprintln "Opened file stream..."; + cq = cqt { + maxFreq = testStream.sampleRate/2, + minFreq = 50, + binsPerOctave = 24 + } testStream; + eprintln "Generated kernel and primed transform, now calculating..."; + bigM = mat.concatHorizontal (map cm.magnitudes cq.output); + eprintln "Plotting..."; + \() (plot.plot [Contour bigM])); + +usage () = + (eprintln "\nUsage: plotfile file.wav"; + eprintln "\n Loads audio from file.wav and plots a 24bpo Constant-Q spectrogram"; + eprintln " from 50Hz up to half the file samplerate"); + +case (list _argv) of +file::[]: plotfile file; +_: usage (); +esac; + diff -r bb1799a6d690 -r 3d165bf186f1 yeti/test.yeti --- a/yeti/test.yeti Fri Feb 14 11:55:03 2014 +0000 +++ b/yeti/test.yeti Fri Feb 14 14:24:37 2014 +0000 @@ -1,22 +1,8 @@ program test; -/* -af = load may.stream.audiofile; -plot = load may.plot; -cm = load may.matrix.complex; -mat = load may.matrix; -vec = load may.vector; -win = load may.signal.window; -mm = load may.mathmisc; -manipulate = load may.stream.manipulate; -syn = load may.stream.syntheticstream; -*/ { runTests } = load may.test; -//{ makeKernel } = load cqtkernel; -//{ cqt } = load cqt; - // We want to test: // // Kernel design -- check size (number of bins, number of atoms);