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@72: minFreq = 27.5; c@72: maxRateDivisor = 3; c@72: binsPerOctave = 60; c@72: c@66: plotfile f = c@66: (testStream = af.open f; c@66: eprintln "Opened file stream..."; c@72: start = System#currentTimeMillis(); c@66: cq = cqt { c@72: maxFreq = testStream.sampleRate/maxRateDivisor, c@72: minFreq, c@72: binsPerOctave c@66: } testStream; c@72: middle = System#currentTimeMillis(); c@72: eprintln "Generated kernel \(cm.size cq.kernel.kernel) and primed transform (\(cq.octaves) octaves), took \(middle-start)ms, now calculating..."; c@80: bigM = mat.concatHorizontal cq.cqSpectrogram; c@72: finish = System#currentTimeMillis(); c@72: eprintln "Done, that part took \(finish-middle)ms, all CQ stuff took \(finish-start)ms"; c@66: eprintln "Plotting..."; c@66: \() (plot.plot [Contour bigM])); c@66: c@66: usage () = c@66: (eprintln "\nUsage: plotfile file.wav"; c@72: eprintln "\n Loads audio from file.wav and plots a \(binsPerOctave)bpo Constant-Q spectrogram"; c@72: eprintln " from \(minFreq)Hz up to 1/\(maxRateDivisor) of the file samplerate"); c@66: c@66: case (list _argv) of c@66: file::[]: plotfile file; c@66: _: usage (); c@66: esac; c@66: