Mercurial > hg > constant-q-cpp
annotate misc/yeti/experiment.yeti @ 196:da283326bcd3 tip master
Update plugin versions in RDF
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Fri, 28 Feb 2020 09:43:02 +0000 |
parents | 6deec2a51d13 |
children |
rev | line source |
---|---|
c@116 | 1 |
c@116 | 2 program experiment; |
c@116 | 3 |
c@116 | 4 af = load may.stream.audiofile; |
c@116 | 5 plot = load may.plot; |
c@116 | 6 cm = load may.matrix.complex; |
c@116 | 7 mat = load may.matrix; |
c@116 | 8 vec = load may.vector; |
c@116 | 9 manipulate = load may.stream.manipulate; |
c@116 | 10 syn = load may.stream.syntheticstream; |
c@116 | 11 |
c@116 | 12 { cqt } = load cqt; |
c@116 | 13 { icqt } = load icqt; |
c@116 | 14 |
c@116 | 15 //testStream = manipulate.withDuration 96000 (syn.sinusoid 48000 500); |
c@116 | 16 //testStream = manipulate.withDuration 96000 (syn.pulseTrain 48000 4); |
c@116 | 17 testStream = af.open "sweep-48000.wav"; |
c@116 | 18 //testStream = af.open "sweep.wav"; |
c@116 | 19 |
c@116 | 20 eprintln "have test stream"; |
c@116 | 21 |
c@116 | 22 cq = cqt { maxFreq = testStream.sampleRate/2, minFreq = 50, binsPerOctave = 24 } testStream; |
c@116 | 23 |
c@116 | 24 eprintln "bin frequencies: \(cq.kernel.binFrequencies)"; |
c@116 | 25 |
c@116 | 26 icq = icqt cq; |
c@116 | 27 |
c@116 | 28 eprintln "calculated icq..."; |
c@116 | 29 |
c@116 | 30 outfile = "test-output.wav"; |
c@116 | 31 written = af.write icq outfile; |
c@116 | 32 |
c@116 | 33 eprintln "wrote \(written) to \(outfile)"; |
c@116 | 34 |
c@116 | 35 //for cq.cqSpectrogram do mm: |
c@116 | 36 // for (mat.asColumns mm) (println . strJoin "," . vec.list); |
c@116 | 37 //done; |
c@116 | 38 |
c@116 | 39 /* |
c@116 | 40 bigM = mat.concatHorizontal (map cm.magnitudes cq.output); |
c@116 | 41 |
c@116 | 42 eprintln "overall output size = \(mat.size bigM)"; |
c@116 | 43 |
c@116 | 44 mat.print bigM; |
c@116 | 45 */ |
c@116 | 46 //\() (plot.plot [Contour bigM]); |
c@116 | 47 //\() (plot.plot [Grid bigM]); |
c@116 | 48 |
c@116 | 49 () |
c@116 | 50 |