c@37: c@37: program test; c@37: c@37: af = load may.stream.audiofile; c@37: plot = load may.plot; c@37: cm = load may.matrix.complex; c@37: mat = load may.matrix; c@37: vec = load may.vector; c@37: manipulate = load may.stream.manipulate; c@37: syn = load may.stream.syntheticstream; c@37: c@37: { cqt } = load cqt; c@37: c@37: //testStream = manipulate.withDuration 96000 (syn.sinusoid 48000 500); c@37: //testStream = manipulate.withDuration 96000 (syn.pulseTrain 48000 4); c@44: testStream = af.open "sweep-48000.wav"; c@37: //testStream = af.open "sweep.wav"; c@37: c@43: // So the stream is [ 0, 1, 0, -1, 0, 1, 0, -1, ... ] : c@44: //testStream = manipulate.withDuration 64 (syn.sinusoid 8 2); c@38: c@56: testStream = manipulate.withDuration 32 (syn.pulseTrain 8 0.001); c@37: c@37: eprintln "have test stream"; c@37: c@44: cq = cqt { maxFreq = testStream.sampleRate/2, minFreq = 50, binsPerOctave = 24 } testStream; c@37: c@40: eprintln "bin frequencies: \(cq.kernel.binFrequencies)"; c@40: c@41: /* c@40: for cq.output do c: c@37: mm = cm.magnitudes c; c@37: for (mat.asColumns mm) (println . strJoin "," . vec.list); c@37: done; c@41: */ c@37: c@40: bigM = mat.concatHorizontal (map cm.magnitudes cq.output); c@37: c@38: eprintln "overall output size = \(mat.size bigM)"; c@38: c@39: mat.print bigM; c@38: c@38: //\() (plot.plot [Contour bigM]); c@56: \() (plot.plot [Grid bigM]); c@37: c@37: () c@37: