├── tests ├── test-parse-errors │ ├── inputs │ │ ├── empty.ttl │ │ ├── empty.xml │ │ ├── valid-turtle-no-transform.ttl │ │ ├── invalid-turtle.ttl │ │ ├── garbage.dat │ │ ├── valid-xml-no-transform.xml │ │ └── invalid-xml.xml │ ├── expected │ │ ├── empty.xml.txt │ │ ├── empty.ttl.txt │ │ ├── valid-xml-no-transform.xml.txt │ │ ├── valid-turtle-no-transform.ttl.txt │ │ ├── garbage.dat.txt │ │ ├── invalid-turtle.ttl.txt │ │ └── invalid-xml.xml.txt │ └── test-parse-errors.sh ├── audio │ ├── playlist.m3u │ ├── remote-playlist.m3u │ ├── 3clicks.mp3 │ ├── 3clicks.ogg │ ├── 3clicks.opus │ ├── 3clicks8.wav │ ├── 6clicks.ogg │ ├── 6clicks8.wav │ ├── id3v2-ucs-2.mp3 │ ├── 20sec-silence.wav │ ├── 3clicks8quiet.wav │ └── id3v2-iso-8859-1.mp3 ├── test-summaries │ ├── expected │ │ ├── summaries-start-and-duration.csv │ │ ├── testplug-curve-vsr-sum.csv │ │ ├── testplug-curve-vsr-count.csv │ │ ├── testplug-curve-vsr-min.csv │ │ ├── testplug-curve-vsr-max.csv │ │ ├── testplug-grid-fsr-max.csv │ │ ├── testplug-grid-fsr-min.csv │ │ ├── summaries-segments.csv │ │ ├── testplug-curve-vsr-sd.csv │ │ ├── summaries-from-rdf-summaries-only.csv │ │ ├── summaries-from-rdf.csv │ │ ├── summaries-all-summaries-only.csv │ │ ├── summaries-playlist.csv │ │ ├── testplug-curve-vsr-mode.csv │ │ ├── testplug-curve-vsr-median.csv │ │ ├── testplug-curve-vsr-mean.csv │ │ ├── testplug-curve-vsr-variance.csv │ │ └── summaries-all-files.csv │ ├── transforms │ │ ├── segmentlist │ │ ├── detectionfunction-nosummaries.n3 │ │ └── detectionfunction.n3 │ └── test-summaries-testplugin.sh ├── test-transforms-basic │ ├── expected │ │ ├── percussiononsets-start-and-duration.csv │ │ ├── skeleton-1.csv │ │ ├── percussiononsets.csv │ │ ├── percussiononsets-no-parameters.csv │ │ ├── percussiononsets-set-sample-rate.csv │ │ ├── percussiononsets-set-step-and-block-size.csv │ │ ├── percussiononsets-no-parameters-default-output.csv │ │ ├── percussiononsets-set-parameters.csv │ │ └── multiple.csv │ ├── transforms │ │ ├── percussiononsets-no-parameters.xml │ │ ├── percussiononsets-no-parameters-default-output.xml │ │ ├── percussiononsets-set-sample-rate.xml │ │ ├── percussiononsets-set-step-and-block-size.xml │ │ ├── percussiononsets-set-parameters.xml │ │ ├── percussiononsets-no-parameters-default-output.n3 │ │ ├── percussiononsets-no-parameters.n3 │ │ ├── percussiononsets-df-windowtype-default.n3 │ │ ├── percussiononsets.xml │ │ ├── percussiononsets-df-windowtype-default.xml │ │ ├── percussiononsets-set-sample-rate.n3 │ │ ├── percussiononsets-start-and-duration.xml │ │ ├── percussiononsets-df-start-and-duration.xml │ │ ├── percussiononsets-df-windowtype-hamming.n3 │ │ ├── percussiononsets-df-windowtype-hamming.xml │ │ ├── percussiononsets-df-windowtype-hanning.n3 │ │ ├── percussiononsets-df-windowtype-hanning.xml │ │ ├── percussiononsets-set-step-and-block-size.n3 │ │ ├── percussiononsets-multiple-outputs.n3 │ │ ├── percussiononsets.n3 │ │ ├── percussiononsets-set-parameters.n3 │ │ ├── percussiononsets-multiple-outputs-start-and-duration.n3 │ │ ├── percussiononsets-start-and-duration.n3 │ │ └── percussiononsets-df-start-and-duration.n3 │ └── test-transforms-basic.sh ├── test-audioformat │ ├── expected │ │ ├── percussiononsets-mp3.csv │ │ ├── percussiononsets-ogg.csv │ │ ├── percussiononsets-opus.csv │ │ ├── percussiononsets-wav.csv │ │ ├── norm-on.csv │ │ └── norm-off.csv │ ├── transforms │ │ └── percussiononsets.n3 │ └── test-audioformat.sh ├── test-midi-writer │ ├── expected │ │ ├── curve-vsr.mid │ │ └── notes-regions.mid │ └── test-midi-writer.sh ├── test-multiple-audio │ ├── expected │ │ ├── multiplexed.csv │ │ ├── playlist.csv │ │ └── all-files.csv │ └── transforms │ │ ├── detectionfunction.n3 │ │ └── af.n3 ├── misc-queries │ ├── test-roqet │ ├── test-query-transform-params │ ├── test-query-dense-output │ ├── test-query-pluginid-for-rdf │ ├── test-query │ ├── test-query-plugin-output-types │ ├── test-query-transforms │ └── test-query-plugin-for-transform ├── test-rdf-writer │ ├── transforms │ │ ├── onsets.n3 │ │ └── detectionfunction.n3 │ └── test-rdf-writer.sh ├── test-csv-destinations │ └── transforms │ │ ├── onsets.n3 │ │ └── detectionfunction.n3 ├── test-jams-destinations │ └── transforms │ │ ├── onsets.n3 │ │ └── detectionfunction.n3 ├── test-lab-destinations │ └── transforms │ │ ├── onsets.n3 │ │ └── detectionfunction.n3 ├── test-midi-destinations │ └── transforms │ │ ├── onsets.n3 │ │ └── detectionfunction.n3 ├── test-rdf-destinations │ └── transforms │ │ ├── onsets.n3 │ │ └── detectionfunction.n3 ├── test-as-advertised │ ├── transforms │ │ ├── percussiononsets-onsets.n3 │ │ └── percussiononsets-detectionfunction.n3 │ └── test-as-advertised.sh ├── test-vamp-test-plugin │ ├── expected │ │ ├── vamp-test-plugin-instants.csv │ │ ├── vamp-test-plugin-curve-fsr.csv │ │ ├── vamp-test-plugin-curve-vsr.csv │ │ ├── vamp-test-plugin-curve-fsr-mixed.csv │ │ ├── vamp-test-plugin-curve-fsr-timed.csv │ │ ├── vamp-test-plugin-notes-regions.csv │ │ ├── vamp-test-plugin-grid-fsr.csv │ │ ├── vamp-test-plugin-curve-oss.csv │ │ └── vamp-test-plugin-grid-oss.csv │ └── test-vamp-test-plugin.sh ├── test-jams-writer │ ├── transforms │ │ ├── af.n3 │ │ ├── onsets.n3 │ │ └── detectionfunction.n3 │ ├── expected │ │ ├── instants.json │ │ ├── curve-fsr.json │ │ └── notes-regions.json │ └── test-jams-writer.sh ├── test-csv-writer │ ├── expected │ │ ├── curve-vsr-sample-timing.csv │ │ ├── curve-vsr-end-times.csv │ │ ├── curve-vsr-no-flags.csv │ │ ├── curve-vsr-separator.csv │ │ ├── curve-vsr-all.csv │ │ ├── notes-regions-all.csv │ │ ├── notes-regions-sample-timing.csv │ │ ├── curve-vsr-fill-ends.csv │ │ ├── notes-regions-end-times.csv │ │ ├── notes-regions-fill-ends.csv │ │ ├── notes-regions-no-flags.csv │ │ ├── notes-regions-separator.csv │ │ ├── grid-oss-2.csv │ │ ├── grid-oss-sample-timing.csv │ │ ├── grid-oss-all.csv │ │ ├── grid-oss-0.csv │ │ ├── grid-oss-6.csv │ │ ├── grid-oss-end-times.csv │ │ ├── grid-oss-no-flags.csv │ │ ├── grid-oss-separator.csv │ │ └── grid-oss-fill-ends.csv │ └── test-csv-writer.sh ├── test-lab-writer │ ├── expected │ │ ├── curve-vsr-no-flags.lab │ │ ├── curve-vsr-fill-ends.lab │ │ ├── notes-regions-fill-ends.lab │ │ ├── notes-regions-no-flags.lab │ │ ├── grid-oss-2.lab │ │ ├── grid-oss-0.lab │ │ ├── grid-oss-6.lab │ │ ├── grid-oss-no-flags.lab │ │ └── grid-oss-fill-ends.lab │ └── test-lab-writer.sh ├── test.sh ├── test-supportprogs │ └── test-supportprogs.sh ├── test-helpfulflags │ └── test-helpfulflags.sh └── include.sh ├── version.h.in ├── repoint.bat ├── transforms ├── spectralcentroid.xml ├── percussiononsets.xml ├── percussiononsets-detectionfunction.xml ├── chromagram.xml ├── segmentation.n3 ├── percussiononsets-detectionfunction.n3 └── percussiononsets.n3 ├── meson_options.txt ├── sonic-annotator.desktop ├── deploy ├── osx │ ├── skeleton.pc │ ├── Entitlements.plist │ ├── sign.sh │ ├── build-and-package.sh │ ├── notarize.sh │ └── configure.sh ├── win │ ├── static-redirects.cpp │ ├── zip.ps1 │ ├── build-32.bat │ ├── build-64.bat │ └── build-64-static.bat ├── cross │ ├── macos-arm64.txt │ └── macos-x86_64.txt ├── linux │ ├── docker │ │ ├── Dockerfile_test_appimage.in │ │ ├── build.sh │ │ ├── Dockerfile_v1.5_ubuntu1604 │ │ └── Dockerfile_appimage.in │ ├── AppRun │ ├── build-and-test-appimage.sh │ └── deploy-appimage.sh ├── src │ └── archive.sh ├── metadata.sh ├── clean-build-and-package └── clean-build-and-package.bat ├── CITATION ├── .github └── workflows │ ├── macos.yml │ ├── linux.yml │ └── windows.yml ├── repoint-lock.json ├── .hgignore ├── runner ├── FeatureWriterFactory.h ├── DefaultFeatureWriter.h ├── MultiplexedReader.h ├── FeatureWriterFactory.cpp ├── AudioDBFeatureWriter.h ├── LabFeatureWriter.h ├── MIDIFeatureWriter.h ├── DefaultFeatureWriter.cpp └── JAMSFeatureWriter.h ├── .gitignore ├── .hgtags ├── repoint-project.json └── feature-description-example.n3 /tests/test-parse-errors/inputs/empty.ttl: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test-parse-errors/inputs/empty.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /version.h.in: -------------------------------------------------------------------------------- 1 | #define RUNNER_VERSION "@version@" 2 | -------------------------------------------------------------------------------- /tests/audio/playlist.m3u: -------------------------------------------------------------------------------- 1 | 3clicks.mp3 2 | 6clicks.ogg 3 | -------------------------------------------------------------------------------- /tests/test-summaries/expected/summaries-start-and-duration.csv: -------------------------------------------------------------------------------- 1 | "./../audio/3clicks8.wav" 2 | -------------------------------------------------------------------------------- /tests/test-parse-errors/expected/empty.xml.txt: -------------------------------------------------------------------------------- 1 | XML parser reported: Premature end of document 2 | -------------------------------------------------------------------------------- /tests/test-parse-errors/expected/empty.ttl.txt: -------------------------------------------------------------------------------- 1 | RDF parser reported: Failed to import model from URL 2 | -------------------------------------------------------------------------------- /tests/test-parse-errors/expected/valid-xml-no-transform.xml.txt: -------------------------------------------------------------------------------- 1 | valid XML but defines no transform 2 | -------------------------------------------------------------------------------- /tests/test-summaries/expected/testplug-curve-vsr-sum.csv: -------------------------------------------------------------------------------- 1 | 0.000000000,9.750000000,sum,4.5,"(sum)" 2 | -------------------------------------------------------------------------------- /tests/test-parse-errors/expected/valid-turtle-no-transform.ttl.txt: -------------------------------------------------------------------------------- 1 | valid RDF but defines no transforms 2 | -------------------------------------------------------------------------------- /tests/test-summaries/expected/testplug-curve-vsr-count.csv: -------------------------------------------------------------------------------- 1 | 0.000000000,9.750000000,count,10,"(count)" 2 | -------------------------------------------------------------------------------- /tests/test-summaries/expected/testplug-curve-vsr-min.csv: -------------------------------------------------------------------------------- 1 | 0.000000000,9.750000000,min,0,"(minimum value)" 2 | -------------------------------------------------------------------------------- /repoint.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dpn0.ps1' %*"; 3 | 4 | -------------------------------------------------------------------------------- /tests/audio/remote-playlist.m3u: -------------------------------------------------------------------------------- 1 | http://vamp-plugins.org/sonic-annotator/testfiles/3clicks.mp3 2 | 6clicks.ogg 3 | -------------------------------------------------------------------------------- /tests/test-parse-errors/expected/garbage.dat.txt: -------------------------------------------------------------------------------- 1 | ERROR: RDF parser reported: 2 | ERROR: XML parser reported: 3 | -------------------------------------------------------------------------------- /tests/test-parse-errors/expected/invalid-turtle.ttl.txt: -------------------------------------------------------------------------------- 1 | RDF parser reported: Failed to import model from URL 2 | -------------------------------------------------------------------------------- /tests/test-parse-errors/expected/invalid-xml.xml.txt: -------------------------------------------------------------------------------- 1 | XML parser reported: Opening and ending tag mismatch 2 | -------------------------------------------------------------------------------- /tests/test-summaries/expected/testplug-curve-vsr-max.csv: -------------------------------------------------------------------------------- 1 | 0.000000000,9.750000000,max,0.9,"(maximum value)" 2 | -------------------------------------------------------------------------------- /tests/audio/3clicks.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sonic-visualiser/sonic-annotator/HEAD/tests/audio/3clicks.mp3 -------------------------------------------------------------------------------- /tests/audio/3clicks.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sonic-visualiser/sonic-annotator/HEAD/tests/audio/3clicks.ogg -------------------------------------------------------------------------------- /tests/audio/3clicks.opus: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sonic-visualiser/sonic-annotator/HEAD/tests/audio/3clicks.opus -------------------------------------------------------------------------------- /tests/audio/3clicks8.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sonic-visualiser/sonic-annotator/HEAD/tests/audio/3clicks8.wav -------------------------------------------------------------------------------- /tests/audio/6clicks.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sonic-visualiser/sonic-annotator/HEAD/tests/audio/6clicks.ogg -------------------------------------------------------------------------------- /tests/audio/6clicks8.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sonic-visualiser/sonic-annotator/HEAD/tests/audio/6clicks8.wav -------------------------------------------------------------------------------- /tests/test-transforms-basic/expected/percussiononsets-start-and-duration.csv: -------------------------------------------------------------------------------- 1 | "./../audio/3clicks8.wav",2.417959183 2 | -------------------------------------------------------------------------------- /tests/audio/id3v2-ucs-2.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sonic-visualiser/sonic-annotator/HEAD/tests/audio/id3v2-ucs-2.mp3 -------------------------------------------------------------------------------- /tests/test-parse-errors/inputs/valid-turtle-no-transform.ttl: -------------------------------------------------------------------------------- 1 | . 2 | -------------------------------------------------------------------------------- /tests/audio/20sec-silence.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sonic-visualiser/sonic-annotator/HEAD/tests/audio/20sec-silence.wav -------------------------------------------------------------------------------- /tests/audio/3clicks8quiet.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sonic-visualiser/sonic-annotator/HEAD/tests/audio/3clicks8quiet.wav -------------------------------------------------------------------------------- /tests/test-transforms-basic/expected/skeleton-1.csv: -------------------------------------------------------------------------------- 1 | "./../audio/3clicks8.wav",0.777868480 2 | ,1.648616780 3 | ,2.414875283 4 | -------------------------------------------------------------------------------- /tests/audio/id3v2-iso-8859-1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sonic-visualiser/sonic-annotator/HEAD/tests/audio/id3v2-iso-8859-1.mp3 -------------------------------------------------------------------------------- /tests/test-audioformat/expected/percussiononsets-mp3.csv: -------------------------------------------------------------------------------- 1 | "./../audio/3clicks.mp3",0.777868481 2 | ,1.648616780 3 | ,2.403265306 4 | -------------------------------------------------------------------------------- /tests/test-audioformat/expected/percussiononsets-ogg.csv: -------------------------------------------------------------------------------- 1 | "./../audio/3clicks.ogg",0.777868480 2 | ,1.648616780 3 | ,2.414875283 4 | -------------------------------------------------------------------------------- /tests/test-audioformat/expected/percussiononsets-opus.csv: -------------------------------------------------------------------------------- 1 | "./../audio/3clicks.opus",0.778666666 2 | ,1.653333333 3 | ,2.410666666 4 | -------------------------------------------------------------------------------- /tests/test-audioformat/expected/percussiononsets-wav.csv: -------------------------------------------------------------------------------- 1 | "./../audio/3clicks8.wav",0.777868480 2 | ,1.648616780 3 | ,2.414875283 4 | -------------------------------------------------------------------------------- /tests/test-parse-errors/inputs/invalid-turtle.ttl: -------------------------------------------------------------------------------- 1 | # Trailing ; 2 | ; 3 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/expected/percussiononsets.csv: -------------------------------------------------------------------------------- 1 | "./../audio/3clicks8.wav",0.777868480 2 | ,1.648616780 3 | ,2.414875283 4 | -------------------------------------------------------------------------------- /tests/test-summaries/expected/testplug-grid-fsr-max.csv: -------------------------------------------------------------------------------- 1 | 0.000000000,9.750000000,max,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1,"(maximum value)" 2 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/expected/percussiononsets-no-parameters.csv: -------------------------------------------------------------------------------- 1 | "./../audio/3clicks8.wav",0.777868480 2 | ,1.648616780 3 | ,2.414875283 4 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-no-parameters.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tests/test-parse-errors/inputs/garbage.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sonic-visualiser/sonic-annotator/HEAD/tests/test-parse-errors/inputs/garbage.dat -------------------------------------------------------------------------------- /tests/test-summaries/expected/testplug-grid-fsr-min.csv: -------------------------------------------------------------------------------- 1 | 0.000000000,9.750000000,min,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,"(minimum value)" 2 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/expected/percussiononsets-set-sample-rate.csv: -------------------------------------------------------------------------------- 1 | "./../audio/3clicks8.wav",0.766258503 2 | ,1.648616780 3 | ,2.414875283 4 | -------------------------------------------------------------------------------- /tests/test-midi-writer/expected/curve-vsr.mid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sonic-visualiser/sonic-annotator/HEAD/tests/test-midi-writer/expected/curve-vsr.mid -------------------------------------------------------------------------------- /tests/test-transforms-basic/expected/percussiononsets-set-step-and-block-size.csv: -------------------------------------------------------------------------------- 1 | "./../audio/3clicks8.wav",0.782312925 2 | ,1.650680272 3 | ,2.417346939 4 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-no-parameters-default-output.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/expected/percussiononsets-no-parameters-default-output.csv: -------------------------------------------------------------------------------- 1 | "./../audio/3clicks8.wav",0.777868480 2 | ,1.648616780 3 | ,2.414875283 4 | -------------------------------------------------------------------------------- /tests/test-midi-writer/expected/notes-regions.mid: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sonic-visualiser/sonic-annotator/HEAD/tests/test-midi-writer/expected/notes-regions.mid -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-set-sample-rate.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /tests/test-summaries/transforms/segmentlist: -------------------------------------------------------------------------------- 1 | # ignore this 2 | 0 3 | # 4,"ignore this too" 4 | ,9.9,15.2,"some label that should also be ignored","this line should be read as just nine point nine" 5 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-set-step-and-block-size.xml: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /transforms/spectralcentroid.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test-summaries/expected/summaries-segments.csv: -------------------------------------------------------------------------------- 1 | "./../audio/6clicks8.wav",0.000000000,9.900000000,median,169,"(median value, continuous-time average)" 2 | ,9.900000000,0.061360545,median,179,"(median value, continuous-time average)" 3 | -------------------------------------------------------------------------------- /tests/test-summaries/expected/testplug-curve-vsr-sd.csv: -------------------------------------------------------------------------------- 1 | # Standard deviation is sqrt(variance), see the variance file for 2 | # notes on that value. 3 | # 4 | 0.000000000,9.750000000,sd,0.315291,"(standard deviation, continuous-time average)" 5 | -------------------------------------------------------------------------------- /meson_options.txt: -------------------------------------------------------------------------------- 1 | 2 | option('static_qtdir', 3 | type: 'string', 4 | value: '', 5 | description: 'Provides the QTDIR value when linking Qt statically. Without this some of the required static dependencies may be lost.') 6 | 7 | -------------------------------------------------------------------------------- /tests/test-parse-errors/inputs/valid-xml-no-transform.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A Title 5 | http://example.com 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sonic-annotator.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=Sonic Annotator 3 | Comment=Batch feature extraction from audio files 4 | Exec=sonic-annotator 5 | Icon=sonic-visualiser 6 | Terminal=true 7 | NoDisplay=true 8 | Type=Application 9 | Categories=Audio;AudioVideo; 10 | -------------------------------------------------------------------------------- /tests/test-parse-errors/inputs/invalid-xml.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A Title 5 | http://example.com 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tests/test-multiple-audio/expected/multiplexed.csv: -------------------------------------------------------------------------------- 1 | "3clicks.mp3",0.000000000,9.961360545,mean,0.00203,"(mean value, continuous-time average)" 2 | ,0.000000000,9.961360545,median,0.00186,"(median value, continuous-time average)" 3 | ,0.000000000,9.961360545,mean,0.00251,"(mean value, continuous-time average)" 4 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-set-parameters.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/misc-queries/test-roqet: -------------------------------------------------------------------------------- 1 | 2 | PREFIX : 3 | 4 | SELECT ?result ?mand 5 | 6 | FROM 7 | 8 | WHERE { 9 | ?result :mand ?mand . 10 | OPTIONAL { ?result :opt1 ?opt1 } . 11 | OPTIONAL { ?result :opt2 ?opt2 } . 12 | } 13 | 14 | -------------------------------------------------------------------------------- /transforms/percussiononsets.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /tests/test-audioformat/expected/norm-on.csv: -------------------------------------------------------------------------------- 1 | "./../audio/3clicks8quiet.wav",0.000000000,0.054658 2 | ,0.023219954,0.0539152 3 | ,0.046439909,0.055539 4 | ,0.069659863,0.0537917 5 | ,0.092879818,0.0553709 6 | ,0.116099773,0.0547902 7 | ,0.139319727,0.0528606 8 | ,0.162539682,0.0523698 9 | ,0.185759637,0.050746 10 | ,0.208979591,0.0547165 11 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/expected/percussiononsets-set-parameters.csv: -------------------------------------------------------------------------------- 1 | "./../audio/3clicks8.wav",0.011609977 2 | ,0.162539682 3 | ,0.290249433 4 | ,0.394739229 5 | ,0.777868481 6 | ,1.648616780 7 | ,2.414875283 8 | ,3.041814059 9 | ,3.134693877 10 | ,3.157913832 11 | ,3.599092970 12 | ,3.831292517 13 | ,4.504671202 14 | ,4.748480725 15 | -------------------------------------------------------------------------------- /tests/test-audioformat/expected/norm-off.csv: -------------------------------------------------------------------------------- 1 | "./../audio/3clicks8quiet.wav",0.000000000,0.00555121 2 | ,0.023219954,0.00547576 3 | ,0.046439909,0.00564068 4 | ,0.069659863,0.00546322 5 | ,0.092879818,0.00562361 6 | ,0.116099773,0.00556463 7 | ,0.139319727,0.00536865 8 | ,0.162539682,0.00531881 9 | ,0.185759637,0.00515389 10 | ,0.208979591,0.00555715 11 | -------------------------------------------------------------------------------- /deploy/osx/skeleton.pc: -------------------------------------------------------------------------------- 1 | prefix=@qtdir@ 2 | exec_prefix=${prefix} 3 | libdir=${prefix}/lib 4 | includedir=${prefix}/include 5 | bindir=${prefix}/bin 6 | libexecdir=${prefix}/libexec 7 | 8 | Name: Qt Something 9 | Description: A Qt module 10 | Version: @version@ 11 | Libs: -L${libdir} -l@library@ 12 | Cflags: -I${includedir}/Qt@module@ -I${includedir} 13 | 14 | -------------------------------------------------------------------------------- /tests/test-rdf-writer/transforms/onsets.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/test-csv-destinations/transforms/onsets.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/test-jams-destinations/transforms/onsets.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/test-lab-destinations/transforms/onsets.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/test-midi-destinations/transforms/onsets.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/test-rdf-destinations/transforms/onsets.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /transforms/percussiononsets-detectionfunction.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /deploy/win/static-redirects.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | extern "C" { 5 | void __imp__assert(char const *msg, char const *fn, unsigned line) {} 6 | void __imp__wassert(wchar_t const *msg, wchar_t const *fn, unsigned line) {} 7 | void __imp_clearerr(FILE *f) { clearerr(f); } 8 | void __imp_rewind(FILE *f) { rewind(f); } 9 | } 10 | 11 | -------------------------------------------------------------------------------- /tests/test-audioformat/transforms/percussiononsets.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /CITATION: -------------------------------------------------------------------------------- 1 | @article{SonicAnnotator, 2 | author = {Chris Cannam and Michael O. Jewell and Christophe Rhodes and Mark Sandler and Mark d'Inverno}, 3 | title = {Linked Data And You: Bringing music research software into the Semantic Web}, 4 | journal = {Journal of New Music Research}, 5 | number = {4}, 6 | pages = {313-325}, 7 | volume = {39}, 8 | year = {2010} 9 | } 10 | -------------------------------------------------------------------------------- /deploy/osx/Entitlements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | com.apple.security.app-sandbox 5 | 6 | com.apple.security.cs.disable-library-validation 7 | 8 | com.apple.security.cs.allow-jit 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/test-as-advertised/transforms/percussiononsets-onsets.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/expected/multiple.csv: -------------------------------------------------------------------------------- 1 | "./../audio/3clicks8.wav",0.011609977 2 | ,0.162539682 3 | ,0.290249433 4 | ,0.394739229 5 | ,0.777868481 6 | ,0.782312925 7 | ,1.650680272 8 | ,1.648616780 9 | ,2.417346939 10 | ,2.414875283 11 | ,2.414875283 12 | ,3.041814059 13 | ,3.134693877 14 | ,3.157913832 15 | ,3.599092970 16 | ,3.831292517 17 | ,4.504671202 18 | ,4.748480725 19 | -------------------------------------------------------------------------------- /tests/test-summaries/expected/summaries-from-rdf-summaries-only.csv: -------------------------------------------------------------------------------- 1 | "./../audio/3clicks8.wav",0.000000000,4.992290250,mean,169.391,"(mean value, continuous-time average)" 2 | ,0.000000000,4.992290250,median,169,"(median value, continuous-time average)" 3 | ,0.000000000,4.992290250,mode,164,"(modal value, continuous-time average)" 4 | ,0.000000000,4.992290250,mean,703.191,"(mean value, continuous-time average)" 5 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-no-parameters-default-output.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/test-vamp-test-plugin/expected/vamp-test-plugin-instants.csv: -------------------------------------------------------------------------------- 1 | ,0.000000000,"1 of 10 at 0" 2 | ,1.500000000,"2 of 10 at 1.5" 3 | ,3.000000000,"3 of 10 at 3" 4 | ,4.500000000,"4 of 10 at 4.5" 5 | ,6.000000000,"5 of 10 at 6" 6 | ,7.500000000,"6 of 10 at 7.5" 7 | ,9.000000000,"7 of 10 at 9" 8 | ,10.500000000,"8 of 10 at 10.5" 9 | ,12.000000000,"9 of 10 at 12" 10 | ,13.500000000,"10 of 10 at 13.5" 11 | -------------------------------------------------------------------------------- /tests/misc-queries/test-query-transform-params: -------------------------------------------------------------------------------- 1 | PREFIX vamp: 2 | 3 | SELECT ?transform ?param_id ?param_value 4 | 5 | FROM 6 | 7 | WHERE { 8 | ?transform vamp:parameter_binding ?binding . 9 | ?binding vamp:parameter ?param . 10 | ?param vamp:identifier ?param_id . 11 | ?binding vamp:value ?param_value . 12 | } 13 | 14 | -------------------------------------------------------------------------------- /tests/test-jams-writer/transforms/af.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:amplitudefollower ; 8 | vamp:output examples:amplitudefollower_output_amplitude . 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/test-jams-writer/transforms/onsets.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets ; 8 | vamp:output examples:percussiononsets_output_onsets . 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /transforms/chromagram.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tests/test-jams-writer/transforms/detectionfunction.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets ; 8 | vamp:output examples:percussiononsets_output_detectionfunction . 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/test-rdf-writer/transforms/detectionfunction.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets ; 8 | vamp:output examples:percussiononsets_output_detectionfunction . 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/test-summaries/expected/summaries-from-rdf.csv: -------------------------------------------------------------------------------- 1 | "./../audio/3clicks8.wav",0.777868481 2 | ,1.648616780 3 | ,2.414875284 4 | ,0.000000000,4.992290250,mean,169.391,"(mean value, continuous-time average)" 5 | ,0.000000000,4.992290250,median,169,"(median value, continuous-time average)" 6 | ,0.000000000,4.992290250,mode,164,"(modal value, continuous-time average)" 7 | ,0.000000000,4.992290250,mean,703.191,"(mean value, continuous-time average)" 8 | -------------------------------------------------------------------------------- /tests/test-summaries/transforms/detectionfunction-nosummaries.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets ; 8 | vamp:output examples:percussiononsets_output_detectionfunction . 9 | 10 | -------------------------------------------------------------------------------- /tests/test-csv-destinations/transforms/detectionfunction.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets ; 8 | vamp:output examples:percussiononsets_output_detectionfunction . 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/test-lab-destinations/transforms/detectionfunction.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets ; 8 | vamp:output examples:percussiononsets_output_detectionfunction . 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/test-rdf-destinations/transforms/detectionfunction.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets ; 8 | vamp:output examples:percussiononsets_output_detectionfunction . 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/test-jams-destinations/transforms/detectionfunction.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets ; 8 | vamp:output examples:percussiononsets_output_detectionfunction . 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/test-midi-destinations/transforms/detectionfunction.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets ; 8 | vamp:output examples:percussiononsets_output_detectionfunction . 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-no-parameters.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets ; 8 | vamp:output examples:percussiononsets_output_onsets . 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /transforms/segmentation.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix qmp: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin qmp:qm-segmenter; 8 | vamp:output qmp:qm-segmenter_output_segmentation; 9 | vamp:step_size ""; 10 | vamp:block_size ""; 11 | vamp:window_type "". 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/curve-vsr-sample-timing.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav",0,0,"1 of 10: 0 at 0" 2 | ,33075,0.1,"2 of 10: 0.1 at 0.75" 3 | ,66150,0.2,"3 of 10: 0.2 at 1.5" 4 | ,99225,0.3,"4 of 10: 0.3 at 2.25" 5 | ,132300,0.4,"5 of 10: 0.4 at 3" 6 | ,165375,0.5,"6 of 10: 0.5 at 3.75" 7 | ,198450,0.6,"7 of 10: 0.6 at 4.5" 8 | ,231525,0.7,"8 of 10: 0.7 at 5.25" 9 | ,264600,0.8,"9 of 10: 0.8 at 6" 10 | ,297675,0.9,"10 of 10: 0.9 at 6.75" 11 | -------------------------------------------------------------------------------- /tests/test-as-advertised/transforms/percussiononsets-detectionfunction.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets; 8 | vamp:output examples:percussiononsets_output_detectionfunction. 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-df-windowtype-default.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets; 8 | vamp:output examples:percussiononsets_output_detectionfunction. 9 | 10 | 11 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets.xml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-df-windowtype-default.xml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/test-lab-writer/expected/curve-vsr-no-flags.lab: -------------------------------------------------------------------------------- 1 | 0.000000000 0 "1 of 10: 0 at 0" 2 | 0.750000000 0.1 "2 of 10: 0.1 at 0.75" 3 | 1.500000000 0.2 "3 of 10: 0.2 at 1.5" 4 | 2.250000000 0.3 "4 of 10: 0.3 at 2.25" 5 | 3.000000000 0.4 "5 of 10: 0.4 at 3" 6 | 3.750000000 0.5 "6 of 10: 0.5 at 3.75" 7 | 4.500000000 0.6 "7 of 10: 0.6 at 4.5" 8 | 5.250000000 0.7 "8 of 10: 0.7 at 5.25" 9 | 6.000000000 0.8 "9 of 10: 0.8 at 6" 10 | 6.750000000 0.9 "10 of 10: 0.9 at 6.75" 11 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-set-sample-rate.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets ; 8 | vamp:output examples:percussiononsets_output_onsets ; 9 | vamp:sample_rate "22050" . 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-start-and-duration.xml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /deploy/osx/sign.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | exe="$1" 6 | 7 | if [ ! -f "$exe" ] || [ -n "$2" ]; then 8 | echo "Usage: $0 " 9 | echo " e.g. $0 my-program" 10 | exit 2 11 | fi 12 | 13 | set -u 14 | 15 | entitlements=deploy/osx/Entitlements.plist 16 | 17 | gatekeeper_key="Developer ID Application: Particular Programs Ltd (73F996B92S)" 18 | 19 | codesign -s "$gatekeeper_key" -fv --options runtime --entitlements "$entitlements" "$exe" 20 | 21 | -------------------------------------------------------------------------------- /tests/test-vamp-test-plugin/expected/vamp-test-plugin-curve-fsr.csv: -------------------------------------------------------------------------------- 1 | ,0.000000000,0,"1 of 10: 0 at 0" 2 | ,0.400000000,0.1,"2 of 10: 0.1 at 0.4" 3 | ,0.800000000,0.2,"3 of 10: 0.2 at 0.8" 4 | ,1.200000000,0.3,"4 of 10: 0.3 at 1.2" 5 | ,1.600000000,0.4,"5 of 10: 0.4 at 1.6" 6 | ,2.000000000,0.5,"6 of 10: 0.5 at 2" 7 | ,2.400000000,0.6,"7 of 10: 0.6 at 2.4" 8 | ,2.800000000,0.7,"8 of 10: 0.7 at 2.8" 9 | ,3.200000000,0.8,"9 of 10: 0.8 at 3.2" 10 | ,3.600000000,0.9,"10 of 10: 0.9 at 3.6" 11 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-df-start-and-duration.xml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-df-windowtype-hamming.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets; 8 | vamp:window_type "hamming" ; 9 | vamp:output examples:percussiononsets_output_detectionfunction. 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-df-windowtype-hamming.xml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-df-windowtype-hanning.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets; 8 | vamp:window_type "hanning" ; 9 | vamp:output examples:percussiononsets_output_detectionfunction. 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-df-windowtype-hanning.xml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /tests/test-vamp-test-plugin/expected/vamp-test-plugin-curve-vsr.csv: -------------------------------------------------------------------------------- 1 | ,0.000000000,0,"1 of 10: 0 at 0" 2 | ,0.750000000,0.1,"2 of 10: 0.1 at 0.75" 3 | ,1.500000000,0.2,"3 of 10: 0.2 at 1.5" 4 | ,2.250000000,0.3,"4 of 10: 0.3 at 2.25" 5 | ,3.000000000,0.4,"5 of 10: 0.4 at 3" 6 | ,3.750000000,0.5,"6 of 10: 0.5 at 3.75" 7 | ,4.500000000,0.6,"7 of 10: 0.6 at 4.5" 8 | ,5.250000000,0.7,"8 of 10: 0.7 at 5.25" 9 | ,6.000000000,0.8,"9 of 10: 0.8 at 6" 10 | ,6.750000000,0.9,"10 of 10: 0.9 at 6.75" 11 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-set-step-and-block-size.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets ; 8 | vamp:output examples:percussiononsets_output_onsets ; 9 | vamp:step_size "345"; 10 | vamp:block_size "512". 11 | 12 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/curve-vsr-end-times.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav",0.000000000,0,"1 of 10: 0 at 0" 2 | ,0.750000000,0.1,"2 of 10: 0.1 at 0.75" 3 | ,1.500000000,0.2,"3 of 10: 0.2 at 1.5" 4 | ,2.250000000,0.3,"4 of 10: 0.3 at 2.25" 5 | ,3.000000000,0.4,"5 of 10: 0.4 at 3" 6 | ,3.750000000,0.5,"6 of 10: 0.5 at 3.75" 7 | ,4.500000000,0.6,"7 of 10: 0.6 at 4.5" 8 | ,5.250000000,0.7,"8 of 10: 0.7 at 5.25" 9 | ,6.000000000,0.8,"9 of 10: 0.8 at 6" 10 | ,6.750000000,0.9,"10 of 10: 0.9 at 6.75" 11 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/curve-vsr-no-flags.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav",0.000000000,0,"1 of 10: 0 at 0" 2 | ,0.750000000,0.1,"2 of 10: 0.1 at 0.75" 3 | ,1.500000000,0.2,"3 of 10: 0.2 at 1.5" 4 | ,2.250000000,0.3,"4 of 10: 0.3 at 2.25" 5 | ,3.000000000,0.4,"5 of 10: 0.4 at 3" 6 | ,3.750000000,0.5,"6 of 10: 0.5 at 3.75" 7 | ,4.500000000,0.6,"7 of 10: 0.6 at 4.5" 8 | ,5.250000000,0.7,"8 of 10: 0.7 at 5.25" 9 | ,6.000000000,0.8,"9 of 10: 0.8 at 6" 10 | ,6.750000000,0.9,"10 of 10: 0.9 at 6.75" 11 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/curve-vsr-separator.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav"@0.000000000@0@"1 of 10: 0 at 0" 2 | @0.750000000@0.1@"2 of 10: 0.1 at 0.75" 3 | @1.500000000@0.2@"3 of 10: 0.2 at 1.5" 4 | @2.250000000@0.3@"4 of 10: 0.3 at 2.25" 5 | @3.000000000@0.4@"5 of 10: 0.4 at 3" 6 | @3.750000000@0.5@"6 of 10: 0.5 at 3.75" 7 | @4.500000000@0.6@"7 of 10: 0.6 at 4.5" 8 | @5.250000000@0.7@"8 of 10: 0.7 at 5.25" 9 | @6.000000000@0.8@"9 of 10: 0.8 at 6" 10 | @6.750000000@0.9@"10 of 10: 0.9 at 6.75" 11 | -------------------------------------------------------------------------------- /deploy/cross/macos-arm64.txt: -------------------------------------------------------------------------------- 1 | [host_machine] 2 | cpu_family = 'aarch64' 3 | cpu = 'aarch64' 4 | system = 'darwin' 5 | endian = 'little' 6 | 7 | [properties] 8 | needs_exe_wrapper = false 9 | 10 | [binaries] 11 | c = 'cc' 12 | cpp = 'c++' 13 | objcpp = 'c++' 14 | strip = 'strip' 15 | pkg-config = 'pkg-config' 16 | qmake = 'qmake' 17 | 18 | [built-in options] 19 | c_args = ['-arch', 'arm64'] 20 | cpp_args = ['-arch', 'arm64'] 21 | cpp_link_args = ['-arch', 'arm64'] 22 | objcpp_args = ['-arch', 'arm64'] 23 | 24 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/curve-vsr-all.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav"@0@33075@0@"1 of 10: 0 at 0" 2 | @33075@66150@0.1@"2 of 10: 0.1 at 0.75" 3 | @66150@99225@0.2@"3 of 10: 0.2 at 1.5" 4 | @99225@132300@0.3@"4 of 10: 0.3 at 2.25" 5 | @132300@165375@0.4@"5 of 10: 0.4 at 3" 6 | @165375@198450@0.5@"6 of 10: 0.5 at 3.75" 7 | @198450@231525@0.6@"7 of 10: 0.6 at 4.5" 8 | @231525@264600@0.7@"8 of 10: 0.7 at 5.25" 9 | @264600@297675@0.8@"9 of 10: 0.8 at 6" 10 | @297675@297675@0.9@"10 of 10: 0.9 at 6.75" 11 | -------------------------------------------------------------------------------- /deploy/cross/macos-x86_64.txt: -------------------------------------------------------------------------------- 1 | [host_machine] 2 | cpu_family = 'x86_64' 3 | cpu = 'x86_64' 4 | system = 'darwin' 5 | endian = 'little' 6 | 7 | [properties] 8 | needs_exe_wrapper = false 9 | 10 | [binaries] 11 | c = 'cc' 12 | cpp = 'c++' 13 | objcpp = 'c++' 14 | strip = 'strip' 15 | pkg-config = 'pkg-config' 16 | qmake = 'qmake' 17 | 18 | [built-in options] 19 | c_args = ['-arch', 'x86_64'] 20 | cpp_args = ['-arch', 'x86_64'] 21 | cpp_link_args = ['-arch', 'x86_64'] 22 | objcpp_args = ['-arch', 'x86_64'] 23 | 24 | -------------------------------------------------------------------------------- /tests/misc-queries/test-query-dense-output: -------------------------------------------------------------------------------- 1 | 2 | PREFIX vamp: 3 | PREFIX mo: 4 | PREFIX af: 5 | 6 | SELECT ?signal_source ?feature_signal_type ?value 7 | FROM 8 | 9 | WHERE { 10 | ?signal mo:available_as ?signal_source . 11 | ?signal a mo:Signal . 12 | ?signal af:signal_feature ?feature . 13 | ?feature a ?feature_signal_type. 14 | ?feature af:value ?value . 15 | } 16 | 17 | -------------------------------------------------------------------------------- /tests/test-multiple-audio/expected/playlist.csv: -------------------------------------------------------------------------------- 1 | "3clicks.mp3",0.000000000,4.992290250,mean,0.000287,"(mean value, continuous-time average)" 2 | ,0.000000000,4.992290250,median,1.64e-5,"(median value, continuous-time average)" 3 | ,0.000000000,4.992290250,mean,0.000924,"(mean value, continuous-time average)" 4 | "6clicks.ogg",0.000000000,9.961360545,mean,0.00396,"(mean value, continuous-time average)" 5 | ,0.000000000,9.961360545,median,0.00372,"(median value, continuous-time average)" 6 | ,0.000000000,9.961360545,mean,0.00468,"(mean value, continuous-time average)" 7 | -------------------------------------------------------------------------------- /.github/workflows/macos.yml: -------------------------------------------------------------------------------- 1 | name: macOS CI 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: macos-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v2 12 | - name: deps 13 | run: brew install smlnj qt6 meson ninja mercurial 14 | - name: repoint 15 | run: PATH=$PATH:/usr/local/smlnj/bin ./repoint install 16 | - name: configure 17 | run: meson setup build --buildtype release 18 | - name: make 19 | run: ninja -C build 20 | - name: test 21 | run: meson test -C build 22 | 23 | -------------------------------------------------------------------------------- /tests/misc-queries/test-query-pluginid-for-rdf: -------------------------------------------------------------------------------- 1 | 2 | PREFIX vamp: 3 | PREFIX examples: 4 | 5 | SELECT ?plugin ?library_id ?plugin_id 6 | FROM 7 | 8 | WHERE { 9 | ?plugin a vamp:Plugin . 10 | ?plugin vamp:identifier ?plugin_id . 11 | OPTIONAL { ?library a vamp:PluginLibrary . 12 | ?library vamp:identifier ?library_id . 13 | ?library vamp:available_plugin ?plugin . } 14 | } 15 | 16 | -------------------------------------------------------------------------------- /tests/test-vamp-test-plugin/expected/vamp-test-plugin-curve-fsr-mixed.csv: -------------------------------------------------------------------------------- 1 | ,2.400000000,0,"1 of 10: 0 at 2.4 snap to 2.4" 2 | ,2.800000000,0.1,"2 of 10: 0.1 at 2.9 snap to 2.8" 3 | ,3.200000000,0.2,"3 of 10: 0.2 at 3.14 snap to 3.2" 4 | ,3.600000000,0.3,"4 of 10: 0.3 at 3.5 snap to 3.6" 5 | ,4.000000000,0.4,"5 of 10: 0.4 at 4" 6 | ,4.400000000,0.5,"6 of 10: 0.5 at 4.4" 7 | ,4.000000000,0.6,"7 of 10: 0.6 at 3.9 snap to 4" 8 | ,4.400000000,0.7,"8 of 10: 0.7 at 4.4 snap to 4.4" 9 | ,4.800000000,0.8,"9 of 10: 0.8 at 4.8" 10 | ,5.200000000,0.9,"10 of 10: 0.9 at 5 snap to 5.2" 11 | -------------------------------------------------------------------------------- /tests/test-lab-writer/expected/curve-vsr-fill-ends.lab: -------------------------------------------------------------------------------- 1 | 0.000000000 0.750000000 0 "1 of 10: 0 at 0" 2 | 0.750000000 1.500000000 0.1 "2 of 10: 0.1 at 0.75" 3 | 1.500000000 2.250000000 0.2 "3 of 10: 0.2 at 1.5" 4 | 2.250000000 3.000000000 0.3 "4 of 10: 0.3 at 2.25" 5 | 3.000000000 3.750000000 0.4 "5 of 10: 0.4 at 3" 6 | 3.750000000 4.500000000 0.5 "6 of 10: 0.5 at 3.75" 7 | 4.500000000 5.250000000 0.6 "7 of 10: 0.6 at 4.5" 8 | 5.250000000 6.000000000 0.7 "8 of 10: 0.7 at 5.25" 9 | 6.000000000 6.750000000 0.8 "9 of 10: 0.8 at 6" 10 | 6.750000000 6.750000000 0.9 "10 of 10: 0.9 at 6.75" 11 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/notes-regions-all.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav"@0@77175@0@"1 of 10: 0 at 0 dur. 1.75" 2 | @44100@66150@0.1@"2 of 10: 0.1 at 1 dur. 0.5" 3 | @88200@165375@0.2@"3 of 10: 0.2 at 2 dur. 1.75" 4 | @132300@154350@0.3@"4 of 10: 0.3 at 3 dur. 0.5" 5 | @176400@253575@0.4@"5 of 10: 0.4 at 4 dur. 1.75" 6 | @220500@242550@0.5@"6 of 10: 0.5 at 5 dur. 0.5" 7 | @264600@341775@0.6@"7 of 10: 0.6 at 6 dur. 1.75" 8 | @308700@330750@0.7@"8 of 10: 0.7 at 7 dur. 0.5" 9 | @352800@429975@0.8@"9 of 10: 0.8 at 8 dur. 1.75" 10 | @396900@418950@0.9@"10 of 10: 0.9 at 9 dur. 0.5" 11 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/notes-regions-sample-timing.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav",0,77175,0,"1 of 10: 0 at 0 dur. 1.75" 2 | ,44100,22050,0.1,"2 of 10: 0.1 at 1 dur. 0.5" 3 | ,88200,77175,0.2,"3 of 10: 0.2 at 2 dur. 1.75" 4 | ,132300,22050,0.3,"4 of 10: 0.3 at 3 dur. 0.5" 5 | ,176400,77175,0.4,"5 of 10: 0.4 at 4 dur. 1.75" 6 | ,220500,22050,0.5,"6 of 10: 0.5 at 5 dur. 0.5" 7 | ,264600,77175,0.6,"7 of 10: 0.6 at 6 dur. 1.75" 8 | ,308700,22050,0.7,"8 of 10: 0.7 at 7 dur. 0.5" 9 | ,352800,77175,0.8,"9 of 10: 0.8 at 8 dur. 1.75" 10 | ,396900,22050,0.9,"10 of 10: 0.9 at 9 dur. 0.5" 11 | -------------------------------------------------------------------------------- /deploy/linux/docker/Dockerfile_test_appimage.in: -------------------------------------------------------------------------------- 1 | FROM fedora:latest 2 | 3 | # Ensure that everything subsequent is re-run when a new revision is 4 | # being built (rather than being cached) - so as to avoid potential 5 | # mismatches between results of yum update and the package dependency 6 | # installation itself 7 | RUN echo [[REVISION]] 8 | 9 | RUN yum -y update 10 | RUN yum -y install wget 11 | ADD output/SonicAnnotator-[[REVISION]]-x86_64.AppImage runner.AppImage 12 | RUN chmod +x runner.AppImage 13 | RUN ./runner.AppImage --appimage-extract 14 | RUN ./squashfs-root/AppRun --version 15 | -------------------------------------------------------------------------------- /tests/test-vamp-test-plugin/expected/vamp-test-plugin-curve-fsr-timed.csv: -------------------------------------------------------------------------------- 1 | ,0.000000000,0,"1 of 10: 0 at 0 snap to 0" 2 | ,0.000000000,0.1,"2 of 10: 0.1 at 0 snap to 0" 3 | ,0.000000000,0.2,"3 of 10: 0.2 at 0.166 snap to 0" 4 | ,0.400000000,0.3,"4 of 10: 0.3 at 0.333 snap to 0.4" 5 | ,2.000000000,0.4,"5 of 10: 0.4 at 2 snap to 2" 6 | ,2.000000000,0.5,"6 of 10: 0.5 at 2 snap to 2" 7 | ,2.000000000,0.6,"7 of 10: 0.6 at 2.166 snap to 2" 8 | ,2.400000000,0.7,"8 of 10: 0.7 at 2.333 snap to 2.4" 9 | ,4.000000000,0.8,"9 of 10: 0.8 at 4 snap to 4" 10 | ,4.000000000,0.9,"10 of 10: 0.9 at 4 snap to 4" 11 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-multiple-outputs.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets ; 8 | vamp:output examples:percussiononsets_output_onsets . 9 | 10 | :transform1 a vamp:Transform; 11 | vamp:plugin examples:percussiononsets ; 12 | vamp:output examples:percussiononsets_output_detectionfunction . 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/curve-vsr-fill-ends.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav",0.000000000,0.750000000,0,"1 of 10: 0 at 0" 2 | ,0.750000000,0.750000000,0.1,"2 of 10: 0.1 at 0.75" 3 | ,1.500000000,0.750000000,0.2,"3 of 10: 0.2 at 1.5" 4 | ,2.250000000,0.750000000,0.3,"4 of 10: 0.3 at 2.25" 5 | ,3.000000000,0.750000000,0.4,"5 of 10: 0.4 at 3" 6 | ,3.750000000,0.750000000,0.5,"6 of 10: 0.5 at 3.75" 7 | ,4.500000000,0.750000000,0.6,"7 of 10: 0.6 at 4.5" 8 | ,5.250000000,0.750000000,0.7,"8 of 10: 0.7 at 5.25" 9 | ,6.000000000,0.750000000,0.8,"9 of 10: 0.8 at 6" 10 | ,6.750000000,0.000000000,0.9,"10 of 10: 0.9 at 6.75" 11 | -------------------------------------------------------------------------------- /tests/misc-queries/test-query: -------------------------------------------------------------------------------- 1 | 2 | PREFIX vamp: 3 | PREFIX examples: 4 | 5 | SELECT ?transform ?library ?library_id ?plugin 6 | FROM 7 | FROM 8 | 9 | WHERE { 10 | ?transform a vamp:Transform . 11 | ?transform vamp:plugin ?plugin . 12 | ?plugin a vamp:Plugin . 13 | ?library a vamp:PluginLibrary . 14 | ?library vamp:identifier ?library_id . 15 | ?library vamp:available_plugin ?plugin . 16 | } 17 | 18 | -------------------------------------------------------------------------------- /tests/test-lab-writer/expected/notes-regions-fill-ends.lab: -------------------------------------------------------------------------------- 1 | 0.000000000 1.750000000 0 "1 of 10: 0 at 0 dur. 1.75" 2 | 1.000000000 1.500000000 0.1 "2 of 10: 0.1 at 1 dur. 0.5" 3 | 2.000000000 3.750000000 0.2 "3 of 10: 0.2 at 2 dur. 1.75" 4 | 3.000000000 3.500000000 0.3 "4 of 10: 0.3 at 3 dur. 0.5" 5 | 4.000000000 5.750000000 0.4 "5 of 10: 0.4 at 4 dur. 1.75" 6 | 5.000000000 5.500000000 0.5 "6 of 10: 0.5 at 5 dur. 0.5" 7 | 6.000000000 7.750000000 0.6 "7 of 10: 0.6 at 6 dur. 1.75" 8 | 7.000000000 7.500000000 0.7 "8 of 10: 0.7 at 7 dur. 0.5" 9 | 8.000000000 9.750000000 0.8 "9 of 10: 0.8 at 8 dur. 1.75" 10 | 9.000000000 9.500000000 0.9 "10 of 10: 0.9 at 9 dur. 0.5" 11 | -------------------------------------------------------------------------------- /tests/test-lab-writer/expected/notes-regions-no-flags.lab: -------------------------------------------------------------------------------- 1 | 0.000000000 1.750000000 0 "1 of 10: 0 at 0 dur. 1.75" 2 | 1.000000000 1.500000000 0.1 "2 of 10: 0.1 at 1 dur. 0.5" 3 | 2.000000000 3.750000000 0.2 "3 of 10: 0.2 at 2 dur. 1.75" 4 | 3.000000000 3.500000000 0.3 "4 of 10: 0.3 at 3 dur. 0.5" 5 | 4.000000000 5.750000000 0.4 "5 of 10: 0.4 at 4 dur. 1.75" 6 | 5.000000000 5.500000000 0.5 "6 of 10: 0.5 at 5 dur. 0.5" 7 | 6.000000000 7.750000000 0.6 "7 of 10: 0.6 at 6 dur. 1.75" 8 | 7.000000000 7.500000000 0.7 "8 of 10: 0.7 at 7 dur. 0.5" 9 | 8.000000000 9.750000000 0.8 "9 of 10: 0.8 at 8 dur. 1.75" 10 | 9.000000000 9.500000000 0.9 "10 of 10: 0.9 at 9 dur. 0.5" 11 | -------------------------------------------------------------------------------- /deploy/win/zip.ps1: -------------------------------------------------------------------------------- 1 | 2 | Set-StrictMode -Version 2.0 3 | $ErrorActionPreference = "Stop" 4 | 5 | Add-Type -assembly "system.io.compression.filesystem" 6 | 7 | if ($args.length -ne 2) { 8 | echo "Usage: zip target.zip sourcedir" 9 | exit 2 10 | } 11 | 12 | $sourcename = $args[1] 13 | $targetname = $args[0] 14 | 15 | $source = (Resolve-Path $sourcename) 16 | 17 | if ([System.IO.Path]::IsPathRooted($targetname)) { 18 | $target = $targetname 19 | } else { 20 | $target = "$pwd\$targetname" 21 | } 22 | 23 | echo "Compressing from $source to $target..." | Out-Host 24 | 25 | [io.compression.zipfile]::CreateFromDirectory($source, $target) 26 | 27 | -------------------------------------------------------------------------------- /tests/test-vamp-test-plugin/expected/vamp-test-plugin-notes-regions.csv: -------------------------------------------------------------------------------- 1 | ,0.000000000,1.750000000,0,"1 of 10: 0 at 0 dur. 1.75" 2 | ,1.000000000,0.500000000,0.1,"2 of 10: 0.1 at 1 dur. 0.5" 3 | ,2.000000000,1.750000000,0.2,"3 of 10: 0.2 at 2 dur. 1.75" 4 | ,3.000000000,0.500000000,0.3,"4 of 10: 0.3 at 3 dur. 0.5" 5 | ,4.000000000,1.750000000,0.4,"5 of 10: 0.4 at 4 dur. 1.75" 6 | ,5.000000000,0.500000000,0.5,"6 of 10: 0.5 at 5 dur. 0.5" 7 | ,6.000000000,1.750000000,0.6,"7 of 10: 0.6 at 6 dur. 1.75" 8 | ,7.000000000,0.500000000,0.7,"8 of 10: 0.7 at 7 dur. 0.5" 9 | ,8.000000000,1.750000000,0.8,"9 of 10: 0.8 at 8 dur. 1.75" 10 | ,9.000000000,0.500000000,0.9,"10 of 10: 0.9 at 9 dur. 0.5" 11 | -------------------------------------------------------------------------------- /tests/test-midi-writer/test-midi-writer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . ../include.sh 4 | 5 | infile=$audiopath/20sec-silence.wav 6 | tmpmidi=$mypath/tmp_1_$$.mid 7 | 8 | trap "rm -f $tmpmidi" 0 9 | 10 | for output in notes-regions curve-vsr; do 11 | 12 | flag="" 13 | 14 | $r -d "$testplug:$output" -w midi --midi-one-file "$tmpmidi" --midi-force "$infile" 2>/dev/null || \ 15 | fail "Failed to run for plugin $testplug with output $output and no additional flags" 16 | 17 | midicompare "$tmpmidi" "$mypath/expected/$output.mid" || \ 18 | faildiff_od "Output differs from expected for output $output" "$tmpmidi" "$mypath/expected/$output.mid" 19 | 20 | done 21 | 22 | exit 0 23 | 24 | -------------------------------------------------------------------------------- /tests/test-summaries/expected/summaries-all-summaries-only.csv: -------------------------------------------------------------------------------- 1 | "./../audio/3clicks8.wav",0.000000000,4.992290250,count,430,"(count)" 2 | ,0.000000000,4.992290250,max,503,"(maximum value)" 3 | ,0.000000000,4.992290250,mean,169.391,"(mean value, continuous-time average)" 4 | ,0.000000000,4.992290250,median,169,"(median value, continuous-time average)" 5 | ,0.000000000,4.992290250,min,0,"(minimum value)" 6 | ,0.000000000,4.992290250,mode,164,"(modal value, continuous-time average)" 7 | ,0.000000000,4.992290250,sd,32.7775,"(standard deviation, continuous-time average)" 8 | ,0.000000000,4.992290250,sum,72838,"(sum)" 9 | ,0.000000000,4.992290250,variance,1074.36,"(variance, continuous-time average)" 10 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/notes-regions-end-times.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav",0.000000000,1.750000000,0,"1 of 10: 0 at 0 dur. 1.75" 2 | ,1.000000000,1.500000000,0.1,"2 of 10: 0.1 at 1 dur. 0.5" 3 | ,2.000000000,3.750000000,0.2,"3 of 10: 0.2 at 2 dur. 1.75" 4 | ,3.000000000,3.500000000,0.3,"4 of 10: 0.3 at 3 dur. 0.5" 5 | ,4.000000000,5.750000000,0.4,"5 of 10: 0.4 at 4 dur. 1.75" 6 | ,5.000000000,5.500000000,0.5,"6 of 10: 0.5 at 5 dur. 0.5" 7 | ,6.000000000,7.750000000,0.6,"7 of 10: 0.6 at 6 dur. 1.75" 8 | ,7.000000000,7.500000000,0.7,"8 of 10: 0.7 at 7 dur. 0.5" 9 | ,8.000000000,9.750000000,0.8,"9 of 10: 0.8 at 8 dur. 1.75" 10 | ,9.000000000,9.500000000,0.9,"10 of 10: 0.9 at 9 dur. 0.5" 11 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/notes-regions-fill-ends.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav",0.000000000,1.750000000,0,"1 of 10: 0 at 0 dur. 1.75" 2 | ,1.000000000,0.500000000,0.1,"2 of 10: 0.1 at 1 dur. 0.5" 3 | ,2.000000000,1.750000000,0.2,"3 of 10: 0.2 at 2 dur. 1.75" 4 | ,3.000000000,0.500000000,0.3,"4 of 10: 0.3 at 3 dur. 0.5" 5 | ,4.000000000,1.750000000,0.4,"5 of 10: 0.4 at 4 dur. 1.75" 6 | ,5.000000000,0.500000000,0.5,"6 of 10: 0.5 at 5 dur. 0.5" 7 | ,6.000000000,1.750000000,0.6,"7 of 10: 0.6 at 6 dur. 1.75" 8 | ,7.000000000,0.500000000,0.7,"8 of 10: 0.7 at 7 dur. 0.5" 9 | ,8.000000000,1.750000000,0.8,"9 of 10: 0.8 at 8 dur. 1.75" 10 | ,9.000000000,0.500000000,0.9,"10 of 10: 0.9 at 9 dur. 0.5" 11 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/notes-regions-no-flags.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav",0.000000000,1.750000000,0,"1 of 10: 0 at 0 dur. 1.75" 2 | ,1.000000000,0.500000000,0.1,"2 of 10: 0.1 at 1 dur. 0.5" 3 | ,2.000000000,1.750000000,0.2,"3 of 10: 0.2 at 2 dur. 1.75" 4 | ,3.000000000,0.500000000,0.3,"4 of 10: 0.3 at 3 dur. 0.5" 5 | ,4.000000000,1.750000000,0.4,"5 of 10: 0.4 at 4 dur. 1.75" 6 | ,5.000000000,0.500000000,0.5,"6 of 10: 0.5 at 5 dur. 0.5" 7 | ,6.000000000,1.750000000,0.6,"7 of 10: 0.6 at 6 dur. 1.75" 8 | ,7.000000000,0.500000000,0.7,"8 of 10: 0.7 at 7 dur. 0.5" 9 | ,8.000000000,1.750000000,0.8,"9 of 10: 0.8 at 8 dur. 1.75" 10 | ,9.000000000,0.500000000,0.9,"10 of 10: 0.9 at 9 dur. 0.5" 11 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/notes-regions-separator.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav"@0.000000000@1.750000000@0@"1 of 10: 0 at 0 dur. 1.75" 2 | @1.000000000@0.500000000@0.1@"2 of 10: 0.1 at 1 dur. 0.5" 3 | @2.000000000@1.750000000@0.2@"3 of 10: 0.2 at 2 dur. 1.75" 4 | @3.000000000@0.500000000@0.3@"4 of 10: 0.3 at 3 dur. 0.5" 5 | @4.000000000@1.750000000@0.4@"5 of 10: 0.4 at 4 dur. 1.75" 6 | @5.000000000@0.500000000@0.5@"6 of 10: 0.5 at 5 dur. 0.5" 7 | @6.000000000@1.750000000@0.6@"7 of 10: 0.6 at 6 dur. 1.75" 8 | @7.000000000@0.500000000@0.7@"8 of 10: 0.7 at 7 dur. 0.5" 9 | @8.000000000@1.750000000@0.8@"9 of 10: 0.8 at 8 dur. 1.75" 10 | @9.000000000@0.500000000@0.9@"10 of 10: 0.9 at 9 dur. 0.5" 11 | -------------------------------------------------------------------------------- /tests/test-summaries/expected/summaries-playlist.csv: -------------------------------------------------------------------------------- 1 | "3clicks.mp3",0.000000000,5.201269840,mean,164.674,"(mean value, continuous-time average)" 2 | ,0.000000000,5.201269840,median,169,"(median value, continuous-time average)" 3 | ,0.000000000,5.201269840,mode,0,"(modal value, continuous-time average)" 4 | ,0.000000000,5.201269840,mean,680.411,"(mean value, continuous-time average)" 5 | "6clicks.ogg",0.000000000,10.031020407,mean,166.612,"(mean value, continuous-time average)" 6 | ,0.000000000,10.031020407,median,167,"(median value, continuous-time average)" 7 | ,0.000000000,10.031020407,mode,170,"(modal value, continuous-time average)" 8 | ,0.000000000,10.031020407,mean,713.148,"(mean value, continuous-time average)" 9 | -------------------------------------------------------------------------------- /tests/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mypath=`dirname $0` 4 | 5 | for x in \ 6 | supportprogs \ 7 | helpfulflags \ 8 | parse-errors \ 9 | transforms-basic \ 10 | audioformat \ 11 | vamp-test-plugin \ 12 | as-advertised \ 13 | summaries \ 14 | multiple-audio \ 15 | csv-writer \ 16 | csv-destinations \ 17 | lab-writer \ 18 | lab-destinations \ 19 | rdf-writer \ 20 | rdf-destinations \ 21 | midi-writer \ 22 | midi-destinations \ 23 | jams-writer \ 24 | jams-destinations \ 25 | ; do 26 | 27 | echo -n "$x: " 28 | if ( cd $mypath/test-$x ; bash ./test-$x.sh ); then 29 | echo test succeeded 30 | else 31 | echo "*** Test FAILED" 32 | exit 1 33 | fi 34 | 35 | done 36 | 37 | -------------------------------------------------------------------------------- /tests/misc-queries/test-query-plugin-output-types: -------------------------------------------------------------------------------- 1 | 2 | PREFIX vamp: 3 | PREFIX examples: 4 | 5 | SELECT ?output_id ?output_type ?feature_type ?event_type ?unit 6 | FROM 7 | 8 | WHERE { 9 | ?plugin a vamp:Plugin . 10 | ?plugin vamp:identifier "percussiononsets" . 11 | ?plugin vamp:output_descriptor ?output . 12 | ?output vamp:identifier ?output_id . 13 | ?output a ?output_type . 14 | OPTIONAL { ?output vamp:computes_feature_type ?feature_type } . 15 | OPTIONAL { ?output vamp:computes_event_type ?event_type } . 16 | OPTIONAL { ?output vamp:unit ?unit } . 17 | } 18 | 19 | -------------------------------------------------------------------------------- /deploy/linux/AppRun: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | mydir=$(dirname "$0") 4 | case "$mydir" in 5 | /*) ;; 6 | *) mydir="$PWD/$mydir";; 7 | esac 8 | 9 | PATH="$mydir/usr/bin:$mydir/bin:$PATH" 10 | export PATH 11 | 12 | LD_LIBRARY_PATH="$mydir/usr/lib:$mydir/usr/lib/x86_64-linux-gnu:$mydir/usr/lib64:$LD_LIBRARY_PATH" 13 | export LD_LIBRARY_PATH 14 | 15 | QT_PLUGIN_PATH="$mydir/usr/lib/qt5/plugins/:$mydir/usr/lib/x86_64-linux-gnu/qt5/plugins/:$mydir/usr/lib64/qt5/plugins/:$QT_PLUGIN_PATH" 16 | export QT_PLUGIN_PATH 17 | 18 | XDG_DATA_DIRS="$mydir/usr/share:$XDG_DATA_DIRS:/usr/local/share:/usr/share" 19 | export XDG_DATA_DIRS 20 | 21 | GSETTINGS_SCHEMA_DIR="$mydir/usr/share/glib-2.0/schemas:$GSETTINGS_SCHEMA_DIR" 22 | export GSETTINGS_SCHEMA_DIR 23 | 24 | exec "$mydir/usr/bin/sonic-annotator" "$@" 25 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets ; 8 | vamp:output examples:percussiononsets_output_onsets ; 9 | vamp:step_size "512"; 10 | vamp:block_size "1024"; 11 | vamp:parameter_binding :param0 ; 12 | vamp:parameter_binding :param1 . 13 | 14 | :param0 a vamp:ParameterBinding; 15 | vamp:parameter [ vamp:identifier "sensitivity" ]; 16 | vamp:value "40". 17 | 18 | :param1 a vamp:ParameterBinding; 19 | vamp:parameter examples:percussiononsets_param_threshold; 20 | vamp:value "3". 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-set-parameters.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets ; 8 | vamp:output examples:percussiononsets_output_onsets ; 9 | vamp:step_size "512"; 10 | vamp:block_size "1024"; 11 | vamp:parameter_binding :param0 ; 12 | vamp:parameter_binding :param1 . 13 | 14 | :param0 a vamp:ParameterBinding; 15 | vamp:parameter [ vamp:identifier "sensitivity" ]; 16 | vamp:value "60". 17 | 18 | :param1 a vamp:ParameterBinding; 19 | vamp:parameter examples:percussiononsets_param_threshold; 20 | vamp:value "2.6". 21 | 22 | 23 | -------------------------------------------------------------------------------- /tests/test-vamp-test-plugin/expected/vamp-test-plugin-grid-fsr.csv: -------------------------------------------------------------------------------- 1 | ,0.000000000,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,"1 of 10 at 0" 2 | ,0.400000000,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,"2 of 10 at 0.4" 3 | ,0.800000000,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,"3 of 10 at 0.8" 4 | ,1.200000000,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,"4 of 10 at 1.2" 5 | ,1.600000000,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,"5 of 10 at 1.6" 6 | ,2.000000000,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,"6 of 10 at 2" 7 | ,2.400000000,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,"7 of 10 at 2.4" 8 | ,2.800000000,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,"8 of 10 at 2.8" 9 | ,3.200000000,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,"9 of 10 at 3.2" 10 | ,3.600000000,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1,"10 of 10 at 3.6" 11 | -------------------------------------------------------------------------------- /transforms/percussiononsets-detectionfunction.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets; 8 | vamp:output examples:percussiononsets_output_detectionfunction; 9 | # vamp:step_size "256"; 10 | # vamp:block_size "512"; 11 | vamp:window_type "Hanning"; 12 | vamp:parameter_binding :param0 ; 13 | vamp:parameter_binding :param1 . 14 | 15 | :param0 a vamp:ParameterBinding; 16 | vamp:parameter [ vamp:identifier "sensitivity" ]; 17 | vamp:value "60". 18 | 19 | :param1 a vamp:ParameterBinding; 20 | vamp:parameter examples:percussiononsets_param_threshold; 21 | vamp:value "2". 22 | 23 | 24 | -------------------------------------------------------------------------------- /transforms/percussiononsets.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets; 8 | vamp:output examples:percussiononsets_output_onsets; 9 | vamp:step_size "256"; 10 | vamp:block_size "512"; 11 | # vamp:sample_rate "44100"; 12 | vamp:window_type "Hanning"; 13 | vamp:parameter_binding :param0 ; 14 | vamp:parameter_binding :param1 . 15 | 16 | :param0 a vamp:ParameterBinding; 17 | vamp:parameter [ vamp:identifier "sensitivity" ]; 18 | vamp:value "40". 19 | 20 | :param1 a vamp:ParameterBinding; 21 | vamp:parameter examples:percussiononsets_param_threshold; 22 | vamp:value "3". 23 | 24 | 25 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-multiple-outputs-start-and-duration.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix xsd: . 5 | @prefix : <#>. 6 | 7 | :transform0 a vamp:Transform; 8 | vamp:plugin examples:percussiononsets ; 9 | vamp:output examples:percussiononsets_output_onsets ; 10 | vamp:start "PT1.0S"^^xsd:duration ; 11 | vamp:duration "PT3.0S"^^xsd:duration . 12 | 13 | :transform1 a vamp:Transform; 14 | vamp:plugin examples:percussiononsets ; 15 | vamp:output examples:percussiononsets_output_detectionfunction ; 16 | vamp:start "PT2.0S"^^xsd:duration ; 17 | vamp:duration "PT1.0S"^^xsd:duration . 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /tests/misc-queries/test-query-transforms: -------------------------------------------------------------------------------- 1 | 2 | PREFIX vamp: 3 | 4 | SELECT ?transform ?plugin ?output ?program 5 | ?step_size ?block_size ?window_type 6 | ?sample_rate ?start ?duration 7 | 8 | FROM 9 | 10 | WHERE { 11 | ?transform a vamp:Transform ; 12 | vamp:plugin ?plugin . 13 | OPTIONAL { ?transform vamp:output ?output } . 14 | OPTIONAL { ?transform vamp:program ?program } . 15 | OPTIONAL { ?transform vamp:step_size ?step_size } . 16 | OPTIONAL { ?transform vamp:block_size ?block_size } . 17 | OPTIONAL { ?transform vamp:window_type ?window_type } . 18 | OPTIONAL { ?transform vamp:sample_rate ?sample_rate } . 19 | OPTIONAL { ?transform vamp:start ?start } . 20 | OPTIONAL { ?transform vamp:duration ?duration } 21 | } 22 | -------------------------------------------------------------------------------- /tests/test-supportprogs/test-supportprogs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | fail() { 4 | echo "Test failed: $1" 5 | exit 1 6 | } 7 | 8 | xmllint --version 2>/dev/null || \ 9 | fail "Can't find required xmllint program (from libxml2 distribution)" 10 | 11 | rapper --version >/dev/null || \ 12 | fail "Can't find required rapper program (from raptor/redland distribution)" 13 | 14 | iconv --version >/dev/null || \ 15 | fail "Can't find required iconv program (usually associated with glibc or libiconv)" 16 | 17 | echo '{}' | json_verify >/dev/null || \ 18 | fail "Can't find required json_verify program (from yajl distribution), or it doesn't seem to work" 19 | 20 | echo '{}' | json_reformat >/dev/null || \ 21 | fail "Can't find required json_reformat program (from yajl distribution), or it doesn't seem to work" 22 | 23 | exit 0 24 | 25 | -------------------------------------------------------------------------------- /tests/test-summaries/expected/testplug-curve-vsr-mode.csv: -------------------------------------------------------------------------------- 1 | # Sonic Annotator's summary method integrates the values across 2 | # time. If an output lacks duration for its features, each feature is 3 | # considered to extend until the timestamp of the following feature, 4 | # and the final feature is considered to extend until the end of the 5 | # input or the last-ending output, whichever is later. 6 | # 7 | # The curve-vsr output is therefore considered to have 9 values (0.0 8 | # to 0.8) that span 0.75 seconds each, followed by one value (0.9) 9 | # that spans the 3 seconds from 6.75 to 9.75 where the final output of 10 | # the plugin ends (that's the notes-regions output). 11 | # 12 | # The modal value is the one spanning the longest, which of course is 13 | # that final one, 0.9. 14 | # 15 | 0.000000000,9.750000000,mode,0.9,"(modal value, continuous-time average)" 16 | -------------------------------------------------------------------------------- /deploy/osx/build-and-package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | version="$1" 6 | 7 | if [ -z "$version" ]; then 8 | echo "Usage: $0 " 9 | exit 2 10 | fi 11 | 12 | set -u 13 | 14 | if [ ! -d deploy/osx ]; then 15 | echo "This must be run from the project root" 16 | exit 1 17 | fi 18 | 19 | deploy/osx/configure.sh 20 | 21 | for arch in arm64 x86_64 ; do 22 | 23 | ninja -C build_"$arch" 24 | 25 | done 26 | 27 | dir="sonic-annotator-$version-macos" 28 | mkdir -p "$dir" 29 | 30 | lipo build_arm64/sonic-annotator build_x86_64/sonic-annotator -create -output "$dir"/sonic-annotator 31 | 32 | deploy/osx/sign.sh "$dir"/sonic-annotator 33 | deploy/osx/notarize.sh "$dir"/sonic-annotator 34 | 35 | cp README.md CHANGELOG COPYING CITATION "$dir/" 36 | tar cvzf "$dir.tar.gz" "$dir" 37 | rm -rf "$dir" 38 | 39 | mv "$dir.tar.gz" packages/ 40 | -------------------------------------------------------------------------------- /tests/test-vamp-test-plugin/test-vamp-test-plugin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . ../include.sh 4 | 5 | infile=$audiopath/20sec-silence.wav 6 | tmpcsv=$mypath/tmp_1_$$.csv 7 | 8 | trap "rm -f $tmpcsv" 0 9 | 10 | minversion=5 11 | $r --transform-minversion $testplug $minversion || \ 12 | fail "Vamp Test Plugin version is too old (at least v$minversion required)" 13 | 14 | for output in instants curve-oss curve-fsr curve-fsr-timed curve-fsr-mixed curve-vsr grid-oss grid-fsr notes-regions; do 15 | 16 | $r -d "$testplug:$output" -w csv --csv-one-file "$tmpcsv" --csv-force "$infile" 2>/dev/null || \ 17 | fail "Failed to run for plugin $testplug with output $output" 18 | 19 | csvcompare_ignorefirst "$tmpcsv" "$mypath/expected/vamp-test-plugin-$output.csv" || \ 20 | faildiff "Output differs from expected for $output" "$tmpcsv" "$mypath/expected/vamp-test-plugin-$output.csv" 21 | 22 | done 23 | 24 | exit 0 25 | 26 | -------------------------------------------------------------------------------- /repoint-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "libraries": { 3 | "vamp-plugin-sdk": { 4 | "pin": "44c2487763eb248a933e9eff9169cfadee375009" 5 | }, 6 | "svcore": { 7 | "pin": "06dbb2659e0d1f8da7f6219557503706445b5f34" 8 | }, 9 | "checker": { 10 | "pin": "5ba274674cf9cbe1eafa2243e1356b2076c3dbd7" 11 | }, 12 | "sv-dependency-builds": { 13 | "pin": "01bb14514cdbed5f7741ddad8d0a0e1021fbbcbc" 14 | }, 15 | "piper-vamp-cpp": { 16 | "pin": "6f16a09b78b995b3cf2844f00033bde90e5e0936" 17 | }, 18 | "dataquay": { 19 | "pin": "3dbf25604e7a" 20 | }, 21 | "bqvec": { 22 | "pin": "291cde50db9d" 23 | }, 24 | "bqfft": { 25 | "pin": "d41a117b8cbe" 26 | }, 27 | "bqresample": { 28 | "pin": "38c3e524416a" 29 | }, 30 | "bqaudiostream": { 31 | "pin": "93ceac5a1d83" 32 | }, 33 | "bqthingfactory": { 34 | "pin": "2e4bd170f57f" 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tests/test-parse-errors/test-parse-errors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . ../include.sh 4 | 5 | infile=$audiopath/3clicks8.wav 6 | tmpfile=$mypath/tmp_$$ 7 | trap "rm -f $tmpfile" 0 8 | 9 | for transform in "$mypath"/inputs/* ; do 10 | 11 | base=$(basename "$transform") 12 | expected="$mypath"/expected/"$base".txt 13 | 14 | if [ ! -f "$expected" ]; then 15 | fail "Internal error: Expected file $expected not found for transform $transform" 16 | fi 17 | 18 | if $r -t "$transform" -w csv --csv-one-file /dev/null "$infile" 2>"$tmpfile" ; then 19 | fail "Erroneously succeeds in running bogus transform $transform" 20 | fi 21 | 22 | cat "$expected" | while read line; do 23 | if ! grep -F -q "$line" "$tmpfile" ; then 24 | echo "Unexpected output: " 25 | cat "$tmpfile" 26 | fail "Expected output text \"$line\" not found in diagnostic output for transform $base" 27 | fi 28 | done 29 | 30 | done 31 | 32 | -------------------------------------------------------------------------------- /tests/test-summaries/expected/testplug-curve-vsr-median.csv: -------------------------------------------------------------------------------- 1 | # Sonic Annotator's summary method integrates the values across 2 | # time. If an output lacks duration for its features, each feature is 3 | # considered to extend until the timestamp of the following feature, 4 | # and the final feature is considered to extend until the end of the 5 | # input or the last-ending output, whichever is later. 6 | # 7 | # The curve-vsr output is therefore considered to have 9 values (0.0 8 | # to 0.8) that span 0.75 seconds each, followed by one value (0.9) 9 | # that spans the 3 seconds from 6.75 to 9.75 where the final output of 10 | # the plugin ends (that's the notes-regions output). 11 | # 12 | # Since the values from this output are already sorted and are 13 | # distinct, the integrated median is just whatever is in effect at 14 | # time 9.75 / 2.0 = 4.875. This value is 0.6. 15 | # 16 | 0.000000000,9.750000000,median,0.6,"(median value, continuous-time average)" 17 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-start-and-duration.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix xsd: . 5 | @prefix : <#>. 6 | 7 | :transform0 a vamp:Transform; 8 | vamp:plugin examples:percussiononsets ; 9 | vamp:output examples:percussiononsets_output_onsets ; 10 | vamp:step_size "512"; 11 | vamp:block_size "1024"; 12 | vamp:parameter_binding :param0 ; 13 | vamp:parameter_binding :param1 ; 14 | vamp:start "PT2.0S"^^xsd:duration ; 15 | vamp:duration "PT2.0S"^^xsd:duration . 16 | 17 | :param0 a vamp:ParameterBinding; 18 | vamp:parameter [ vamp:identifier "sensitivity" ]; 19 | vamp:value "40". 20 | 21 | :param1 a vamp:ParameterBinding; 22 | vamp:parameter examples:percussiononsets_param_threshold; 23 | vamp:value "3". 24 | 25 | 26 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/transforms/percussiononsets-df-start-and-duration.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix xsd: . 5 | @prefix : <#>. 6 | 7 | :transform0 a vamp:Transform; 8 | vamp:plugin examples:percussiononsets ; 9 | vamp:output examples:percussiononsets_output_detectionfunction ; 10 | vamp:step_size "512"; 11 | vamp:block_size "1024"; 12 | vamp:parameter_binding :param0 ; 13 | vamp:parameter_binding :param1 ; 14 | vamp:start "PT2.0S"^^xsd:duration ; 15 | vamp:duration "PT2.0S"^^xsd:duration . 16 | 17 | :param0 a vamp:ParameterBinding; 18 | vamp:parameter [ vamp:identifier "sensitivity" ]; 19 | vamp:value "40". 20 | 21 | :param1 a vamp:ParameterBinding; 22 | vamp:parameter examples:percussiononsets_param_threshold; 23 | vamp:value "3". 24 | 25 | 26 | -------------------------------------------------------------------------------- /tests/test-vamp-test-plugin/expected/vamp-test-plugin-curve-oss.csv: -------------------------------------------------------------------------------- 1 | ,0.000000000,0,"1 of 20: 0 at 0" 2 | ,0.023219954,0.05,"2 of 20: 0.05 at 0.023" 3 | ,0.046439909,0.1,"3 of 20: 0.1 at 0.046" 4 | ,0.069659863,0.15,"4 of 20: 0.15 at 0.069" 5 | ,0.092879818,0.2,"5 of 20: 0.2 at 0.092" 6 | ,0.116099773,0.25,"6 of 20: 0.25 at 0.116" 7 | ,0.139319727,0.3,"7 of 20: 0.3 at 0.139" 8 | ,0.162539682,0.35,"8 of 20: 0.35 at 0.162" 9 | ,0.185759637,0.4,"9 of 20: 0.4 at 0.185" 10 | ,0.208979591,0.45,"10 of 20: 0.45 at 0.208" 11 | ,0.232199546,0.5,"11 of 20: 0.5 at 0.232" 12 | ,0.255419501,0.55,"12 of 20: 0.55 at 0.255" 13 | ,0.278639455,0.6,"13 of 20: 0.6 at 0.278" 14 | ,0.301859410,0.65,"14 of 20: 0.65 at 0.301" 15 | ,0.325079365,0.7,"15 of 20: 0.7 at 0.325" 16 | ,0.348299319,0.75,"16 of 20: 0.75 at 0.348" 17 | ,0.371519274,0.8,"17 of 20: 0.8 at 0.371" 18 | ,0.394739229,0.85,"18 of 20: 0.85 at 0.394" 19 | ,0.417959183,0.9,"19 of 20: 0.9 at 0.417" 20 | ,0.441179138,0.95,"20 of 20: 0.95 at 0.441" 21 | -------------------------------------------------------------------------------- /tests/misc-queries/test-query-plugin-for-transform: -------------------------------------------------------------------------------- 1 | 2 | PREFIX vamp: 3 | 4 | SELECT ?transform ?plugin ?step_size ?block_size ?window_type ?program ?sample_rate ?start ?duration ?param_id ?param_value 5 | FROM 6 | 7 | WHERE { 8 | ?transform a vamp:Transform . 9 | ?transform vamp:plugin ?plugin . 10 | OPTIONAL { ?transform vamp:step_size ?step_size } . 11 | OPTIONAL { ?transform vamp:block_size ?block_size } . 12 | OPTIONAL { ?transform vamp:window_type ?window_type } . 13 | OPTIONAL { ?transform vamp:program ?program } . 14 | OPTIONAL { ?transform vamp:sample_rate ?sample_rate } . 15 | OPTIONAL { ?transform vamp:start ?start } . 16 | OPTIONAL { ?transform vamp:duration ?duration } . 17 | OPTIONAL { 18 | ?transform vamp:parameter ?param . 19 | ?param vamp:identifier ?param_id . 20 | ?param vamp:value ?param_value 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | Makefile 3 | */Makefile 4 | o/* 5 | */o/* 6 | */tmp_obj/* 7 | */tmp_moc/* 8 | doc/html/ 9 | *.o 10 | *.so 11 | *.so.* 12 | *.a 13 | *~ 14 | *.orig 15 | *.rej 16 | .git 17 | cov-int 18 | vamp-plugin-sdk 19 | svcore 20 | piper-vamp-cpp 21 | dataquay 22 | bqvec 23 | bqfft 24 | bqresample 25 | sv-dependency-builds 26 | build_win32 27 | build_win64 28 | glob:.repoint* 29 | Makefile.* 30 | .qmake.stash 31 | re:^autom4te\.cache/ 32 | re:^sonic-annotator$ 33 | re:^aclocal\.m4$ 34 | re:^config\.log$ 35 | re:^config\.pri$ 36 | re:^config\.status$ 37 | tmp* 38 | test-svcore-base 39 | test-svcore-data-fileio 40 | test-svcore-data-model 41 | test-svcore-system 42 | vgcore* 43 | valgrind.log 44 | Dockerfile*.gen 45 | squashfs-root 46 | .notarization-uuid 47 | .notarization-status 48 | build_win64_debug 49 | build_win64_static 50 | *.AppImage 51 | *.AppDir 52 | bundle 53 | bundle.zip 54 | *.vcxproj 55 | *.filters 56 | *.zip 57 | *.lib 58 | *.pdb 59 | *.sln 60 | *.tar.gz 61 | *.app 62 | *_plugin_import.cpp 63 | -------------------------------------------------------------------------------- /deploy/src/archive.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eu 4 | 5 | tag=`git tag --list --sort=creatordate | grep '^sonic-annotator-' | tail -1 | awk '{ print $1; }'` 6 | 7 | v=`echo "$tag" | sed 's/sonic-annotator-//' | sed 's/_.*$//'` 8 | 9 | echo -n "Package up source code for version $v from tag $tag [Yn] ? " 10 | read yn 11 | case "$yn" in "") ;; [Yy]) ;; *) exit 3;; esac 12 | echo "Proceeding" 13 | 14 | case $(git status --porcelain --untracked-files=no) in 15 | "") ;; 16 | *) echo "ERROR: Current working copy has been modified - unmodified copy required so we can update to tag and back again safely"; exit 2;; 17 | esac 18 | 19 | echo 20 | echo -n "Packaging up version $v from tag $tag... " 21 | 22 | current=$(git rev-parse --short HEAD) 23 | 24 | mkdir -p packages 25 | 26 | git checkout "$tag" 27 | 28 | ./repoint archive "$(pwd)"/packages/sonic-annotator-"$v".tar.gz --exclude sv-dependency-builds .gitignore .github .hgignore .appveyor.yml .hgtags 29 | 30 | git checkout "$current" 31 | 32 | echo Done 33 | echo 34 | -------------------------------------------------------------------------------- /deploy/metadata.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | all_info=$(meson introspect --projectinfo meson.build -i) 4 | rdomain="uk.co.particularprograms" 5 | 6 | version=$(echo "$all_info" | grep '"version"' | sed -e 's/^.*: "//' -e 's/".*$//') 7 | 8 | literalversion="$version" 9 | 10 | case "$version" in 11 | 1.0) echo "## Error: Version $version must not be used - it is the App Store sandbox default"; exit 2;; 12 | [0-9].[0-9]) version="$version".0 ;; 13 | [0-9].[0-9].[0-9]) v="$version" ;; 14 | *) echo "## Error: Version $version is neither two- nor three-part number" ; exit 2;; 15 | esac 16 | 17 | full_name=$(echo "$all_info" | grep '"descriptive_name"' | sed -e 's/^.*: "//' -e 's/".*$//') 18 | 19 | full_app="$full_name.app" 20 | full_condensed=$(echo "$full_name" | sed 's/ //g') 21 | full_kebab=$(echo "$full_name" | tr '[A-Z]' '[a-z]' | sed 's/ /-/g') 22 | full_ident="$rdomain.$full_condensed" 23 | full_versioned="$full_name $version" 24 | full_dmg="$full_versioned.dmg" 25 | full_pkg="${full_condensed}_$version.pkg" 26 | 27 | -------------------------------------------------------------------------------- /runner/FeatureWriterFactory.h: -------------------------------------------------------------------------------- 1 | /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 2 | 3 | /* 4 | Sonic Annotator 5 | A utility for batch feature extraction from audio files. 6 | Mark Levy, Chris Sutton and Chris Cannam, Queen Mary, University of London. 7 | Copyright 2007-2008 QMUL. 8 | 9 | This program is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. See the file 13 | COPYING included with this distribution for more information. 14 | */ 15 | 16 | 17 | #ifndef FEATURE_WRITER_FACTORY_H 18 | #define FEATURE_WRITER_FACTORY_H 19 | 20 | #include 21 | #include 22 | 23 | namespace sv { 24 | 25 | class FeatureWriter; 26 | 27 | class FeatureWriterFactory 28 | { 29 | public: 30 | static std::set getWriterTags(); 31 | static FeatureWriter *createWriter(std::string tag); 32 | }; 33 | 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Makefile* 2 | */Makefile 3 | o/* 4 | */o/* 5 | */tmp_obj/* 6 | */tmp_moc/* 7 | doc/html/ 8 | *.o 9 | *.so 10 | *.so.* 11 | *.a 12 | *~ 13 | *.orig 14 | *.rej 15 | autom4te.cache 16 | qrc_sonic-visualiser.cpp 17 | sonic-visualiser 18 | aclocal.m4 19 | config.log 20 | config.pri 21 | config.status 22 | *.app 23 | Sonic Visualiser* 24 | .DS_Store 25 | *.stash 26 | cov-int/* 27 | *.deb 28 | test-svcore-base 29 | test-svcore-data-fileio 30 | test-svcore-data-model 31 | test-svcore-system 32 | vamp-plugin-sdk 33 | svcore 34 | svgui 35 | svapp 36 | checker 37 | piper 38 | piper-vamp-cpp 39 | dataquay 40 | bqvec 41 | bqfft 42 | bqresample 43 | bqaudioio 44 | bqaudiostream 45 | bqthingfactory 46 | build/ 47 | sv-dependency-builds 48 | icons/scalable 49 | vamp-plugin-load-checker 50 | piper-vamp-simple-server 51 | piper-convert 52 | *.msi 53 | *.user 54 | .vext* 55 | .repoint* 56 | build_win32 57 | build_win64 58 | build_win64_debug 59 | build-arm64 60 | build-x86_64 61 | *.AppImage 62 | *.AppDir 63 | Dockerfile*.gen 64 | squashfs-root 65 | .notarization-uuid 66 | .notarization-status 67 | sonic-visualiser.wxs 68 | -------------------------------------------------------------------------------- /deploy/osx/notarize.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## The following assumes we have generated an app password at 4 | ## appleid.apple.com, then 5 | ## xcrun notarytool store-credentials notarytool-cannam --apple-id X --team-id Y 6 | ## Note! if the machine is locked when this gets run, it will fail as if no 7 | ## credentials had ever been stored. Don't be deceived 8 | 9 | set -e 10 | 11 | exe="$1" 12 | 13 | if [ ! -f "$exe" ] || [ -n "$2" ]; then 14 | echo "Usage: $0 " 15 | echo " e.g. $0 my-program" 16 | exit 2 17 | fi 18 | 19 | set -u 20 | 21 | user="appstore@particularprograms.co.uk" 22 | team_id="73F996B92S" 23 | 24 | . deploy/metadata.sh 25 | 26 | rm -f bundle.zip 27 | rm -rf bundle 28 | mkdir bundle 29 | cp "$exe" bundle/ 30 | ditto -c -k bundle bundle.zip 31 | 32 | echo 33 | echo "Uploading for notarization..." 34 | 35 | xcrun notarytool submit \ 36 | bundle.zip \ 37 | --apple-id "$user" \ 38 | --team-id "$team_id" \ 39 | --keychain-profile notarytool-cannam \ 40 | --wait --progress 41 | 42 | echo 43 | echo "Done, not stapling as just an executable" 44 | 45 | -------------------------------------------------------------------------------- /tests/test-summaries/expected/testplug-curve-vsr-mean.csv: -------------------------------------------------------------------------------- 1 | # Sonic Annotator's summary method integrates the values across 2 | # time. If an output lacks duration for its features, each feature is 3 | # considered to extend until the timestamp of the following feature, 4 | # and the final feature is considered to extend until the end of the 5 | # input or the last-ending output, whichever is later. 6 | # 7 | # The curve-vsr output is therefore considered to have 9 values (0.0 8 | # to 0.8) that span 0.75 seconds each, followed by one value (0.9) 9 | # that spans the 3 seconds from 6.75 to 9.75 where the final output of 10 | # the plugin ends (that's the notes-regions output). 11 | # 12 | # The sum of 0.0..0.8 is 3.6, so the mean is (3.6 * 0.75 + 0.9 * 3.0) 13 | # / 9.75 = 0.553846 approx. 14 | # 15 | # Equivalently we can consider the last feature the same as four 16 | # features of 0.75 seconds each (i.e. the same durations as the first 17 | # 9) each with the same value, 0.9. The mean is then the sum of 18 | # 0.0..0.9 plus three more 0.9s, i.e. 7.2, divided by 13. 19 | # 20 | 0.000000000,9.750000000,mean,0.553846,"(mean value, continuous-time average)" 21 | -------------------------------------------------------------------------------- /tests/test-summaries/expected/testplug-curve-vsr-variance.csv: -------------------------------------------------------------------------------- 1 | # Sonic Annotator's summary method integrates the values across 2 | # time. If an output lacks duration for its features, each feature is 3 | # considered to extend until the timestamp of the following feature, 4 | # and the final feature is considered to extend until the end of the 5 | # input or the last-ending output, whichever is later. 6 | # 7 | # The curve-vsr output is therefore considered to have 9 values (0.0 8 | # to 0.8) that span 0.75 seconds each, followed by one value (0.9) 9 | # that spans the 3 seconds from 6.75 to 9.75 where the final output of 10 | # the plugin ends (that's the notes-regions output). 11 | # 12 | # We can consider the last feature the same as four features of 0.75 13 | # seconds each (i.e. the same durations as the first 9) each with the 14 | # same value, 0.9. 15 | # 16 | # The mean m is then 7.2 / 13 = 0.553846 approx, and the variance is 17 | # the sum for each of the 13 (partly fictitious) values v of (v-m)^2, 18 | # divided by 13. This works out as 0.0994083 ish. 19 | # 20 | 0.000000000,9.750000000,variance,0.0994083,"(variance, continuous-time average)" 21 | -------------------------------------------------------------------------------- /tests/test-summaries/test-summaries-testplugin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . ../include.sh 4 | 5 | infile=$audiopath/3clicks8.wav 6 | tmpfile=$mypath/tmp_1_$$ 7 | tmpfile2=$mypath/tmp_2_$$ 8 | 9 | trap "rm -f $tmpfile $tmpfile2" 0 10 | 11 | for output in curve-vsr grid-fsr; do 12 | 13 | for summary in min max mean median mode sum variance sd count; do 14 | 15 | # grid-fsr is bulkier, and we're only really concerned that 16 | # we're getting a sane result per bin, so just do min and max 17 | # there 18 | if [ "$output" = "grid-fsr" ]; then 19 | case "$summary" in 20 | mean|median|mode|sum|variance|sd|count) continue;; 21 | esac 22 | fi 23 | 24 | id="$testplug:$output" 25 | expected="$mypath/expected/testplug-$output-$summary.csv" 26 | 27 | cat "$expected" | grep -v '^#' > "$tmpfile2" 28 | 29 | $r -d $id -w csv --csv-stdout -S $summary --summary-only --csv-omit-filename $infile > $tmpfile 2>/dev/null || \ 30 | fail "Fails to run transform id $id with summary type $summary" 31 | 32 | csvcompare "$tmpfile" "$tmpfile2" || 33 | faildiff "Output mismatch for output $output with summary type $summary" "$tmpfile" "$tmpfile2" 34 | 35 | done 36 | done 37 | -------------------------------------------------------------------------------- /tests/test-summaries/transforms/detectionfunction.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets ; 8 | vamp:output examples:percussiononsets_output_detectionfunction ; 9 | vamp:summary_type "mean" . 10 | 11 | :transform1 a vamp:Transform; 12 | vamp:plugin examples:percussiononsets ; 13 | vamp:output examples:percussiononsets_output_detectionfunction ; 14 | vamp:summary_type "median" . 15 | 16 | :transform2 a vamp:Transform; 17 | vamp:plugin examples:percussiononsets ; 18 | vamp:output examples:percussiononsets_output_onsets . 19 | 20 | :transform3 a vamp:Transform; 21 | vamp:plugin examples:percussiononsets ; 22 | vamp:output examples:percussiononsets_output_detectionfunction ; 23 | vamp:summary_type "mode" . 24 | 25 | :transform4 a vamp:Transform; 26 | vamp:plugin examples:percussiononsets ; 27 | vamp:output examples:percussiononsets_output_detectionfunction ; 28 | vamp:step_size 2048 ; 29 | vamp:block_size 4096 ; 30 | vamp:summary_type "mean" . 31 | 32 | 33 | -------------------------------------------------------------------------------- /.github/workflows/linux.yml: -------------------------------------------------------------------------------- 1 | name: Linux CI 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-22.04 9 | 10 | steps: 11 | - uses: actions/checkout@v2 12 | - name: install-packages 13 | run: | 14 | sudo apt-get update 15 | sudo apt-get install build-essential libbz2-dev libfftw3-dev libfishsound1-dev libid3tag0-dev libmad0-dev liboggz2-dev libopus-dev libopusfile-dev libsamplerate-dev libsndfile-dev libsord-dev libxml2-utils qt6-base-dev qt6-base-dev-tools yajl-tools raptor2-utils git mercurial autoconf automake libtool smlnj ninja-build libglib2.0-dev 16 | - name: install-meson 17 | run: | 18 | mkdir -p tmp/meson 19 | cd tmp/meson 20 | wget https://github.com/mesonbuild/meson/releases/download/1.3.1/meson-1.3.1.tar.gz 21 | tar xvf meson-1.3.1.tar.gz 22 | sudo ln -s $(pwd)/meson-1.3.1/meson.py /usr/bin/meson 23 | - name: repoint 24 | run: ./repoint install 25 | - name: configure 26 | run: | 27 | qtchooser -install qt6 $(which qmake6) 28 | QT_SELECT=qt6 meson setup build --buildtype release 29 | - name: make 30 | run: ninja -C build 31 | - name: test 32 | run: meson test -C build 33 | -------------------------------------------------------------------------------- /deploy/linux/docker/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | version=$(perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' version.h | sed 's/-//g') 4 | 5 | dockerdir=./deploy/linux/docker 6 | if [ ! -d "$dockerdir" ]; then 7 | echo "Run this script from the build root" 8 | exit 2 9 | fi 10 | 11 | platform="$1" 12 | 13 | if [ -z "$platform" ] || [ -n "$2" ]; then 14 | echo "Usage: $0 " 15 | echo "where matches the suffix of the Docker file, e.g. ubuntu1604" 16 | exit 2 17 | fi 18 | 19 | set -eu 20 | 21 | echo "Building for version $version, platform $platform" 22 | dockerfile="Dockerfile_v${version}_${platform}" 23 | 24 | if [ ! -f "$dockerdir/$dockerfile" ]; then 25 | echo "No matching docker file $dockerfile found in $dockerdir" 26 | exit 1 27 | fi 28 | 29 | dockertag="cannam/sonic-annotator-$platform" 30 | 31 | sudo docker build -t "$dockertag" -f "$dockerdir/$dockerfile" "$dockerdir" 32 | 33 | outdir="$dockerdir/output" 34 | mkdir -p "$outdir" 35 | 36 | container=$(sudo docker create "$dockertag") 37 | sudo docker cp "$container":output.tar "$outdir" 38 | sudo docker rm "$container" 39 | 40 | ( cd "$outdir" ; tar xf output.tar && rm -f output.tar ) 41 | 42 | echo 43 | echo "Done, output directory contains:" 44 | ls -ltr "$outdir" 45 | -------------------------------------------------------------------------------- /.github/workflows/windows.yml: -------------------------------------------------------------------------------- 1 | name: Windows CI 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: windows-2019 9 | 10 | steps: 11 | - uses: actions/checkout@v3 12 | - uses: ProjectSavanna/setup-sml@v1.2.0 13 | with: 14 | smlnj-version: '110.99.4' 15 | - uses: actions/setup-python@v1 16 | with: 17 | python-version: '3.x' 18 | - uses: jurplel/install-qt-action@v3 19 | with: 20 | version: '6.6.1' 21 | host: 'windows' 22 | target: 'desktop' 23 | arch: 'win64_msvc2019_64' 24 | - uses: ilammy/msvc-dev-cmd@v1 25 | with: 26 | vsversion: '2019' 27 | 28 | - name: install-meson 29 | run: pip install meson ninja 30 | 31 | - name: repoint 32 | run: ./repoint install 33 | 34 | - name: configure 35 | run: meson setup build --buildtype release 36 | 37 | - name: copy-qt-etc 38 | run: | 39 | foreach ($lib in 'Core','Network','Xml','Test') { copy "..\Qt\6.6.1\msvc2019_64\bin\Qt6$lib.dll" build } 40 | cp sv-dependency-builds\win64-msvc\lib\libsndfile-1.dll build 41 | 42 | - name: build 43 | run: ninja -C build 44 | 45 | - name: test 46 | run: meson test -C build 47 | 48 | -------------------------------------------------------------------------------- /.hgtags: -------------------------------------------------------------------------------- 1 | 0f7c8b9410efe6a7ecabc0b3fcec994a35112766 sonic-annotator-0.2 2 | 102bb17291847f7d7cb2eab57231af70ad8125dd sonic-annotator-0.4 3 | 4ab7c925f7ac9e0d5dd1cdc36b0036a11bef7f22 sonic-annotator-0.3 4 | 601088ff97997cb8316fe4768d0e69906fc91c00 sonic-annotator-0.5 5 | b74df6cb24cbf4d51ba681a3d47bfef47ff0ed6c sa-v0.1 6 | 7d6426295dd6597981f944361437404b6ecea704 sonic-annotator-0.6 7 | bbf68c187b747bbe9985a3c22ba1398f71dcf34d sonic-annotator-0.7 8 | bbf68c187b747bbe9985a3c22ba1398f71dcf34d sonic-annotator-0.7 9 | e4652b60e469c8d09487c03c7a875f109696efaf sonic-annotator-0.7 10 | e4652b60e469c8d09487c03c7a875f109696efaf sonic-annotator-0.7 11 | ace08e6519a9e48210231c789889b25e82079ecf sonic-annotator-0.7 12 | 52e5e2c03792209d1cd7561d34ecd0f3c33eb676 sonic-annotator-1.0 13 | 52e5e2c03792209d1cd7561d34ecd0f3c33eb676 sonic-annotator-1.0 14 | 5fe1f2efd40779acbdccc4c91a53693bd61f6d9b sonic-annotator-1.0 15 | 766268a32378f8e9e4fdfd3c78c3d43d482976ca sonic-annotator-1.1 16 | f35bbb3e4d41caf3ca1be5576ed8ef6ef7c23e34 sonic-annotator-1.2 17 | 710f4885f901c7b6617cfa4f1d9b3ff6a431affb sonic-annotator-1.3 18 | 85ab36c3b7d8f083478b352c79bdf35dfc9a9d5a sonic-annotator-1.4 19 | fd4a6183482f9e08ad5f48339cd3679e45cb9ba8 kapoor_1202 20 | 929e37acf0d9f2a4366c8489b721d847004bdeda sonic-annotator-1.5 21 | a82030ec7b1f6f7c5bfd125e38d1123570fb1a78 sonic-annotator-1.6 22 | -------------------------------------------------------------------------------- /deploy/win/build-32.bat: -------------------------------------------------------------------------------- 1 | rem Run this from within the top-level SV dir: deploy\win64\build-32.bat 2 | rem To build from clean, delete the folder build_win32 3 | 4 | set STARTPWD=%CD% 5 | 6 | set QTDIR=C:\Qt\5.11.3\mingw53_32 7 | if not exist %QTDIR% ( 8 | @ echo Could not find 32-bit Qt 9 | @ exit /b 2 10 | ) 11 | 12 | set ORIGINALPATH=%PATH% 13 | set PATH=%PATH%;C:\Program Files (x86)\SMLNJ\bin;%QTDIR%\bin;C:\Qt\Tools\QtCreator\bin;C:\Qt\Tools\mingw530_32\bin 14 | 15 | cd %STARTPWD% 16 | 17 | call .\repoint install 18 | if %errorlevel% neq 0 exit /b %errorlevel% 19 | 20 | mkdir build_win32 21 | cd build_win32 22 | 23 | qmake -spec win32-g++ -r ..\sonic-annotator.pro 24 | if %errorlevel% neq 0 exit /b %errorlevel% 25 | 26 | mingw32-make 27 | if %errorlevel% neq 0 exit /b %errorlevel% 28 | 29 | copy %QTDIR%\bin\Qt5Core.dll .\release 30 | copy %QTDIR%\bin\Qt5Network.dll .\release 31 | copy %QTDIR%\bin\Qt5Xml.dll .\release 32 | copy %QTDIR%\bin\Qt5Test.dll .\release 33 | copy %QTDIR%\bin\libgcc_s_dw2-1.dll .\release 34 | copy %QTDIR%\bin\"libstdc++-6.dll" .\release 35 | copy %QTDIR%\bin\libwinpthread-1.dll .\release 36 | copy %QTDIR%\plugins\platforms\qminimal.dll .\release 37 | copy %QTDIR%\plugins\platforms\qwindows.dll .\release 38 | 39 | .\release\test-svcore-base 40 | .\release\test-svcore-system 41 | 42 | .\release\sonic-annotator -v 43 | 44 | set PATH=%ORIGINALPATH% 45 | cd %STARTPWD% 46 | -------------------------------------------------------------------------------- /runner/DefaultFeatureWriter.h: -------------------------------------------------------------------------------- 1 | /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 2 | 3 | /* 4 | Sonic Annotator 5 | A utility for batch feature extraction from audio files. 6 | Mark Levy, Chris Sutton and Chris Cannam, Queen Mary, University of London. 7 | Copyright 2007-2008 QMUL. 8 | 9 | This program is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. See the file 13 | COPYING included with this distribution for more information. 14 | */ 15 | 16 | #ifndef DEFAULT_FEATURE_WRITER_H 17 | #define DEFAULT_FEATURE_WRITER_H 18 | 19 | #include "transform/FeatureWriter.h" 20 | 21 | namespace sv { 22 | 23 | class DefaultFeatureWriter : public FeatureWriter 24 | { 25 | public: 26 | virtual ~DefaultFeatureWriter() { } 27 | virtual std::string getDescription() const; 28 | virtual void write(QString trackid, 29 | const Transform &transform, 30 | const Vamp::Plugin::OutputDescriptor &output, 31 | const Vamp::Plugin::FeatureList &features, 32 | std::string summaryType = ""); 33 | virtual void finish() { } 34 | virtual QString getWriterTag() const { return "default"; } 35 | }; 36 | 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /deploy/linux/docker/Dockerfile_v1.5_ubuntu1604: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | MAINTAINER Chris Cannam 3 | RUN apt-get update && \ 4 | apt-get install -y \ 5 | build-essential \ 6 | libbz2-dev \ 7 | libfftw3-dev \ 8 | libfishsound1-dev \ 9 | libid3tag0-dev \ 10 | liblo-dev \ 11 | liblrdf0-dev \ 12 | libmad0-dev \ 13 | liboggz2-dev \ 14 | libpulse-dev \ 15 | libsamplerate-dev \ 16 | libsndfile-dev \ 17 | libsord-dev \ 18 | libxml2-utils \ 19 | portaudio19-dev \ 20 | qt5-default libqt5svg5-dev \ 21 | raptor-utils \ 22 | librubberband-dev \ 23 | git \ 24 | mercurial \ 25 | curl wget \ 26 | yajl-tools \ 27 | autoconf automake libtool lintian 28 | RUN apt-get clean && rm -rf /var/lib/apt/lists/* 29 | RUN locale-gen en_US.UTF-8 30 | ENV LANG en_US.UTF-8 31 | ENV LANGUAGE en_US:en 32 | ENV LC_ALL en_US.UTF-8 33 | RUN hg clone https://code.soundsoftware.ac.uk/hg/vamp-plugin-sdk 34 | RUN hg clone https://code.soundsoftware.ac.uk/hg/vamp-test-plugin 35 | WORKDIR vamp-plugin-sdk 36 | RUN ./configure 37 | RUN make -j3 38 | RUN mkdir ~/vamp 39 | RUN cp examples/vamp-example-plugins.so ~/vamp/ 40 | WORKDIR ../vamp-test-plugin 41 | RUN make -f Makefile.linux 42 | RUN cp vamp-test-plugin.so ~/vamp/ 43 | WORKDIR .. 44 | RUN hg clone -rsonic-annotator-1.5 https://code.soundsoftware.ac.uk/hg/sonic-annotator 45 | WORKDIR sonic-annotator 46 | RUN ./configure 47 | RUN make -j3 48 | RUN deploy/linux/deploy-deb.sh 1.5 amd64 49 | RUN tar cvf output.tar *.deb && cp output.tar .. 50 | -------------------------------------------------------------------------------- /deploy/clean-build-and-package: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eu 4 | 5 | case $(git status --porcelain --untracked-files=no) in 6 | "") ;; 7 | *) echo "ERROR: Current working copy has been modified - not proceeding"; exit 2;; 8 | esac 9 | 10 | mkdir -p packages 11 | echo 12 | 13 | . deploy/metadata.sh 14 | 15 | if [ -d /Applications ]; then 16 | 17 | echo "Proceed to rebuild, package, and sign version $version [Yn] ? " 18 | read yn 19 | case "$yn" in "") ;; [Yy]) ;; *) exit 3;; esac 20 | echo "Proceeding" 21 | 22 | ./repoint install 23 | 24 | deploy/osx/build-and-package.sh "$version" 25 | 26 | else 27 | 28 | echo -n "Proceed to rebuild and package version $version [Yn] ? " 29 | read yn 30 | case "$yn" in "") ;; [Yy]) ;; *) exit 3;; esac 31 | echo "Proceeding" 32 | 33 | ./deploy/linux/build-and-test-appimage.sh 34 | 35 | squashedversion=$(echo "$version" | sed 's/_-//g') 36 | 37 | current=$(git rev-parse --short HEAD) 38 | 39 | dir="sonic-annotator-$version-linux64-static" 40 | 41 | ( 42 | cd deploy/linux/docker/output 43 | mkdir -p "$dir" 44 | cp SonicAnnotator-"$current"-x86_64.AppImage "$dir/sonic-annotator" 45 | chmod +x "$dir/sonic-annotator" 46 | cp ../../../../README.md "$dir" 47 | cp ../../../../CHANGELOG "$dir" 48 | cp ../../../../COPYING "$dir" 49 | cp ../../../../CITATION "$dir" 50 | tar cvzf "$dir.tar.gz" "$dir" 51 | rm -rf "$dir" 52 | ) 53 | 54 | mv deploy/linux/docker/output/"$dir".tar.gz packages/ 55 | 56 | fi 57 | 58 | echo "Done" 59 | 60 | -------------------------------------------------------------------------------- /deploy/linux/build-and-test-appimage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Docker required 4 | 5 | set -eu 6 | 7 | case $(git status --porcelain --untracked-files=no) in 8 | "") ;; 9 | *) echo "ERROR: Current working copy has been modified - unmodified copy required so we know we can check it out separately and obtain the same contents"; exit 2;; 10 | esac 11 | 12 | current=$(git rev-parse --short HEAD) 13 | 14 | echo 15 | echo "Building appimage from revision $current..." 16 | 17 | dockerdir=deploy/linux/docker 18 | 19 | cat "$dockerdir"/Dockerfile_appimage.in | \ 20 | perl -p -e "s/\[\[REVISION\]\]/$current/g" > \ 21 | "$dockerdir"/Dockerfile_appimage.gen 22 | 23 | cat "$dockerdir"/Dockerfile_test_appimage.in | \ 24 | perl -p -e "s/\[\[REVISION\]\]/$current/g" > \ 25 | "$dockerdir"/Dockerfile_test_appimage.gen 26 | 27 | fgrep 'hg.sr.ht' ~/.ssh/known_hosts > "$dockerdir"/known_hosts 28 | cp ~/.ssh/id_rsa_build "$dockerdir"/id_rsa_build 29 | chmod 600 "$dockerdir"/known_hosts "$dockerdir"/id_rsa_build 30 | trap "rm $dockerdir/known_hosts $dockerdir/id_rsa_build" 0 31 | 32 | dockertag="cannam/sonic-annotator-appimage-$current" 33 | 34 | sudo docker build -t "$dockertag" -f "$dockerdir"/Dockerfile_appimage.gen "$dockerdir" 35 | 36 | outdir="$dockerdir/output" 37 | mkdir -p "$outdir" 38 | 39 | container=$(sudo docker create "$dockertag") 40 | 41 | sudo docker cp "$container":/tmp/output-appimage.tar "$outdir" 42 | sudo docker rm "$container" 43 | 44 | ( cd "$outdir" ; tar xf output-appimage.tar && rm -f output-appimage.tar ) 45 | 46 | sudo docker build -f "$dockerdir"/Dockerfile_test_appimage.gen "$dockerdir" 47 | -------------------------------------------------------------------------------- /tests/test-lab-writer/expected/grid-oss-2.lab: -------------------------------------------------------------------------------- 1 | 0.000000000 0.067 0.1 0.13 0.17 0.2 0.23 0.27 0.3 0.33 0.37 "1 of 20 at 0" 2 | 0.023219955 0.1 0.13 0.17 0.2 0.23 0.27 0.3 0.33 0.37 0.4 "2 of 20 at 0.023" 3 | 0.046439909 0.13 0.17 0.2 0.23 0.27 0.3 0.33 0.37 0.4 0.43 "3 of 20 at 0.046" 4 | 0.069659864 0.17 0.2 0.23 0.27 0.3 0.33 0.37 0.4 0.43 0.47 "4 of 20 at 0.069" 5 | 0.092879819 0.2 0.23 0.27 0.3 0.33 0.37 0.4 0.43 0.47 0.5 "5 of 20 at 0.092" 6 | 0.116099773 0.23 0.27 0.3 0.33 0.37 0.4 0.43 0.47 0.5 0.53 "6 of 20 at 0.116" 7 | 0.139319728 0.27 0.3 0.33 0.37 0.4 0.43 0.47 0.5 0.53 0.57 "7 of 20 at 0.139" 8 | 0.162539683 0.3 0.33 0.37 0.4 0.43 0.47 0.5 0.53 0.57 0.6 "8 of 20 at 0.162" 9 | 0.185759637 0.33 0.37 0.4 0.43 0.47 0.5 0.53 0.57 0.6 0.63 "9 of 20 at 0.185" 10 | 0.208979592 0.37 0.4 0.43 0.47 0.5 0.53 0.57 0.6 0.63 0.67 "10 of 20 at 0.208" 11 | 0.232199546 0.4 0.43 0.47 0.5 0.53 0.57 0.6 0.63 0.67 0.7 "11 of 20 at 0.232" 12 | 0.255419501 0.43 0.47 0.5 0.53 0.57 0.6 0.63 0.67 0.7 0.73 "12 of 20 at 0.255" 13 | 0.278639456 0.47 0.5 0.53 0.57 0.6 0.63 0.67 0.7 0.73 0.77 "13 of 20 at 0.278" 14 | 0.301859410 0.5 0.53 0.57 0.6 0.63 0.67 0.7 0.73 0.77 0.8 "14 of 20 at 0.301" 15 | 0.325079365 0.53 0.57 0.6 0.63 0.67 0.7 0.73 0.77 0.8 0.83 "15 of 20 at 0.325" 16 | 0.348299320 0.57 0.6 0.63 0.67 0.7 0.73 0.77 0.8 0.83 0.87 "16 of 20 at 0.348" 17 | 0.371519274 0.6 0.63 0.67 0.7 0.73 0.77 0.8 0.83 0.87 0.9 "17 of 20 at 0.371" 18 | 0.394739229 0.63 0.67 0.7 0.73 0.77 0.8 0.83 0.87 0.9 0.93 "18 of 20 at 0.394" 19 | 0.417959184 0.67 0.7 0.73 0.77 0.8 0.83 0.87 0.9 0.93 0.97 "19 of 20 at 0.417" 20 | 0.441179138 0.7 0.73 0.77 0.8 0.83 0.87 0.9 0.93 0.97 1 "20 of 20 at 0.441" 21 | -------------------------------------------------------------------------------- /tests/test-multiple-audio/transforms/detectionfunction.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:percussiononsets ; 8 | vamp:output examples:percussiononsets_output_detectionfunction ; 9 | vamp:summary_type "mean" . 10 | 11 | :transform1 a vamp:Transform; 12 | vamp:plugin examples:percussiononsets ; 13 | vamp:output examples:percussiononsets_output_detectionfunction ; 14 | vamp:summary_type "median" . 15 | 16 | # This is not a summary and so should not appear with --summary-only 17 | :transform2 a vamp:Transform; 18 | vamp:plugin examples:percussiononsets ; 19 | vamp:output examples:percussiononsets_output_onsets . 20 | 21 | :transform3 a vamp:Transform; 22 | vamp:plugin examples:percussiononsets ; 23 | vamp:output examples:percussiononsets_output_detectionfunction ; 24 | vamp:summary_type "mode" . 25 | 26 | # This has different step and block sizes from the default 27 | # (:transform0), and so should be listed separately with different 28 | # values in the output 29 | :transform4 a vamp:Transform; 30 | vamp:plugin examples:percussiononsets ; 31 | vamp:output examples:percussiononsets_output_detectionfunction ; 32 | vamp:step_size 4096 ; 33 | vamp:block_size 8192 ; 34 | vamp:summary_type "mean" . 35 | 36 | # This is not a summary and so should not appear with --summary-only 37 | :transform5 a vamp:Transform; 38 | vamp:plugin examples:percussiononsets ; 39 | vamp:output examples:percussiononsets_output_detectionfunction . 40 | 41 | 42 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/grid-oss-2.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav",0.000000000,0.067,0.1,0.13,0.17,0.2,0.23,0.27,0.3,0.33,0.37,"1 of 20 at 0" 2 | ,0.023219955,0.1,0.13,0.17,0.2,0.23,0.27,0.3,0.33,0.37,0.4,"2 of 20 at 0.023" 3 | ,0.046439909,0.13,0.17,0.2,0.23,0.27,0.3,0.33,0.37,0.4,0.43,"3 of 20 at 0.046" 4 | ,0.069659864,0.17,0.2,0.23,0.27,0.3,0.33,0.37,0.4,0.43,0.47,"4 of 20 at 0.069" 5 | ,0.092879819,0.2,0.23,0.27,0.3,0.33,0.37,0.4,0.43,0.47,0.5,"5 of 20 at 0.092" 6 | ,0.116099773,0.23,0.27,0.3,0.33,0.37,0.4,0.43,0.47,0.5,0.53,"6 of 20 at 0.116" 7 | ,0.139319728,0.27,0.3,0.33,0.37,0.4,0.43,0.47,0.5,0.53,0.57,"7 of 20 at 0.139" 8 | ,0.162539683,0.3,0.33,0.37,0.4,0.43,0.47,0.5,0.53,0.57,0.6,"8 of 20 at 0.162" 9 | ,0.185759637,0.33,0.37,0.4,0.43,0.47,0.5,0.53,0.57,0.6,0.63,"9 of 20 at 0.185" 10 | ,0.208979592,0.37,0.4,0.43,0.47,0.5,0.53,0.57,0.6,0.63,0.67,"10 of 20 at 0.208" 11 | ,0.232199546,0.4,0.43,0.47,0.5,0.53,0.57,0.6,0.63,0.67,0.7,"11 of 20 at 0.232" 12 | ,0.255419501,0.43,0.47,0.5,0.53,0.57,0.6,0.63,0.67,0.7,0.73,"12 of 20 at 0.255" 13 | ,0.278639456,0.47,0.5,0.53,0.57,0.6,0.63,0.67,0.7,0.73,0.77,"13 of 20 at 0.278" 14 | ,0.301859410,0.5,0.53,0.57,0.6,0.63,0.67,0.7,0.73,0.77,0.8,"14 of 20 at 0.301" 15 | ,0.325079365,0.53,0.57,0.6,0.63,0.67,0.7,0.73,0.77,0.8,0.83,"15 of 20 at 0.325" 16 | ,0.348299320,0.57,0.6,0.63,0.67,0.7,0.73,0.77,0.8,0.83,0.87,"16 of 20 at 0.348" 17 | ,0.371519274,0.6,0.63,0.67,0.7,0.73,0.77,0.8,0.83,0.87,0.9,"17 of 20 at 0.371" 18 | ,0.394739229,0.63,0.67,0.7,0.73,0.77,0.8,0.83,0.87,0.9,0.93,"18 of 20 at 0.394" 19 | ,0.417959184,0.67,0.7,0.73,0.77,0.8,0.83,0.87,0.9,0.93,0.97,"19 of 20 at 0.417" 20 | ,0.441179138,0.7,0.73,0.77,0.8,0.83,0.87,0.9,0.93,0.97,1,"20 of 20 at 0.441" 21 | -------------------------------------------------------------------------------- /deploy/osx/configure.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eu 3 | if [ ! -d deploy/osx ]; then 4 | echo "This must be run from the project root" 5 | exit 1 6 | fi 7 | 8 | qtversion="6.6.3" 9 | qtsuffix="-static" 10 | 11 | for arch in arm64 x86_64 ; do 12 | 13 | echo 14 | echo "For arch: $arch" 15 | echo 16 | 17 | qarch=arm64 18 | if [ "$arch" = "x86_64" ]; then 19 | qarch=amd64 20 | fi 21 | 22 | export QTDIR="$HOME/Qt/$qtversion$qtsuffix" 23 | export PATH=/usr/local/$arch/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$QTDIR/bin:$QTDIR/libexec 24 | 25 | fake_pkgconfig="$(pwd)/deploy/osx/fake-qt-pkg-config" 26 | mkdir -p "$fake_pkgconfig" 27 | 28 | for module in Core Xml Network Test; do 29 | library="Qt6$module" 30 | if [ ! -f "$QTDIR/lib/lib$library.a" ]; then 31 | echo "Library corresponding to module $module not found in $QTDIR/lib/$library.a [sanity check, we don't actually use it]" 32 | exit 1 33 | fi 34 | infile="$(pwd)/deploy/osx/skeleton.pc" 35 | outfile="$fake_pkgconfig/$library.pc" 36 | if [ ! -f "$infile" ]; then 37 | echo "Failed to find input file $infile" 38 | exit 1 39 | fi 40 | cat "$infile" | 41 | sed -e 's|@qtdir@|'"$QTDIR"'|' \ 42 | -e 's|@version@|'"$qtversion"'|' \ 43 | -e 's|@library@|'"$library"'|' \ 44 | -e 's|@module@|'"$module"'|' \ 45 | > "$outfile" 46 | done 47 | 48 | export PKG_CONFIG_PATH="$fake_pkgconfig" 49 | 50 | buildprefix=build 51 | 52 | dir="$buildprefix"_"$arch" 53 | 54 | rm -rf "$dir" 55 | buildtype=release 56 | further_args="" 57 | 58 | meson setup "$dir" -Dstatic_qtdir="$QTDIR" -Dbuildtype="$buildtype" $further_args --cross-file ./deploy/cross/macos-"$arch".txt 59 | 60 | done 61 | -------------------------------------------------------------------------------- /tests/test-multiple-audio/transforms/af.n3: -------------------------------------------------------------------------------- 1 | @prefix rdf: . 2 | @prefix vamp: . 3 | @prefix examples: . 4 | @prefix : <#>. 5 | 6 | :transform0 a vamp:Transform; 7 | vamp:plugin examples:amplitudefollower ; 8 | vamp:output examples:amplitudefollower_output_amplitude ; 9 | vamp:summary_type "mean" . 10 | 11 | :transform1 a vamp:Transform; 12 | vamp:plugin examples:amplitudefollower ; 13 | vamp:output examples:amplitudefollower_output_amplitude ; 14 | vamp:summary_type "median" . 15 | 16 | # This is not a summary and so should not appear with --summary-only 17 | :transform2 a vamp:Transform; 18 | vamp:plugin examples:percussiononsets ; 19 | vamp:output examples:percussiononsets_output_onsets . 20 | 21 | # Skipping this one. Mode is currently problematic as it uses bitwise 22 | # float comparison 23 | #:transform3 a vamp:Transform; 24 | # vamp:plugin examples:amplitudefollower ; 25 | # vamp:output examples:amplitudefollower_output_amplitude ; 26 | # vamp:summary_type "mode" . 27 | 28 | # This has different step and block sizes from the default 29 | # (:transform0), and so should be listed separately with different 30 | # values in the output 31 | :transform4 a vamp:Transform; 32 | vamp:plugin examples:amplitudefollower ; 33 | vamp:output examples:amplitudefollower_output_amplitude ; 34 | vamp:step_size 4096 ; 35 | vamp:block_size 8192 ; 36 | vamp:summary_type "mean" . 37 | 38 | # This is not a summary and so should not appear with --summary-only 39 | :transform5 a vamp:Transform; 40 | vamp:plugin examples:amplitudefollower ; 41 | vamp:output examples:amplitudefollower_output_amplitude . 42 | 43 | 44 | -------------------------------------------------------------------------------- /deploy/clean-build-and-package.bat: -------------------------------------------------------------------------------- 1 | @rem Run this from within the top-level dir: deploy\clean-build-and-package 2 | @echo on 3 | 4 | @echo( 5 | @set YN=y 6 | @set /p YN="Proceed to clean, rebuild, package, and sign [Yn] ?" 7 | 8 | @if "%YN%" == "Y" set YN=y 9 | @if "%YN%" neq "y" exit /b 3 10 | 11 | @echo Proceeding 12 | 13 | del /q /s build_win64 14 | 15 | @echo Rebuilding 64-bit 16 | 17 | call .\deploy\win\build-64.bat 18 | if %errorlevel% neq 0 exit /b %errorlevel% 19 | 20 | @echo on 21 | 22 | @echo Signing 23 | 24 | set NAME=Christopher Cannam 25 | 26 | @echo Signing executables and libraries 27 | signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 /a build_win64\*.exe build_win64\*.dll 28 | if %errorlevel% neq 0 exit /b %errorlevel% 29 | 30 | @echo Zipping up 64-bit package 31 | set pkg=sonic-annotator-win64 32 | set dir=%pkg%\%pkg% 33 | mkdir %pkg% 34 | mkdir %dir% 35 | copy CHANGELOG %dir%\CHANGELOG.txt 36 | copy CITATION %dir%\CITATION.txt 37 | copy COPYING %dir%\COPYING.txt 38 | copy README.md %dir%\README.txt 39 | copy build_win64\Qt6Core.dll %dir% 40 | copy build_win64\Qt6Network.dll %dir% 41 | copy build_win64\Qt6Xml.dll %dir% 42 | copy build_win64\Qt6Test.dll %dir% 43 | copy build_win64\libsndfile-1.dll %dir% 44 | copy build_win64\sonic-annotator.exe %dir% 45 | 46 | set runtime="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT" 47 | 48 | copy %runtime%\msvcp140.DLL %dir% 49 | copy %runtime%\vcruntime140.DLL %dir% 50 | copy %runtime%\vcruntime140_1.DLL %dir% 51 | 52 | del %pkg%.zip 53 | powershell -NoProfile -ExecutionPolicy Bypass -Command "& 'deploy\win\zip.ps1' %pkg%.zip %pkg%" 54 | del /q /s %pkg% 55 | 56 | @echo Done 57 | -------------------------------------------------------------------------------- /tests/test-jams-writer/expected/instants.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_metadata": { 3 | "jams_version": "0.2.0", 4 | "identifiers": { "filename": "20sec-silence.wav" }, 5 | "duration": 20.003265306 6 | }, 7 | "annotations": [ 8 | { 9 | "namespace": "unknown", 10 | "annotation_metadata": { 11 | "annotation_tools": "Sonic Annotator v1.3", 12 | "data_source": "Automatic feature extraction", 13 | "annotator": { 14 | "plugin_id": "vamp:vamp-test-plugin:vamp-test-plugin", 15 | "output_id": "instants", 16 | "plugin_version": "5", 17 | "step_size": 1024, 18 | "block_size": 1024, 19 | "sample_rate": 44100, 20 | "parameters": { 21 | "produce_output": 1 22 | }, 23 | "transform_id": "vamp:vamp-test-plugin:vamp-test-plugin:instants" 24 | } 25 | }, 26 | "data": [ 27 | { "time": 0.000000000, "duration": 0.0, "confidence": 1.0, "value": "1 of 10 at 0" }, 28 | { "time": 1.500000000, "duration": 0.0, "confidence": 1.0, "value": "2 of 10 at 1.5" }, 29 | { "time": 3.000000000, "duration": 0.0, "confidence": 1.0, "value": "3 of 10 at 3" }, 30 | { "time": 4.500000000, "duration": 0.0, "confidence": 1.0, "value": "4 of 10 at 4.5" }, 31 | { "time": 6.000000000, "duration": 0.0, "confidence": 1.0, "value": "5 of 10 at 6" }, 32 | { "time": 7.500000000, "duration": 0.0, "confidence": 1.0, "value": "6 of 10 at 7.5" }, 33 | { "time": 9.000000000, "duration": 0.0, "confidence": 1.0, "value": "7 of 10 at 9" }, 34 | { "time": 10.500000000, "duration": 0.0, "confidence": 1.0, "value": "8 of 10 at 10.5" }, 35 | { "time": 12.000000000, "duration": 0.0, "confidence": 1.0, "value": "9 of 10 at 12" }, 36 | { "time": 13.500000000, "duration": 0.0, "confidence": 1.0, "value": "10 of 10 at 13.5" } 37 | ] 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /runner/MultiplexedReader.h: -------------------------------------------------------------------------------- 1 | /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 2 | 3 | /* 4 | Sonic Annotator 5 | A utility for batch feature extraction from audio files. 6 | Mark Levy, Chris Sutton and Chris Cannam, Queen Mary, University of London. 7 | Copyright 2007-2014 QMUL. 8 | 9 | This program is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. See the file 13 | COPYING included with this distribution for more information. 14 | */ 15 | 16 | #ifndef MULTIPLEXED_READER_H 17 | #define MULTIPLEXED_READER_H 18 | 19 | #include "data/fileio/AudioFileReader.h" 20 | 21 | #include 22 | #include 23 | 24 | namespace sv { 25 | 26 | class MultiplexedReader : public AudioFileReader 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | // I take ownership of readers 32 | MultiplexedReader(QList readers); 33 | virtual ~MultiplexedReader(); 34 | 35 | virtual QString getError() const override { return m_error; } 36 | virtual bool isQuicklySeekable() const override { return m_quicklySeekable; } 37 | 38 | virtual QString getTitle() const override { return ""; } 39 | virtual QString getMaker() const override { return ""; } 40 | 41 | virtual QString getLocation() const override { return ""; } 42 | virtual QString getLocalFilename() const override { return ""; } 43 | 44 | virtual floatvec_t getInterleavedFrames 45 | (sv_frame_t start, sv_frame_t count) const override; 46 | 47 | virtual int getDecodeCompletion() const override; 48 | 49 | virtual bool isUpdating() const override; 50 | 51 | protected: 52 | QString m_error; 53 | bool m_quicklySeekable; 54 | QList m_readers; 55 | }; 56 | 57 | } 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /tests/test-jams-writer/expected/curve-fsr.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_metadata": { 3 | "jams_version": "0.2.0", 4 | "identifiers": { "filename": "20sec-silence.wav" }, 5 | "duration": 20.003265306 6 | }, 7 | "annotations": [ 8 | { 9 | "namespace": "unknown", 10 | "annotation_metadata": { 11 | "annotation_tools": "Sonic Annotator v1.3", 12 | "data_source": "Automatic feature extraction", 13 | "annotator": { 14 | "plugin_id": "vamp:vamp-test-plugin:vamp-test-plugin", 15 | "output_id": "curve-fsr", 16 | "plugin_version": "5", 17 | "step_size": 1024, 18 | "block_size": 1024, 19 | "sample_rate": 44100, 20 | "parameters": { 21 | "produce_output": 1 22 | }, 23 | "transform_id": "vamp:vamp-test-plugin:vamp-test-plugin:curve-fsr" 24 | } 25 | }, 26 | "data": [ 27 | { "time": 0.000000000, "duration": 0.0, "confidence": 1.0, "label": "1 of 10: 0 at 0", "value": 0 }, 28 | { "time": 0.400000000, "duration": 0.0, "confidence": 1.0, "label": "2 of 10: 0.1 at 0.4", "value": 0.1 }, 29 | { "time": 0.800000000, "duration": 0.0, "confidence": 1.0, "label": "3 of 10: 0.2 at 0.8", "value": 0.2 }, 30 | { "time": 1.200000000, "duration": 0.0, "confidence": 1.0, "label": "4 of 10: 0.3 at 1.2", "value": 0.3 }, 31 | { "time": 1.600000000, "duration": 0.0, "confidence": 1.0, "label": "5 of 10: 0.4 at 1.6", "value": 0.4 }, 32 | { "time": 2.000000000, "duration": 0.0, "confidence": 1.0, "label": "6 of 10: 0.5 at 2", "value": 0.5 }, 33 | { "time": 2.400000000, "duration": 0.0, "confidence": 1.0, "label": "7 of 10: 0.6 at 2.4", "value": 0.6 }, 34 | { "time": 2.800000000, "duration": 0.0, "confidence": 1.0, "label": "8 of 10: 0.7 at 2.8", "value": 0.7 }, 35 | { "time": 3.200000000, "duration": 0.0, "confidence": 1.0, "label": "9 of 10: 0.8 at 3.2", "value": 0.8 }, 36 | { "time": 3.600000000, "duration": 0.0, "confidence": 1.0, "label": "10 of 10: 0.9 at 3.6", "value": 0.9 } 37 | ] 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /repoint-project.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "extdir": "." 4 | }, 5 | "libraries": { 6 | "vamp-plugin-sdk": { 7 | "vcs": "git", 8 | "service": "github", 9 | "owner": "vamp-plugins" 10 | }, 11 | "svcore": { 12 | "vcs": "git", 13 | "service": "github", 14 | "owner": "sonic-visualiser", 15 | "branch": "default" 16 | }, 17 | "checker": { 18 | "vcs": "git", 19 | "service": "github", 20 | "owner": "sonic-visualiser", 21 | "repository": "vamp-plugin-load-checker", 22 | "branch": "default" 23 | }, 24 | "sv-dependency-builds": { 25 | "vcs": "git", 26 | "service": "github", 27 | "owner": "sonic-visualiser", 28 | "branch": "default" 29 | }, 30 | "piper-vamp-cpp": { 31 | "vcs": "git", 32 | "service": "github", 33 | "owner": "piper-audio" 34 | }, 35 | "dataquay": { 36 | "vcs": "hg", 37 | "service": "sourcehut", 38 | "owner": "breakfastquay" 39 | }, 40 | "bqvec": { 41 | "vcs": "hg", 42 | "service": "sourcehut", 43 | "owner": "breakfastquay" 44 | }, 45 | "bqfft": { 46 | "vcs": "hg", 47 | "service": "sourcehut", 48 | "owner": "breakfastquay" 49 | }, 50 | "bqresample": { 51 | "vcs": "hg", 52 | "service": "sourcehut", 53 | "owner": "breakfastquay" 54 | }, 55 | "bqaudiostream": { 56 | "vcs": "hg", 57 | "service": "sourcehut", 58 | "owner": "breakfastquay" 59 | }, 60 | "bqthingfactory": { 61 | "vcs": "hg", 62 | "service": "sourcehut", 63 | "owner": "breakfastquay" 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /tests/test-helpfulflags/test-helpfulflags.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . ../include.sh 4 | 5 | [ -f $r ] || \ 6 | fail "Executable not found at $r" 7 | 8 | [ -x $r ] || \ 9 | fail "Executable not executable at $r" 10 | 11 | $r >/dev/null 2>&1 && \ 12 | fail "Return code 0 when run without args (should be a failure code)" 13 | 14 | $r 2>&1 >/dev/null | grep -q "for help" || \ 15 | fail "Improper response when run without args" 16 | 17 | $r --help 2>&1 | grep -q Copy || \ 18 | fail "Expected help not printed when run with --help" 19 | 20 | $r --list >/dev/null 2>&1 || \ 21 | fail "Fails to run with --list" 22 | 23 | $r --list 2>/dev/null | grep -q $percplug || \ 24 | fail "Fails to print $percplug in plugin list (if you haven't got it, install it -- it's needed for other tests)" 25 | 26 | $r --list 2>/dev/null | grep -q $testplug || \ 27 | fail "Fails to print $testplug in plugin list (if you haven't got it, install it -- it's needed for other tests)" 28 | 29 | $r --skeleton $percplug >/dev/null || \ 30 | fail "Fails to run with --skeleton $percplug" 31 | 32 | $r -s $percplug >/dev/null || \ 33 | fail "Fails to run with -s $percplug" 34 | 35 | $r --skeleton $percplug >/dev/null || \ 36 | fail "Fails to run with --skeleton $percplug" 37 | 38 | $r --skeleton $percplug | rapper -i turtle - test >/dev/null 2>&1 || \ 39 | fail "Invalid XML skeleton produced with --skeleton $percplug" 40 | 41 | $r --minversion $version || \ 42 | fail "Returned failure code when run with --minversion $version" 43 | 44 | $r --minversion $nextversion 2>/dev/null && \ 45 | fail "Returned success code when run with --minversion $nextversion" 46 | 47 | $r --minversion 63.9 2>/dev/null && \ 48 | fail "Returned success code when run with --minversion 63.9" 49 | 50 | $r --transform-minversion $percplug 1 || \ 51 | fail "Returned failure code when run with --transform-minversion $percplug 1" 52 | 53 | $r --transform-minversion $percplug 50 2>/dev/null && \ 54 | fail "Returned success code when run with --transform-minversion $percplug 50" 55 | 56 | exit 0 57 | -------------------------------------------------------------------------------- /deploy/linux/docker/Dockerfile_appimage.in: -------------------------------------------------------------------------------- 1 | # Note 22.04 was the first LTS with Qt6 2 | FROM ubuntu:22.04 3 | RUN apt-get update && \ 4 | apt-get install -y \ 5 | software-properties-common \ 6 | build-essential \ 7 | libbz2-dev \ 8 | libfftw3-dev \ 9 | libfishsound1-dev \ 10 | libid3tag0-dev \ 11 | liblo-dev \ 12 | liblrdf0-dev \ 13 | libmad0-dev \ 14 | liboggz2-dev \ 15 | libopus-dev \ 16 | libopusfile-dev \ 17 | libpulse-dev \ 18 | libasound2-dev \ 19 | libjack-dev \ 20 | libsamplerate-dev \ 21 | libsndfile-dev \ 22 | libsord-dev \ 23 | libxml2-utils \ 24 | qt6-base-dev \ 25 | qt6-pdf-dev \ 26 | qt6-base-dev-tools \ 27 | libqt6svg6-dev \ 28 | libgl1-mesa-dev \ 29 | raptor2-utils \ 30 | librubberband-dev \ 31 | yajl-tools \ 32 | git \ 33 | mercurial \ 34 | curl wget \ 35 | unzip \ 36 | smlnj \ 37 | autoconf \ 38 | automake \ 39 | libtool \ 40 | lintian \ 41 | ninja-build \ 42 | libglib2.0-dev \ 43 | python3-pip 44 | 45 | RUN apt-get clean && rm -rf /var/lib/apt/lists/* 46 | 47 | RUN git config --global http.postBuffer 4M 48 | 49 | WORKDIR /root 50 | RUN pip3 install meson 51 | 52 | COPY id_rsa_build .ssh/id_rsa_build 53 | COPY known_hosts .ssh/known_hosts 54 | RUN chmod 600 .ssh/id_rsa_build .ssh/known_hosts 55 | RUN echo '{"accounts": {"sourcehut": "~breakfastquay"}}' > .repoint.json 56 | RUN ( echo '[ui]' ; echo 'ssh = ssh -i /root/.ssh/id_rsa_build' ) > .hgrc 57 | 58 | # The explicit revision number here is to make sure the following git 59 | # clone is not cached from a different revision 60 | RUN echo Cloning revision [[REVISION]] 61 | 62 | RUN git clone https://github.com/sonic-visualiser/sonic-annotator 63 | WORKDIR sonic-annotator 64 | RUN git checkout [[REVISION]] 65 | 66 | RUN ./repoint install 67 | RUN meson setup build --buildtype release 68 | RUN ninja -C build 69 | 70 | RUN deploy/linux/deploy-appimage.sh 71 | RUN cp build/sonic-annotator . 72 | RUN tar cvf output-appimage.tar sonic-annotator *.AppImage && cp output-appimage.tar /tmp/ 73 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/grid-oss-sample-timing.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav",0,0.0666667,0.1,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,"1 of 20 at 0" 2 | ,1024,0.1,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,"2 of 20 at 0.023" 3 | ,2048,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,"3 of 20 at 0.046" 4 | ,3072,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,"4 of 20 at 0.069" 5 | ,4096,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,"5 of 20 at 0.092" 6 | ,5120,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,"6 of 20 at 0.116" 7 | ,6144,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,"7 of 20 at 0.139" 8 | ,7168,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,"8 of 20 at 0.162" 9 | ,8192,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,"9 of 20 at 0.185" 10 | ,9216,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,"10 of 20 at 0.208" 11 | ,10240,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,"11 of 20 at 0.232" 12 | ,11264,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,"12 of 20 at 0.255" 13 | ,12288,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,"13 of 20 at 0.278" 14 | ,13312,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,"14 of 20 at 0.301" 15 | ,14336,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,"15 of 20 at 0.325" 16 | ,15360,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,"16 of 20 at 0.348" 17 | ,16384,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,"17 of 20 at 0.371" 18 | ,17408,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,"18 of 20 at 0.394" 19 | ,18432,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,0.966667,"19 of 20 at 0.417" 20 | ,19456,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,0.966667,1,"20 of 20 at 0.441" 21 | -------------------------------------------------------------------------------- /runner/FeatureWriterFactory.cpp: -------------------------------------------------------------------------------- 1 | /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 2 | 3 | /* 4 | Sonic Annotator 5 | A utility for batch feature extraction from audio files. 6 | Mark Levy, Chris Sutton and Chris Cannam, Queen Mary, University of London. 7 | Copyright 2007-2008 QMUL. 8 | 9 | This program is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. See the file 13 | COPYING included with this distribution for more information. 14 | */ 15 | 16 | 17 | #include "FeatureWriterFactory.h" 18 | 19 | #include "DefaultFeatureWriter.h" 20 | 21 | #include "rdf/RDFFeatureWriter.h" 22 | #include "transform/CSVFeatureWriter.h" 23 | 24 | #include "AudioDBFeatureWriter.h" 25 | #include "MIDIFeatureWriter.h" 26 | #include "JAMSFeatureWriter.h" 27 | #include "LabFeatureWriter.h" 28 | 29 | using namespace std; 30 | 31 | namespace sv { 32 | 33 | set 34 | FeatureWriterFactory::getWriterTags() 35 | { 36 | set tags; 37 | tags.insert("default"); 38 | tags.insert("rdf"); 39 | tags.insert("audiodb"); 40 | tags.insert("csv"); 41 | tags.insert("lab"); 42 | tags.insert("midi"); 43 | tags.insert("jams"); 44 | return tags; 45 | } 46 | 47 | FeatureWriter * 48 | FeatureWriterFactory::createWriter(string tag) 49 | { 50 | if (tag == "default") { 51 | return new DefaultFeatureWriter(); 52 | } else if (tag == "rdf") { 53 | return new RDFFeatureWriter(); 54 | } else if (tag == "audiodb") { 55 | return new AudioDBFeatureWriter(); 56 | } else if (tag == "csv") { 57 | return new CSVFeatureWriter(); 58 | } else if (tag == "lab") { 59 | return new LabFeatureWriter(); 60 | } else if (tag == "midi") { 61 | return new MIDIFeatureWriter(); 62 | } else if (tag == "jams") { 63 | return new JAMSFeatureWriter(); 64 | } 65 | 66 | return 0; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /tests/test-summaries/expected/summaries-all-files.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav",0.000000000,20.062040815,mean,61.1636,"(mean value, continuous-time average)" 2 | ,0.000000000,20.062040815,median,0,"(median value, continuous-time average)" 3 | ,0.000000000,20.062040815,mode,0,"(modal value, continuous-time average)" 4 | ,0.000000000,20.062040815,mean,893.139,"(mean value, continuous-time average)" 5 | "./../audio/3clicks.mp3",0.000000000,5.201269840,mean,164.674,"(mean value, continuous-time average)" 6 | ,0.000000000,5.201269840,median,169,"(median value, continuous-time average)" 7 | ,0.000000000,5.201269840,mode,0,"(modal value, continuous-time average)" 8 | ,0.000000000,5.201269840,mean,680.411,"(mean value, continuous-time average)" 9 | "./../audio/3clicks.ogg",0.000000000,5.201269840,mean,162.694,"(mean value, continuous-time average)" 10 | ,0.000000000,5.201269840,median,169,"(median value, continuous-time average)" 11 | ,0.000000000,5.201269840,mode,174,"(modal value, continuous-time average)" 12 | ,0.000000000,5.201269840,mean,697.732,"(mean value, continuous-time average)" 13 | "./../audio/3clicks8.wav",0.000000000,5.201269840,mean,162.585,"(mean value, continuous-time average)" 14 | ,0.000000000,5.201269840,median,168,"(median value, continuous-time average)" 15 | ,0.000000000,5.201269840,mode,0,"(modal value, continuous-time average)" 16 | ,0.000000000,5.201269840,mean,677.241,"(mean value, continuous-time average)" 17 | "./../audio/6clicks.ogg",0.000000000,10.031020407,mean,166.612,"(mean value, continuous-time average)" 18 | ,0.000000000,10.031020407,median,167,"(median value, continuous-time average)" 19 | ,0.000000000,10.031020407,mode,170,"(modal value, continuous-time average)" 20 | ,0.000000000,10.031020407,mean,713.148,"(mean value, continuous-time average)" 21 | "./../audio/6clicks8.wav",0.000000000,10.031020407,mean,169.079,"(mean value, continuous-time average)" 22 | ,0.000000000,10.031020407,median,169,"(median value, continuous-time average)" 23 | ,0.000000000,10.031020407,mode,164,"(modal value, continuous-time average)" 24 | ,0.000000000,10.031020407,mean,695.759,"(mean value, continuous-time average)" 25 | -------------------------------------------------------------------------------- /tests/test-jams-writer/expected/notes-regions.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_metadata": { 3 | "jams_version": "0.2.0", 4 | "identifiers": { "filename": "20sec-silence.wav" }, 5 | "duration": 20.003265306 6 | }, 7 | "annotations": [ 8 | { 9 | "namespace": "unknown", 10 | "annotation_metadata": { 11 | "annotation_tools": "Sonic Annotator v1.3", 12 | "data_source": "Automatic feature extraction", 13 | "annotator": { 14 | "plugin_id": "vamp:vamp-test-plugin:vamp-test-plugin", 15 | "output_id": "notes-regions", 16 | "plugin_version": "5", 17 | "step_size": 1024, 18 | "block_size": 1024, 19 | "sample_rate": 44100, 20 | "parameters": { 21 | "produce_output": 1 22 | }, 23 | "transform_id": "vamp:vamp-test-plugin:vamp-test-plugin:notes-regions" 24 | } 25 | }, 26 | "data": [ 27 | { "time": 0.000000000, "duration": 1.750000000, "confidence": 1.0, "label": "1 of 10: 0 at 0 dur. 1.75", "value": 0 }, 28 | { "time": 1.000000000, "duration": 0.500000000, "confidence": 1.0, "label": "2 of 10: 0.1 at 1 dur. 0.5", "value": 0.1 }, 29 | { "time": 2.000000000, "duration": 1.750000000, "confidence": 1.0, "label": "3 of 10: 0.2 at 2 dur. 1.75", "value": 0.2 }, 30 | { "time": 3.000000000, "duration": 0.500000000, "confidence": 1.0, "label": "4 of 10: 0.3 at 3 dur. 0.5", "value": 0.3 }, 31 | { "time": 4.000000000, "duration": 1.750000000, "confidence": 1.0, "label": "5 of 10: 0.4 at 4 dur. 1.75", "value": 0.4 }, 32 | { "time": 5.000000000, "duration": 0.500000000, "confidence": 1.0, "label": "6 of 10: 0.5 at 5 dur. 0.5", "value": 0.5 }, 33 | { "time": 6.000000000, "duration": 1.750000000, "confidence": 1.0, "label": "7 of 10: 0.6 at 6 dur. 1.75", "value": 0.6 }, 34 | { "time": 7.000000000, "duration": 0.500000000, "confidence": 1.0, "label": "8 of 10: 0.7 at 7 dur. 0.5", "value": 0.7 }, 35 | { "time": 8.000000000, "duration": 1.750000000, "confidence": 1.0, "label": "9 of 10: 0.8 at 8 dur. 1.75", "value": 0.8 }, 36 | { "time": 9.000000000, "duration": 0.500000000, "confidence": 1.0, "label": "10 of 10: 0.9 at 9 dur. 0.5", "value": 0.9 } 37 | ] 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /tests/test-lab-writer/expected/grid-oss-0.lab: -------------------------------------------------------------------------------- 1 | 0.000000000 0.0666667 0.1 0.133333 0.166667 0.2 0.233333 0.266667 0.3 0.333333 0.366667 "1 of 20 at 0" 2 | 0.023219955 0.1 0.133333 0.166667 0.2 0.233333 0.266667 0.3 0.333333 0.366667 0.4 "2 of 20 at 0.023" 3 | 0.046439909 0.133333 0.166667 0.2 0.233333 0.266667 0.3 0.333333 0.366667 0.4 0.433333 "3 of 20 at 0.046" 4 | 0.069659864 0.166667 0.2 0.233333 0.266667 0.3 0.333333 0.366667 0.4 0.433333 0.466667 "4 of 20 at 0.069" 5 | 0.092879819 0.2 0.233333 0.266667 0.3 0.333333 0.366667 0.4 0.433333 0.466667 0.5 "5 of 20 at 0.092" 6 | 0.116099773 0.233333 0.266667 0.3 0.333333 0.366667 0.4 0.433333 0.466667 0.5 0.533333 "6 of 20 at 0.116" 7 | 0.139319728 0.266667 0.3 0.333333 0.366667 0.4 0.433333 0.466667 0.5 0.533333 0.566667 "7 of 20 at 0.139" 8 | 0.162539683 0.3 0.333333 0.366667 0.4 0.433333 0.466667 0.5 0.533333 0.566667 0.6 "8 of 20 at 0.162" 9 | 0.185759637 0.333333 0.366667 0.4 0.433333 0.466667 0.5 0.533333 0.566667 0.6 0.633333 "9 of 20 at 0.185" 10 | 0.208979592 0.366667 0.4 0.433333 0.466667 0.5 0.533333 0.566667 0.6 0.633333 0.666667 "10 of 20 at 0.208" 11 | 0.232199546 0.4 0.433333 0.466667 0.5 0.533333 0.566667 0.6 0.633333 0.666667 0.7 "11 of 20 at 0.232" 12 | 0.255419501 0.433333 0.466667 0.5 0.533333 0.566667 0.6 0.633333 0.666667 0.7 0.733333 "12 of 20 at 0.255" 13 | 0.278639456 0.466667 0.5 0.533333 0.566667 0.6 0.633333 0.666667 0.7 0.733333 0.766667 "13 of 20 at 0.278" 14 | 0.301859410 0.5 0.533333 0.566667 0.6 0.633333 0.666667 0.7 0.733333 0.766667 0.8 "14 of 20 at 0.301" 15 | 0.325079365 0.533333 0.566667 0.6 0.633333 0.666667 0.7 0.733333 0.766667 0.8 0.833333 "15 of 20 at 0.325" 16 | 0.348299320 0.566667 0.6 0.633333 0.666667 0.7 0.733333 0.766667 0.8 0.833333 0.866667 "16 of 20 at 0.348" 17 | 0.371519274 0.6 0.633333 0.666667 0.7 0.733333 0.766667 0.8 0.833333 0.866667 0.9 "17 of 20 at 0.371" 18 | 0.394739229 0.633333 0.666667 0.7 0.733333 0.766667 0.8 0.833333 0.866667 0.9 0.933333 "18 of 20 at 0.394" 19 | 0.417959184 0.666667 0.7 0.733333 0.766667 0.8 0.833333 0.866667 0.9 0.933333 0.966667 "19 of 20 at 0.417" 20 | 0.441179138 0.7 0.733333 0.766667 0.8 0.833333 0.866667 0.9 0.933333 0.966667 1 "20 of 20 at 0.441" 21 | -------------------------------------------------------------------------------- /tests/test-lab-writer/expected/grid-oss-6.lab: -------------------------------------------------------------------------------- 1 | 0.000000000 0.0666667 0.1 0.133333 0.166667 0.2 0.233333 0.266667 0.3 0.333333 0.366667 "1 of 20 at 0" 2 | 0.023219955 0.1 0.133333 0.166667 0.2 0.233333 0.266667 0.3 0.333333 0.366667 0.4 "2 of 20 at 0.023" 3 | 0.046439909 0.133333 0.166667 0.2 0.233333 0.266667 0.3 0.333333 0.366667 0.4 0.433333 "3 of 20 at 0.046" 4 | 0.069659864 0.166667 0.2 0.233333 0.266667 0.3 0.333333 0.366667 0.4 0.433333 0.466667 "4 of 20 at 0.069" 5 | 0.092879819 0.2 0.233333 0.266667 0.3 0.333333 0.366667 0.4 0.433333 0.466667 0.5 "5 of 20 at 0.092" 6 | 0.116099773 0.233333 0.266667 0.3 0.333333 0.366667 0.4 0.433333 0.466667 0.5 0.533333 "6 of 20 at 0.116" 7 | 0.139319728 0.266667 0.3 0.333333 0.366667 0.4 0.433333 0.466667 0.5 0.533333 0.566667 "7 of 20 at 0.139" 8 | 0.162539683 0.3 0.333333 0.366667 0.4 0.433333 0.466667 0.5 0.533333 0.566667 0.6 "8 of 20 at 0.162" 9 | 0.185759637 0.333333 0.366667 0.4 0.433333 0.466667 0.5 0.533333 0.566667 0.6 0.633333 "9 of 20 at 0.185" 10 | 0.208979592 0.366667 0.4 0.433333 0.466667 0.5 0.533333 0.566667 0.6 0.633333 0.666667 "10 of 20 at 0.208" 11 | 0.232199546 0.4 0.433333 0.466667 0.5 0.533333 0.566667 0.6 0.633333 0.666667 0.7 "11 of 20 at 0.232" 12 | 0.255419501 0.433333 0.466667 0.5 0.533333 0.566667 0.6 0.633333 0.666667 0.7 0.733333 "12 of 20 at 0.255" 13 | 0.278639456 0.466667 0.5 0.533333 0.566667 0.6 0.633333 0.666667 0.7 0.733333 0.766667 "13 of 20 at 0.278" 14 | 0.301859410 0.5 0.533333 0.566667 0.6 0.633333 0.666667 0.7 0.733333 0.766667 0.8 "14 of 20 at 0.301" 15 | 0.325079365 0.533333 0.566667 0.6 0.633333 0.666667 0.7 0.733333 0.766667 0.8 0.833333 "15 of 20 at 0.325" 16 | 0.348299320 0.566667 0.6 0.633333 0.666667 0.7 0.733333 0.766667 0.8 0.833333 0.866667 "16 of 20 at 0.348" 17 | 0.371519274 0.6 0.633333 0.666667 0.7 0.733333 0.766667 0.8 0.833333 0.866667 0.9 "17 of 20 at 0.371" 18 | 0.394739229 0.633333 0.666667 0.7 0.733333 0.766667 0.8 0.833333 0.866667 0.9 0.933333 "18 of 20 at 0.394" 19 | 0.417959184 0.666667 0.7 0.733333 0.766667 0.8 0.833333 0.866667 0.9 0.933333 0.966667 "19 of 20 at 0.417" 20 | 0.441179138 0.7 0.733333 0.766667 0.8 0.833333 0.866667 0.9 0.933333 0.966667 1 "20 of 20 at 0.441" 21 | -------------------------------------------------------------------------------- /tests/test-lab-writer/expected/grid-oss-no-flags.lab: -------------------------------------------------------------------------------- 1 | 0.000000000 0.0666667 0.1 0.133333 0.166667 0.2 0.233333 0.266667 0.3 0.333333 0.366667 "1 of 20 at 0" 2 | 0.023219954 0.1 0.133333 0.166667 0.2 0.233333 0.266667 0.3 0.333333 0.366667 0.4 "2 of 20 at 0.023" 3 | 0.046439909 0.133333 0.166667 0.2 0.233333 0.266667 0.3 0.333333 0.366667 0.4 0.433333 "3 of 20 at 0.046" 4 | 0.069659863 0.166667 0.2 0.233333 0.266667 0.3 0.333333 0.366667 0.4 0.433333 0.466667 "4 of 20 at 0.069" 5 | 0.092879818 0.2 0.233333 0.266667 0.3 0.333333 0.366667 0.4 0.433333 0.466667 0.5 "5 of 20 at 0.092" 6 | 0.116099773 0.233333 0.266667 0.3 0.333333 0.366667 0.4 0.433333 0.466667 0.5 0.533333 "6 of 20 at 0.116" 7 | 0.139319727 0.266667 0.3 0.333333 0.366667 0.4 0.433333 0.466667 0.5 0.533333 0.566667 "7 of 20 at 0.139" 8 | 0.162539682 0.3 0.333333 0.366667 0.4 0.433333 0.466667 0.5 0.533333 0.566667 0.6 "8 of 20 at 0.162" 9 | 0.185759637 0.333333 0.366667 0.4 0.433333 0.466667 0.5 0.533333 0.566667 0.6 0.633333 "9 of 20 at 0.185" 10 | 0.208979591 0.366667 0.4 0.433333 0.466667 0.5 0.533333 0.566667 0.6 0.633333 0.666667 "10 of 20 at 0.208" 11 | 0.232199546 0.4 0.433333 0.466667 0.5 0.533333 0.566667 0.6 0.633333 0.666667 0.7 "11 of 20 at 0.232" 12 | 0.255419501 0.433333 0.466667 0.5 0.533333 0.566667 0.6 0.633333 0.666667 0.7 0.733333 "12 of 20 at 0.255" 13 | 0.278639455 0.466667 0.5 0.533333 0.566667 0.6 0.633333 0.666667 0.7 0.733333 0.766667 "13 of 20 at 0.278" 14 | 0.301859410 0.5 0.533333 0.566667 0.6 0.633333 0.666667 0.7 0.733333 0.766667 0.8 "14 of 20 at 0.301" 15 | 0.325079365 0.533333 0.566667 0.6 0.633333 0.666667 0.7 0.733333 0.766667 0.8 0.833333 "15 of 20 at 0.325" 16 | 0.348299319 0.566667 0.6 0.633333 0.666667 0.7 0.733333 0.766667 0.8 0.833333 0.866667 "16 of 20 at 0.348" 17 | 0.371519274 0.6 0.633333 0.666667 0.7 0.733333 0.766667 0.8 0.833333 0.866667 0.9 "17 of 20 at 0.371" 18 | 0.394739229 0.633333 0.666667 0.7 0.733333 0.766667 0.8 0.833333 0.866667 0.9 0.933333 "18 of 20 at 0.394" 19 | 0.417959183 0.666667 0.7 0.733333 0.766667 0.8 0.833333 0.866667 0.9 0.933333 0.966667 "19 of 20 at 0.417" 20 | 0.441179138 0.7 0.733333 0.766667 0.8 0.833333 0.866667 0.9 0.933333 0.966667 1 "20 of 20 at 0.441" 21 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/grid-oss-all.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav"@0@1024@0.0666667@0.1@0.133333@0.166667@0.2@0.233333@0.266667@0.3@0.333333@0.366667@"1 of 20 at 0" 2 | @1024@2048@0.1@0.133333@0.166667@0.2@0.233333@0.266667@0.3@0.333333@0.366667@0.4@"2 of 20 at 0.023" 3 | @2048@3072@0.133333@0.166667@0.2@0.233333@0.266667@0.3@0.333333@0.366667@0.4@0.433333@"3 of 20 at 0.046" 4 | @3072@4096@0.166667@0.2@0.233333@0.266667@0.3@0.333333@0.366667@0.4@0.433333@0.466667@"4 of 20 at 0.069" 5 | @4096@5120@0.2@0.233333@0.266667@0.3@0.333333@0.366667@0.4@0.433333@0.466667@0.5@"5 of 20 at 0.092" 6 | @5120@6144@0.233333@0.266667@0.3@0.333333@0.366667@0.4@0.433333@0.466667@0.5@0.533333@"6 of 20 at 0.116" 7 | @6144@7168@0.266667@0.3@0.333333@0.366667@0.4@0.433333@0.466667@0.5@0.533333@0.566667@"7 of 20 at 0.139" 8 | @7168@8192@0.3@0.333333@0.366667@0.4@0.433333@0.466667@0.5@0.533333@0.566667@0.6@"8 of 20 at 0.162" 9 | @8192@9216@0.333333@0.366667@0.4@0.433333@0.466667@0.5@0.533333@0.566667@0.6@0.633333@"9 of 20 at 0.185" 10 | @9216@10240@0.366667@0.4@0.433333@0.466667@0.5@0.533333@0.566667@0.6@0.633333@0.666667@"10 of 20 at 0.208" 11 | @10240@11264@0.4@0.433333@0.466667@0.5@0.533333@0.566667@0.6@0.633333@0.666667@0.7@"11 of 20 at 0.232" 12 | @11264@12288@0.433333@0.466667@0.5@0.533333@0.566667@0.6@0.633333@0.666667@0.7@0.733333@"12 of 20 at 0.255" 13 | @12288@13312@0.466667@0.5@0.533333@0.566667@0.6@0.633333@0.666667@0.7@0.733333@0.766667@"13 of 20 at 0.278" 14 | @13312@14336@0.5@0.533333@0.566667@0.6@0.633333@0.666667@0.7@0.733333@0.766667@0.8@"14 of 20 at 0.301" 15 | @14336@15360@0.533333@0.566667@0.6@0.633333@0.666667@0.7@0.733333@0.766667@0.8@0.833333@"15 of 20 at 0.325" 16 | @15360@16384@0.566667@0.6@0.633333@0.666667@0.7@0.733333@0.766667@0.8@0.833333@0.866667@"16 of 20 at 0.348" 17 | @16384@17408@0.6@0.633333@0.666667@0.7@0.733333@0.766667@0.8@0.833333@0.866667@0.9@"17 of 20 at 0.371" 18 | @17408@18432@0.633333@0.666667@0.7@0.733333@0.766667@0.8@0.833333@0.866667@0.9@0.933333@"18 of 20 at 0.394" 19 | @18432@19456@0.666667@0.7@0.733333@0.766667@0.8@0.833333@0.866667@0.9@0.933333@0.966667@"19 of 20 at 0.417" 20 | @19456@19456@0.7@0.733333@0.766667@0.8@0.833333@0.866667@0.9@0.933333@0.966667@1@"20 of 20 at 0.441" 21 | -------------------------------------------------------------------------------- /tests/test-vamp-test-plugin/expected/vamp-test-plugin-grid-oss.csv: -------------------------------------------------------------------------------- 1 | ,0.000000000,0.0666667,0.1,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,"1 of 20 at 0" 2 | ,0.023219954,0.1,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,"2 of 20 at 0.023" 3 | ,0.046439909,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,"3 of 20 at 0.046" 4 | ,0.069659863,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,"4 of 20 at 0.069" 5 | ,0.092879818,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,"5 of 20 at 0.092" 6 | ,0.116099773,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,"6 of 20 at 0.116" 7 | ,0.139319727,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,"7 of 20 at 0.139" 8 | ,0.162539682,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,"8 of 20 at 0.162" 9 | ,0.185759637,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,"9 of 20 at 0.185" 10 | ,0.208979591,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,"10 of 20 at 0.208" 11 | ,0.232199546,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,"11 of 20 at 0.232" 12 | ,0.255419501,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,"12 of 20 at 0.255" 13 | ,0.278639455,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,"13 of 20 at 0.278" 14 | ,0.301859410,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,"14 of 20 at 0.301" 15 | ,0.325079365,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,"15 of 20 at 0.325" 16 | ,0.348299319,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,"16 of 20 at 0.348" 17 | ,0.371519274,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,"17 of 20 at 0.371" 18 | ,0.394739229,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,"18 of 20 at 0.394" 19 | ,0.417959183,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,0.966667,"19 of 20 at 0.417" 20 | ,0.441179138,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,0.966667,1,"20 of 20 at 0.441" 21 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/grid-oss-0.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav",0.000000000,0.0666667,0.1,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,"1 of 20 at 0" 2 | ,0.023219955,0.1,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,"2 of 20 at 0.023" 3 | ,0.046439909,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,"3 of 20 at 0.046" 4 | ,0.069659864,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,"4 of 20 at 0.069" 5 | ,0.092879819,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,"5 of 20 at 0.092" 6 | ,0.116099773,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,"6 of 20 at 0.116" 7 | ,0.139319728,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,"7 of 20 at 0.139" 8 | ,0.162539683,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,"8 of 20 at 0.162" 9 | ,0.185759637,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,"9 of 20 at 0.185" 10 | ,0.208979592,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,"10 of 20 at 0.208" 11 | ,0.232199546,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,"11 of 20 at 0.232" 12 | ,0.255419501,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,"12 of 20 at 0.255" 13 | ,0.278639456,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,"13 of 20 at 0.278" 14 | ,0.301859410,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,"14 of 20 at 0.301" 15 | ,0.325079365,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,"15 of 20 at 0.325" 16 | ,0.348299320,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,"16 of 20 at 0.348" 17 | ,0.371519274,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,"17 of 20 at 0.371" 18 | ,0.394739229,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,"18 of 20 at 0.394" 19 | ,0.417959184,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,0.966667,"19 of 20 at 0.417" 20 | ,0.441179138,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,0.966667,1,"20 of 20 at 0.441" 21 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/grid-oss-6.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav",0.000000000,0.0666667,0.1,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,"1 of 20 at 0" 2 | ,0.023219955,0.1,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,"2 of 20 at 0.023" 3 | ,0.046439909,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,"3 of 20 at 0.046" 4 | ,0.069659864,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,"4 of 20 at 0.069" 5 | ,0.092879819,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,"5 of 20 at 0.092" 6 | ,0.116099773,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,"6 of 20 at 0.116" 7 | ,0.139319728,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,"7 of 20 at 0.139" 8 | ,0.162539683,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,"8 of 20 at 0.162" 9 | ,0.185759637,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,"9 of 20 at 0.185" 10 | ,0.208979592,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,"10 of 20 at 0.208" 11 | ,0.232199546,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,"11 of 20 at 0.232" 12 | ,0.255419501,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,"12 of 20 at 0.255" 13 | ,0.278639456,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,"13 of 20 at 0.278" 14 | ,0.301859410,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,"14 of 20 at 0.301" 15 | ,0.325079365,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,"15 of 20 at 0.325" 16 | ,0.348299320,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,"16 of 20 at 0.348" 17 | ,0.371519274,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,"17 of 20 at 0.371" 18 | ,0.394739229,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,"18 of 20 at 0.394" 19 | ,0.417959184,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,0.966667,"19 of 20 at 0.417" 20 | ,0.441179138,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,0.966667,1,"20 of 20 at 0.441" 21 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/grid-oss-end-times.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav",0.000000000,0.0666667,0.1,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,"1 of 20 at 0" 2 | ,0.023219954,0.1,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,"2 of 20 at 0.023" 3 | ,0.046439909,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,"3 of 20 at 0.046" 4 | ,0.069659863,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,"4 of 20 at 0.069" 5 | ,0.092879818,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,"5 of 20 at 0.092" 6 | ,0.116099773,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,"6 of 20 at 0.116" 7 | ,0.139319727,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,"7 of 20 at 0.139" 8 | ,0.162539682,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,"8 of 20 at 0.162" 9 | ,0.185759637,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,"9 of 20 at 0.185" 10 | ,0.208979591,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,"10 of 20 at 0.208" 11 | ,0.232199546,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,"11 of 20 at 0.232" 12 | ,0.255419501,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,"12 of 20 at 0.255" 13 | ,0.278639455,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,"13 of 20 at 0.278" 14 | ,0.301859410,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,"14 of 20 at 0.301" 15 | ,0.325079365,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,"15 of 20 at 0.325" 16 | ,0.348299319,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,"16 of 20 at 0.348" 17 | ,0.371519274,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,"17 of 20 at 0.371" 18 | ,0.394739229,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,"18 of 20 at 0.394" 19 | ,0.417959183,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,0.966667,"19 of 20 at 0.417" 20 | ,0.441179138,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,0.966667,1,"20 of 20 at 0.441" 21 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/grid-oss-no-flags.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav",0.000000000,0.0666667,0.1,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,"1 of 20 at 0" 2 | ,0.023219954,0.1,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,"2 of 20 at 0.023" 3 | ,0.046439909,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,"3 of 20 at 0.046" 4 | ,0.069659863,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,"4 of 20 at 0.069" 5 | ,0.092879818,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,"5 of 20 at 0.092" 6 | ,0.116099773,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,"6 of 20 at 0.116" 7 | ,0.139319727,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,"7 of 20 at 0.139" 8 | ,0.162539682,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,"8 of 20 at 0.162" 9 | ,0.185759637,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,"9 of 20 at 0.185" 10 | ,0.208979591,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,"10 of 20 at 0.208" 11 | ,0.232199546,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,"11 of 20 at 0.232" 12 | ,0.255419501,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,"12 of 20 at 0.255" 13 | ,0.278639455,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,"13 of 20 at 0.278" 14 | ,0.301859410,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,"14 of 20 at 0.301" 15 | ,0.325079365,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,"15 of 20 at 0.325" 16 | ,0.348299319,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,"16 of 20 at 0.348" 17 | ,0.371519274,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,"17 of 20 at 0.371" 18 | ,0.394739229,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,"18 of 20 at 0.394" 19 | ,0.417959183,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,0.966667,"19 of 20 at 0.417" 20 | ,0.441179138,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,0.966667,1,"20 of 20 at 0.441" 21 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/grid-oss-separator.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav"@0.000000000@0.0666667@0.1@0.133333@0.166667@0.2@0.233333@0.266667@0.3@0.333333@0.366667@"1 of 20 at 0" 2 | @0.023219954@0.1@0.133333@0.166667@0.2@0.233333@0.266667@0.3@0.333333@0.366667@0.4@"2 of 20 at 0.023" 3 | @0.046439909@0.133333@0.166667@0.2@0.233333@0.266667@0.3@0.333333@0.366667@0.4@0.433333@"3 of 20 at 0.046" 4 | @0.069659863@0.166667@0.2@0.233333@0.266667@0.3@0.333333@0.366667@0.4@0.433333@0.466667@"4 of 20 at 0.069" 5 | @0.092879818@0.2@0.233333@0.266667@0.3@0.333333@0.366667@0.4@0.433333@0.466667@0.5@"5 of 20 at 0.092" 6 | @0.116099773@0.233333@0.266667@0.3@0.333333@0.366667@0.4@0.433333@0.466667@0.5@0.533333@"6 of 20 at 0.116" 7 | @0.139319727@0.266667@0.3@0.333333@0.366667@0.4@0.433333@0.466667@0.5@0.533333@0.566667@"7 of 20 at 0.139" 8 | @0.162539682@0.3@0.333333@0.366667@0.4@0.433333@0.466667@0.5@0.533333@0.566667@0.6@"8 of 20 at 0.162" 9 | @0.185759637@0.333333@0.366667@0.4@0.433333@0.466667@0.5@0.533333@0.566667@0.6@0.633333@"9 of 20 at 0.185" 10 | @0.208979591@0.366667@0.4@0.433333@0.466667@0.5@0.533333@0.566667@0.6@0.633333@0.666667@"10 of 20 at 0.208" 11 | @0.232199546@0.4@0.433333@0.466667@0.5@0.533333@0.566667@0.6@0.633333@0.666667@0.7@"11 of 20 at 0.232" 12 | @0.255419501@0.433333@0.466667@0.5@0.533333@0.566667@0.6@0.633333@0.666667@0.7@0.733333@"12 of 20 at 0.255" 13 | @0.278639455@0.466667@0.5@0.533333@0.566667@0.6@0.633333@0.666667@0.7@0.733333@0.766667@"13 of 20 at 0.278" 14 | @0.301859410@0.5@0.533333@0.566667@0.6@0.633333@0.666667@0.7@0.733333@0.766667@0.8@"14 of 20 at 0.301" 15 | @0.325079365@0.533333@0.566667@0.6@0.633333@0.666667@0.7@0.733333@0.766667@0.8@0.833333@"15 of 20 at 0.325" 16 | @0.348299319@0.566667@0.6@0.633333@0.666667@0.7@0.733333@0.766667@0.8@0.833333@0.866667@"16 of 20 at 0.348" 17 | @0.371519274@0.6@0.633333@0.666667@0.7@0.733333@0.766667@0.8@0.833333@0.866667@0.9@"17 of 20 at 0.371" 18 | @0.394739229@0.633333@0.666667@0.7@0.733333@0.766667@0.8@0.833333@0.866667@0.9@0.933333@"18 of 20 at 0.394" 19 | @0.417959183@0.666667@0.7@0.733333@0.766667@0.8@0.833333@0.866667@0.9@0.933333@0.966667@"19 of 20 at 0.417" 20 | @0.441179138@0.7@0.733333@0.766667@0.8@0.833333@0.866667@0.9@0.933333@0.966667@1@"20 of 20 at 0.441" 21 | -------------------------------------------------------------------------------- /runner/AudioDBFeatureWriter.h: -------------------------------------------------------------------------------- 1 | /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 2 | 3 | /* 4 | Sonic Annotator 5 | A utility for batch feature extraction from audio files. 6 | Mark Levy, Chris Sutton and Chris Cannam, Queen Mary, University of London. 7 | Copyright 2007-2008 QMUL. 8 | 9 | This program is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. See the file 13 | COPYING included with this distribution for more information. 14 | */ 15 | 16 | #ifndef AUDIO_DB_FEATURE_WRITER_H 17 | #define AUDIO_DB_FEATURE_WRITER_H 18 | 19 | #include 20 | #include 21 | 22 | #include "transform/FeatureWriter.h" 23 | 24 | namespace sv { 25 | 26 | class AudioDBFeatureWriter : public FeatureWriter 27 | { 28 | public: 29 | AudioDBFeatureWriter(); 30 | virtual ~AudioDBFeatureWriter(); 31 | 32 | virtual std::string getDescription() const; 33 | 34 | virtual ParameterList getSupportedParameters() const; 35 | virtual void setParameters(std::map ¶ms); 36 | 37 | virtual void setCatalogueId(const std::string &); 38 | virtual void setBaseDirectory(const std::string &); 39 | 40 | virtual void write(QString trackid, 41 | const Transform &transform, 42 | const Vamp::Plugin::OutputDescriptor &output, 43 | const Vamp::Plugin::FeatureList &features, 44 | std::string summaryType = ""); 45 | 46 | virtual void finish() { } 47 | 48 | virtual QString getWriterTag() const { return "audiodb"; } 49 | 50 | private: 51 | std::string catalogueId; 52 | std::string baseDir; 53 | 54 | static std::string catalogueIdParam; 55 | static std::string baseDirParam; 56 | 57 | struct TrackStream; 58 | std::map dbfiles; 59 | 60 | bool openDBFile(QString trackid, const std::string& identifier); 61 | bool replaceDBFile(QString trackid, const std::string& identifier); 62 | }; 63 | 64 | } 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /deploy/linux/deploy-appimage.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -eu 4 | 5 | program=sonic-annotator 6 | 7 | get_id() { 8 | if [ -d .hg ]; then 9 | hg id | sed 's/[+ ].*$//' 10 | elif [ -d .git ]; then 11 | git rev-parse --short HEAD 12 | else 13 | echo "WARNING: can't figure out revision from VCS metadata" 1>&2 14 | echo "unknown" 15 | fi 16 | } 17 | 18 | version=$(get_id) 19 | 20 | targetdir="${program}.AppDir" 21 | 22 | echo "Target dir is $targetdir" 23 | 24 | if [ -d "$targetdir" ]; then 25 | echo "Target directory exists, not overwriting" 26 | exit 27 | fi 28 | 29 | mkdir "$targetdir" 30 | 31 | mkdir -p "$targetdir"/usr/bin 32 | mkdir -p "$targetdir"/usr/lib 33 | 34 | cp "build/$program" "$targetdir"/usr/bin/ 35 | 36 | add_dependencies() { 37 | 38 | local binary="$1" 39 | 40 | echo "ldd $binary yields:" 41 | ldd "$binary" 42 | 43 | for lib in $(ldd "$binary" | grep '=> [^ ]*/lib/' | \ 44 | sed 's/^.*=> //' | sed 's/ .*$//'); do 45 | 46 | base=$(basename "$lib") 47 | if grep -v '^#' sv-dependency-builds/linux/appimage/excludelist | 48 | grep -q "^$base$" ; then 49 | echo "excluding: $lib" 50 | continue 51 | fi 52 | 53 | target="$targetdir/usr/lib/$(basename $lib)" 54 | 55 | mkdir -p "$(dirname $target)" 56 | 57 | if [ ! -f "$target" ]; then 58 | 59 | cp -Lv "$lib" "$target" 60 | chmod +x "$target" 61 | 62 | add_dependencies "$lib" 63 | 64 | fi 65 | done 66 | } 67 | 68 | add_dependencies "build/$program" 69 | 70 | cp "$program.desktop" "$targetdir/" 71 | 72 | # We don't want an icon, but AppImage seems to insist 73 | cp "deploy/linux/sonic-visualiser.svg" "$targetdir/" 74 | 75 | cp "deploy/linux/AppRun" "$targetdir/" 76 | 77 | chmod +x "$targetdir/AppRun" 78 | 79 | # Do this with a separate extraction step, so as to make it work even 80 | # in situations where FUSE is unavailable like in a Docker container 81 | export ARCH=x86_64 82 | sv-dependency-builds/linux/appimage/appimagetool-x86_64.AppImage --appimage-extract 83 | ./squashfs-root/AppRun "$targetdir" "SonicAnnotator-$version-x86_64.AppImage" 84 | 85 | -------------------------------------------------------------------------------- /runner/LabFeatureWriter.h: -------------------------------------------------------------------------------- 1 | /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 2 | 3 | /* 4 | Sonic Visualiser 5 | An audio file viewer and annotation editor. 6 | 7 | Sonic Annotator 8 | A utility for batch feature extraction from audio files. 9 | 10 | Mark Levy, Chris Sutton and Chris Cannam, Queen Mary, University of London. 11 | Copyright 2007-2008 QMUL. 12 | 13 | This program is free software; you can redistribute it and/or 14 | modify it under the terms of the GNU General Public License as 15 | published by the Free Software Foundation; either version 2 of the 16 | License, or (at your option) any later version. See the file 17 | COPYING included with this distribution for more information. 18 | */ 19 | 20 | #ifndef LAB_FEATURE_WRITER_H 21 | #define LAB_FEATURE_WRITER_H 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | #include 28 | 29 | #include "transform/FileFeatureWriter.h" 30 | 31 | class QTextStream; 32 | class QFile; 33 | 34 | namespace sv { 35 | 36 | class LabFeatureWriter : public FileFeatureWriter 37 | { 38 | public: 39 | LabFeatureWriter(); 40 | virtual ~LabFeatureWriter(); 41 | 42 | virtual std::string getDescription() const; 43 | 44 | virtual ParameterList getSupportedParameters() const; 45 | virtual void setParameters(std::map ¶ms); 46 | 47 | virtual void write(QString trackid, 48 | const Transform &transform, 49 | const Vamp::Plugin::OutputDescriptor &output, 50 | const Vamp::Plugin::FeatureList &features, 51 | std::string summaryType = ""); 52 | 53 | virtual void finish(); 54 | 55 | virtual QString getWriterTag() const { return "lab"; } 56 | 57 | private: 58 | bool m_forceEnd; 59 | 60 | typedef std::pair DataId; // track id, transform 61 | typedef std::map PendingFeatures; 62 | PendingFeatures m_pending; 63 | 64 | void writeFeature(QTextStream &, 65 | const Vamp::Plugin::Feature &f, 66 | const Vamp::Plugin::Feature *optionalNextFeature); 67 | 68 | int m_digits; 69 | }; 70 | 71 | } 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /tests/test-as-advertised/test-as-advertised.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . ../include.sh 4 | 5 | infile=$audiopath/3clicks8.wav 6 | tmpdir=$mypath/tmp_1_$$.dir 7 | tmpwav=$tmpdir/test.wav 8 | 9 | trap "rm -rf $tmpdir" 0 10 | 11 | types=`$r --list-writers` 12 | [ -n "$types" ] || \ 13 | fail "Fails to report list of writers" 14 | 15 | onsets=$mypath/transforms/percussiononsets-onsets.n3 16 | df=$mypath/transforms/percussiononsets-detectionfunction.n3 17 | 18 | adbdir=$tmpdir/audiodb-test 19 | 20 | for type in $types; do 21 | 22 | mkdir -p $tmpdir 23 | cp $infile $tmpwav 24 | 25 | # Some of these are special cases: 26 | # 27 | # * The "default" writer type always prints to stdout instead of 28 | # to a file. 29 | # 30 | # * The "audiodb" writer will not print any output for features 31 | # that have no values (but are only point events). I don't know 32 | # how reasonable that is, but it's clearly intentional. It also 33 | # writes to a subdirectory $basedir/$catid/$trackid.$output 34 | 35 | case $type in 36 | audiodb) 37 | mkdir -p $adbdir 38 | $r -t $df -w $type $tmpwav --audiodb-basedir $tmpdir --audiodb-catid `basename $adbdir` 2>/dev/null || \ 39 | fail "Fails to run with reader type \"$type\" and default options" 40 | ;; 41 | default) 42 | $r -t $onsets -w $type $tmpwav > $tmpdir/test.out 2>/dev/null || \ 43 | fail "Fails to run with reader type \"$type\" and default options" 44 | ;; 45 | *) 46 | $r -t $onsets -w $type $tmpwav 2>/dev/null || \ 47 | fail "Fails to run with reader type \"$type\" and default options" 48 | ;; 49 | esac 50 | newfiles=`ls $tmpdir | grep -F -v .wav` 51 | if [ "$type" = audiodb ]; then newfiles=`ls $adbdir`; fi 52 | 53 | [ -n "$newfiles" ] || \ 54 | fail "Fails to create output file for reader \"$type\" with default options" 55 | 56 | case `echo $newfiles | wc -w` in 57 | [2-9]) 58 | if [ "$type" != audiodb ]; then 59 | fail "Produces more than one output file for reader \"$type\" with default options" 60 | fi 61 | ;; 62 | 1) 63 | if [ "$type" = audiodb ]; then 64 | fail "Produces only one output file for reader \"$type\" with default options (expected two)" 65 | fi 66 | ;; 67 | esac 68 | 69 | rm -r $tmpdir 70 | done 71 | 72 | exit 0 73 | 74 | -------------------------------------------------------------------------------- /deploy/win/build-64.bat: -------------------------------------------------------------------------------- 1 | rem Run this from within the top-level SV dir: deploy\win64\build-64.bat 2 | rem To build from clean, delete the folder build_win64 first 3 | 4 | echo on 5 | 6 | set STARTPWD=%CD% 7 | 8 | rem The first paths are for workstation builds, the last for CI 9 | set QTDIR=C:\QtOpenSource\6.7.2\msvc2019_64 10 | if not exist %QTDIR% ( 11 | set QTDIR=C:\Qt\6.6.1\msvc2019_64 12 | ) 13 | if not exist %QTDIR% ( 14 | set QTDIR=%QT_ROOT_DIR% 15 | ) 16 | if not exist %QTDIR% ( 17 | @ echo Could not find Qt in %QTDIR% 18 | @ exit /b 2 19 | ) 20 | 21 | rem Similarly, the first path is for workstation builds, the second for CI 22 | set vcvarsall="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" 23 | if not exist %vcvarsall% ( 24 | set vcvarsall="C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" 25 | ) 26 | if not exist %vcvarsall% ( 27 | @ echo Could not find MSVC vars batch file in %vcvarsall% 28 | @ exit /b 2 29 | ) 30 | 31 | call %vcvarsall% amd64 32 | 33 | set ORIGINALPATH=%PATH% 34 | set PATH=%PATH%;C:\Program Files (x86)\SMLNJ\bin;%QTDIR%\bin 35 | 36 | cd %STARTPWD% 37 | 38 | call .\repoint install 39 | if %errorlevel% neq 0 exit /b %errorlevel% 40 | 41 | set BUILDDIR=build_win64 42 | 43 | if not exist %BUILDDIR%\build.ninja ( 44 | meson setup %BUILDDIR% --buildtype release -Db_lto=true 45 | if %errorlevel% neq 0 exit /b %errorlevel% 46 | ) 47 | 48 | ninja -C %BUILDDIR% 49 | if %errorlevel% neq 0 exit /b %errorlevel% 50 | 51 | copy %QTDIR%\bin\Qt6Core.dll .\%BUILDDIR% 52 | copy %QTDIR%\bin\Qt6Network.dll .\%BUILDDIR% 53 | copy %QTDIR%\bin\Qt6Xml.dll .\%BUILDDIR% 54 | copy %QTDIR%\bin\Qt6Test.dll .\%BUILDDIR% 55 | 56 | mkdir .\%BUILDDIR%\plugins 57 | mkdir .\%BUILDDIR%\plugins\platforms 58 | mkdir .\%BUILDDIR%\plugins\tls 59 | 60 | copy %QTDIR%\plugins\platforms\qminimal.dll .\%BUILDDIR%\plugins\platforms 61 | copy %QTDIR%\plugins\platforms\qwindows.dll .\%BUILDDIR%\plugins\platforms 62 | copy %QTDIR%\plugins\tls\qopensslbackend.dll .\%BUILDDIR%\plugins\tls 63 | 64 | copy sv-dependency-builds\win64-msvc\lib\libsndfile-1.dll .\%BUILDDIR% 65 | 66 | meson test -C %BUILDDIR% 67 | if %errorlevel% neq 0 exit /b %errorlevel% 68 | 69 | %BUILDDIR%\sonic-annotator -v 70 | 71 | set PATH=%ORIGINALPATH% 72 | 73 | -------------------------------------------------------------------------------- /tests/test-lab-writer/expected/grid-oss-fill-ends.lab: -------------------------------------------------------------------------------- 1 | 0.000000000 0.023219955 0.0666667 0.1 0.133333 0.166667 0.2 0.233333 0.266667 0.3 0.333333 0.366667 "1 of 20 at 0" 2 | 0.023219955 0.046439909 0.1 0.133333 0.166667 0.2 0.233333 0.266667 0.3 0.333333 0.366667 0.4 "2 of 20 at 0.023" 3 | 0.046439909 0.069659864 0.133333 0.166667 0.2 0.233333 0.266667 0.3 0.333333 0.366667 0.4 0.433333 "3 of 20 at 0.046" 4 | 0.069659864 0.092879819 0.166667 0.2 0.233333 0.266667 0.3 0.333333 0.366667 0.4 0.433333 0.466667 "4 of 20 at 0.069" 5 | 0.092879819 0.116099773 0.2 0.233333 0.266667 0.3 0.333333 0.366667 0.4 0.433333 0.466667 0.5 "5 of 20 at 0.092" 6 | 0.116099773 0.139319728 0.233333 0.266667 0.3 0.333333 0.366667 0.4 0.433333 0.466667 0.5 0.533333 "6 of 20 at 0.116" 7 | 0.139319728 0.162539683 0.266667 0.3 0.333333 0.366667 0.4 0.433333 0.466667 0.5 0.533333 0.566667 "7 of 20 at 0.139" 8 | 0.162539683 0.185759637 0.3 0.333333 0.366667 0.4 0.433333 0.466667 0.5 0.533333 0.566667 0.6 "8 of 20 at 0.162" 9 | 0.185759637 0.208979592 0.333333 0.366667 0.4 0.433333 0.466667 0.5 0.533333 0.566667 0.6 0.633333 "9 of 20 at 0.185" 10 | 0.208979592 0.232199546 0.366667 0.4 0.433333 0.466667 0.5 0.533333 0.566667 0.6 0.633333 0.666667 "10 of 20 at 0.208" 11 | 0.232199546 0.255419501 0.4 0.433333 0.466667 0.5 0.533333 0.566667 0.6 0.633333 0.666667 0.7 "11 of 20 at 0.232" 12 | 0.255419501 0.278639456 0.433333 0.466667 0.5 0.533333 0.566667 0.6 0.633333 0.666667 0.7 0.733333 "12 of 20 at 0.255" 13 | 0.278639456 0.301859410 0.466667 0.5 0.533333 0.566667 0.6 0.633333 0.666667 0.7 0.733333 0.766667 "13 of 20 at 0.278" 14 | 0.301859410 0.325079365 0.5 0.533333 0.566667 0.6 0.633333 0.666667 0.7 0.733333 0.766667 0.8 "14 of 20 at 0.301" 15 | 0.325079365 0.348299320 0.533333 0.566667 0.6 0.633333 0.666667 0.7 0.733333 0.766667 0.8 0.833333 "15 of 20 at 0.325" 16 | 0.348299320 0.371519274 0.566667 0.6 0.633333 0.666667 0.7 0.733333 0.766667 0.8 0.833333 0.866667 "16 of 20 at 0.348" 17 | 0.371519274 0.394739229 0.6 0.633333 0.666667 0.7 0.733333 0.766667 0.8 0.833333 0.866667 0.9 "17 of 20 at 0.371" 18 | 0.394739229 0.417959184 0.633333 0.666667 0.7 0.733333 0.766667 0.8 0.833333 0.866667 0.9 0.933333 "18 of 20 at 0.394" 19 | 0.417959184 0.441179138 0.666667 0.7 0.733333 0.766667 0.8 0.833333 0.866667 0.9 0.933333 0.966667 "19 of 20 at 0.417" 20 | 0.441179138 0.441179138 0.7 0.733333 0.766667 0.8 0.833333 0.866667 0.9 0.933333 0.966667 1 "20 of 20 at 0.441" 21 | -------------------------------------------------------------------------------- /tests/test-csv-writer/expected/grid-oss-fill-ends.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav",0.000000000,0.023219955,0.0666667,0.1,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,"1 of 20 at 0" 2 | ,0.023219955,0.023219954,0.1,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,"2 of 20 at 0.023" 3 | ,0.046439909,0.023219955,0.133333,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,"3 of 20 at 0.046" 4 | ,0.069659864,0.023219955,0.166667,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,"4 of 20 at 0.069" 5 | ,0.092879819,0.023219954,0.2,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,"5 of 20 at 0.092" 6 | ,0.116099773,0.023219955,0.233333,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,"6 of 20 at 0.116" 7 | ,0.139319728,0.023219955,0.266667,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,"7 of 20 at 0.139" 8 | ,0.162539683,0.023219954,0.3,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,"8 of 20 at 0.162" 9 | ,0.185759637,0.023219955,0.333333,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,"9 of 20 at 0.185" 10 | ,0.208979592,0.023219954,0.366667,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,"10 of 20 at 0.208" 11 | ,0.232199546,0.023219955,0.4,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,"11 of 20 at 0.232" 12 | ,0.255419501,0.023219955,0.433333,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,"12 of 20 at 0.255" 13 | ,0.278639456,0.023219954,0.466667,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,"13 of 20 at 0.278" 14 | ,0.301859410,0.023219955,0.5,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,"14 of 20 at 0.301" 15 | ,0.325079365,0.023219955,0.533333,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,"15 of 20 at 0.325" 16 | ,0.348299320,0.023219954,0.566667,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,"16 of 20 at 0.348" 17 | ,0.371519274,0.023219955,0.6,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,"17 of 20 at 0.371" 18 | ,0.394739229,0.023219955,0.633333,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,"18 of 20 at 0.394" 19 | ,0.417959184,0.023219954,0.666667,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,0.966667,"19 of 20 at 0.417" 20 | ,0.441179138,0.000000000,0.7,0.733333,0.766667,0.8,0.833333,0.866667,0.9,0.933333,0.966667,1,"20 of 20 at 0.441" 21 | -------------------------------------------------------------------------------- /deploy/win/build-64-static.bat: -------------------------------------------------------------------------------- 1 | 2 | rem Using Qt Base module thus: 3 | rem .\configure -static -static-runtime -release -platform win32-msvc -no-opengl -no-angle -nomake examples -prefix C:\Qt\5.14.1-static 4 | 5 | set QTDIR=C:\Qt\5.14.1-static-msvc2015 6 | if not exist %QTDIR% ( 7 | @ echo Could not find 64-bit Qt in %QTDIR% 8 | @ exit /b 2 9 | ) 10 | 11 | rem Not 2019! Its APIs are too new for use in our static build 12 | rem set vcvarsall="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" 13 | set vcvarsall="C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" 14 | 15 | if not exist %vcvarsall% ( 16 | @ echo "Could not find MSVC vars batch file" 17 | @ exit /b 2 18 | ) 19 | 20 | set SMLNJDIR=C:\Program Files (x86)\SMLNJ 21 | if not exist "%SMLNJDIR%\bin" ( 22 | @ echo Could not find SML/NJ, required for Repoint 23 | @ exit /b 2 24 | ) 25 | 26 | call %vcvarsall% amd64 27 | if %errorlevel% neq 0 exit /b %errorlevel% 28 | 29 | set ORIGINALPATH=%PATH% 30 | set PATH=%PATH%;%SMLNJDIR%\bin;%QTDIR%\bin 31 | set NAME=Open Source Developer, Christopher Cannam 32 | 33 | set ARG=%1 34 | shift 35 | if "%ARG%" == "sign" ( 36 | @ echo NOTE: sign option specified, will attempt to codesign exe and msi 37 | @ echo NOTE: starting by codesigning an unrelated executable, so we know 38 | @ echo NOTE: whether it'll work before doing the entire build 39 | copy "%SMLNJDIR%\bin\.run\run.x86-win32.exe" signtest.exe 40 | signtool sign /v /n "%NAME%" /t http://time.certum.pl /fd sha1 /a signtest.exe 41 | if errorlevel 1 exit /b %errorlevel% 42 | signtool verify /pa signtest.exe 43 | if errorlevel 1 exit /b %errorlevel% 44 | del signtest.exe 45 | @ echo NOTE: success 46 | ) else ( 47 | @ echo NOTE: sign option not specified, will not codesign anything 48 | ) 49 | 50 | cd %STARTPWD% 51 | 52 | call .\repoint install 53 | if %errorlevel% neq 0 exit /b %errorlevel% 54 | 55 | mkdir build_win64_static 56 | cd build_win64_static 57 | 58 | qmake -spec win32-msvc -r -tp vc ..\sonic-annotator.pro 59 | if %errorlevel% neq 0 exit /b %errorlevel% 60 | 61 | mkdir o 62 | 63 | msbuild sonic-annotator.sln /t:Build /p:Configuration=Release 64 | if %errorlevel% neq 0 exit /b %errorlevel% 65 | 66 | rem Sadly this static build is not totally static 67 | copy ..\sv-dependency-builds\win64-msvc\lib\libsndfile-1.dll .\release 68 | 69 | .\release\test-svcore-base 70 | .\release\test-svcore-system 71 | 72 | .\release\sonic-annotator -v 73 | 74 | set PATH=%ORIGINALPATH% 75 | cd %STARTPWD% 76 | -------------------------------------------------------------------------------- /tests/test-jams-writer/test-jams-writer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . ../include.sh 4 | 5 | tmpjson=$mypath/tmp_1_$$.json 6 | 7 | silentfile=$audiopath/20sec-silence.wav 8 | infile=$audiopath/3clicks8.wav 9 | 10 | trap "rm -f $tmpjson" 0 11 | 12 | transformdir=$mypath/transforms 13 | 14 | mandatory="-w jams" 15 | 16 | # First check that the JSON is valid for all outputs 17 | 18 | for output in instants curve-oss curve-fsr curve-fsr-timed curve-vsr grid-oss grid-fsr notes-regions; do 19 | 20 | $r -d "$testplug:$output" $mandatory --jams-one-file "$tmpjson" --jams-force "$silentfile" 2>/dev/null || \ 21 | fail "Failed to run for plugin $testplug with output $output" 22 | 23 | check_json "$tmpjson" "test plugin output $output" 24 | 25 | done 26 | 27 | # If JAMS is installed, we can report on whether the outputs are valid 28 | # JAMS schema files or not -- unfortunately we can't comply with the 29 | # schema for most real plugins, so we can only make indicative reports 30 | # for most. This is such a limited test that we make it optional; it's 31 | # a bit much to expect everyone to have JAMS installed just for 32 | # this. Also the JAMS verifier doesn't currently always work for me 33 | # (e.g. it doesn't seem to work correctly with Python 3 at the moment) 34 | # so let's not make this fatal either. 35 | 36 | if jams_to_lab.py --help >/dev/null 2>&1; then 37 | 38 | $r -t "$transformdir/onsets.n3" $mandatory --jams-one-file "$tmpjson" --jams-force "$infile" 2>/dev/null || \ 39 | fail "Failed to run for onsets" 40 | 41 | if ! jams_to_lab.py "$tmpjson" test; then 42 | echo "WARNING: JAMS schema verification failed for onsets" 43 | fi 44 | fi 45 | 46 | # Now check against expected output, for a subset 47 | 48 | for output in instants curve-fsr grid-oss notes-regions; do 49 | 50 | $r -d "$testplug:$output" $mandatory --jams-one-file "$tmpjson" --jams-force "$silentfile" 2>/dev/null || \ 51 | fail "Failed to run for plugin $testplug with output $output" 52 | 53 | expected="$mypath/expected/$output.json" 54 | jsoncompare "$tmpjson" "$expected" || \ 55 | faildiff "Output differs from expected for $output" "$tmpjson" "$expected" 56 | 57 | done 58 | 59 | # Test digits option, with an output that has lots of digits to round 60 | 61 | for digits in 0 6 2; do 62 | 63 | $r -d "$testplug:grid-oss" $mandatory --jams-digits "$digits" --jams-one-file "$tmpjson" --jams-force "$silentfile" 2>/dev/null || \ 64 | fail "Failed to run for af with digits = $digits" 65 | 66 | expected="$mypath/expected/grid-oss-$digits.json" 67 | jsoncompare "$tmpjson" "$expected" || \ 68 | faildiff "Output differs from expected for af with digits = $digits" "$tmpjson" "$expected" 69 | 70 | done 71 | 72 | -------------------------------------------------------------------------------- /tests/test-multiple-audio/expected/all-files.csv: -------------------------------------------------------------------------------- 1 | "./../audio/20sec-silence.wav",0.000000000,20.015600907,mean,2.9e-5,"(mean value, continuous-time average)" 2 | ,0.000000000,20.015600907,median,3.05e-5,"(median value, continuous-time average)" 3 | ,0.000000000,20.015600907,mean,3.96e-5,"(mean value, continuous-time average)" 4 | "./../audio/3clicks.mp3",0.000000000,4.992290250,mean,0.000287,"(mean value, continuous-time average)" 5 | ,0.000000000,4.992290250,median,1.64e-5,"(median value, continuous-time average)" 6 | ,0.000000000,4.992290250,mean,0.000924,"(mean value, continuous-time average)" 7 | "./../audio/3clicks.ogg",0.000000000,4.992290250,mean,0.000303,"(mean value, continuous-time average)" 8 | ,0.000000000,4.992290250,median,2.42e-5,"(median value, continuous-time average)" 9 | ,0.000000000,4.992290250,mean,0.00108,"(mean value, continuous-time average)" 10 | "./../audio/3clicks.opus",0.000000000,4.992290250,mean,0.00268,"(mean value, continuous-time average)" 11 | ,0.000000000,4.992290250,median,0.00243,"(median value, continuous-time average)" 12 | ,0.000000000,4.992290250,mean,0.00341,"(mean value, continuous-time average)" 13 | "./../audio/3clicks8.wav",0.000000000,4.992290250,mean,0.00369,"(mean value, continuous-time average)" 14 | ,0.000000000,4.992290250,median,0.00354,"(median value, continuous-time average)" 15 | ,0.000000000,4.992290250,mean,0.0042,"(mean value, continuous-time average)" 16 | "./../audio/3clicks8quiet.wav",0.000000000,4.992290250,mean,0.00548,"(mean value, continuous-time average)" 17 | ,0.000000000,4.992290250,median,0.00548,"(median value, continuous-time average)" 18 | ,0.000000000,4.992290250,mean,0.00563,"(mean value, continuous-time average)" 19 | "./../audio/6clicks.ogg",0.000000000,9.961360545,mean,0.00396,"(mean value, continuous-time average)" 20 | ,0.000000000,9.961360545,median,0.00372,"(median value, continuous-time average)" 21 | ,0.000000000,9.961360545,mean,0.00468,"(mean value, continuous-time average)" 22 | "./../audio/6clicks8.wav",0.000000000,9.961360545,mean,0.00369,"(mean value, continuous-time average)" 23 | ,0.000000000,9.961360545,median,0.00354,"(median value, continuous-time average)" 24 | ,0.000000000,9.961360545,mean,0.00417,"(mean value, continuous-time average)" 25 | "./../audio/id3v2-iso-8859-1.mp3",0.000000000,4.992290250,mean,0.000287,"(mean value, continuous-time average)" 26 | ,0.000000000,4.992290250,median,1.64e-5,"(median value, continuous-time average)" 27 | ,0.000000000,4.992290250,mean,0.000924,"(mean value, continuous-time average)" 28 | "./../audio/id3v2-ucs-2.mp3",0.000000000,4.992290250,mean,0.000287,"(mean value, continuous-time average)" 29 | ,0.000000000,4.992290250,median,1.64e-5,"(median value, continuous-time average)" 30 | ,0.000000000,4.992290250,mean,0.000924,"(mean value, continuous-time average)" 31 | -------------------------------------------------------------------------------- /tests/test-lab-writer/test-lab-writer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . ../include.sh 4 | 5 | infile=$audiopath/20sec-silence.wav 6 | tmplab=$mypath/tmp_1_$$.lab 7 | 8 | trap "rm -f $tmplab" 0 9 | 10 | for output in notes-regions curve-vsr grid-oss; do 11 | 12 | flag="" 13 | 14 | $r -d "$testplug:$output" -w lab --lab-stdout "$infile" 2>/dev/null > "$tmplab" || \ 15 | fail "Failed to run for plugin $testplug with output $output and no additional flags" 16 | 17 | csvcompare "$tmplab" "$mypath/expected/$output-no-flags.lab" || \ 18 | faildiff "Output differs from expected for output $output and no additional flags" "$tmplab" "$mypath/expected/$output-no-flags.lab" 19 | 20 | flag=fill-ends 21 | 22 | $r -d "$testplug:$output" -w lab --lab-$flag --lab-stdout "$infile" 2>/dev/null > "$tmplab" || \ 23 | fail "Failed to run for plugin $testplug with output $output and $flag flag" 24 | 25 | csvcompare "$tmplab" "$mypath/expected/$output-$flag.lab" || \ 26 | faildiff "Output differs from expected for output $output and $flag flag" "$tmplab" "$mypath/expected/$output-$flag.lab" 27 | done 28 | 29 | # Do it all over again, but using the CSV writer. The Lab writer is 30 | # actually redundant, it's equivalent to -w csv --csv-separator '\t' 31 | # --csv-end-times --csv-omit-filename 32 | 33 | for output in notes-regions curve-vsr grid-oss; do 34 | 35 | flag="" 36 | 37 | $r -d "$testplug:$output" -w csv --csv-separator '\t' --csv-end-times --csv-omit-filename --csv-stdout "$infile" 2>/dev/null > "$tmplab" || \ 38 | fail "Failed to run for plugin $testplug and CSV writer with output $output and no additional flags" 39 | 40 | csvcompare "$tmplab" "$mypath/expected/$output-no-flags.lab" || \ 41 | faildiff "Output differs from expected for CSV writer with output $output and no additional flags" "$tmplab" "$mypath/expected/$output-no-flags.lab" 42 | 43 | flag=fill-ends 44 | 45 | $r -d "$testplug:$output" -w csv --csv-separator '\t' --csv-end-times --csv-omit-filename --csv-$flag --csv-stdout "$infile" 2>/dev/null > "$tmplab" || \ 46 | fail "Failed to run for plugin $testplug and CSV writer with output $output and $flag flag" 47 | 48 | csvcompare "$tmplab" "$mypath/expected/$output-$flag.lab" || \ 49 | faildiff "Output differs from expected for CSV writer with output $output and $flag flag" "$tmplab" "$mypath/expected/$output-$flag.lab" 50 | done 51 | 52 | for output in grid-oss; do 53 | for digits in 0 6 2; do 54 | 55 | $r -d "$testplug:$output" -w lab --lab-stdout --lab-digits "$digits" "$infile" 2>/dev/null > "$tmplab" || \ 56 | fail "Failed to run for plugin $testplug with output $output and digits $digits" 57 | 58 | # no fuzz here 59 | cmp -s "$tmplab" "$mypath/expected/$output-$digits.lab" || \ 60 | faildiff "Output differs from expected for CSV writer with output $output and digits $digits" "$tmplab" "$mypath/expected/$output-$digits.lab" 61 | 62 | done 63 | done 64 | 65 | exit 0 66 | 67 | -------------------------------------------------------------------------------- /runner/MIDIFeatureWriter.h: -------------------------------------------------------------------------------- 1 | /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 2 | 3 | /* 4 | Sonic Annotator 5 | A utility for batch feature extraction from audio files. 6 | 7 | Mark Levy, Chris Sutton and Chris Cannam, Queen Mary, University of London. 8 | Copyright 2007-2014 QMUL. 9 | 10 | This program is free software; you can redistribute it and/or 11 | modify it under the terms of the GNU General Public License as 12 | published by the Free Software Foundation; either version 2 of the 13 | License, or (at your option) any later version. See the file 14 | COPYING included with this distribution for more information. 15 | */ 16 | 17 | #ifndef MIDI_FEATURE_WRITER_H 18 | #define MIDI_FEATURE_WRITER_H 19 | 20 | #include "transform/FileFeatureWriter.h" 21 | #include "base/NoteData.h" 22 | #include "base/NoteExportable.h" 23 | 24 | namespace sv { 25 | 26 | class MIDIFileWriter; 27 | 28 | class MIDIFeatureWriter : public FileFeatureWriter 29 | { 30 | public: 31 | MIDIFeatureWriter(); 32 | virtual ~MIDIFeatureWriter(); 33 | 34 | std::string getDescription() const; 35 | 36 | virtual ParameterList getSupportedParameters() const; 37 | virtual void setParameters(std::map ¶ms); 38 | 39 | virtual void setTrackMetadata(QString trackid, TrackMetadata metadata); 40 | 41 | virtual void write(QString trackid, 42 | const Transform &transform, 43 | const Vamp::Plugin::OutputDescriptor &output, 44 | const Vamp::Plugin::FeatureList &features, 45 | std::string summaryType = ""); 46 | 47 | virtual void finish(); 48 | 49 | virtual QString getWriterTag() const { return "midi"; } 50 | 51 | private: 52 | class TrivialNoteExportable : public NoteExportable { 53 | public: 54 | TrivialNoteExportable(NoteList notes) : m_notes(notes) { } 55 | virtual NoteList getNotes() const { 56 | return m_notes; 57 | } 58 | virtual NoteList getNotesActiveAt(sv_frame_t) const { 59 | // Not required by MIDIFileWriter, not supported 60 | return NoteList(); 61 | } 62 | virtual NoteList getNotesStartingWithin(sv_frame_t, sv_frame_t) const { 63 | // Not required by MIDIFileWriter, not supported 64 | return NoteList(); 65 | } 66 | private: 67 | NoteList m_notes; 68 | }; 69 | 70 | typedef std::map NoteMap; // output filename -> notes 71 | NoteMap m_notes; 72 | 73 | typedef std::map > FileTransformMap; 74 | FileTransformMap m_fileTransforms; 75 | 76 | typedef std::map SampleRateMap; // NoteData uses sample timing 77 | SampleRateMap m_rates; 78 | 79 | typedef std::map ChannelMap; 80 | ChannelMap m_channels; 81 | 82 | typedef std::map NextChannelMap; 83 | NextChannelMap m_nextChannels; 84 | }; 85 | 86 | } 87 | 88 | #endif 89 | 90 | -------------------------------------------------------------------------------- /tests/test-transforms-basic/test-transforms-basic.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . ../include.sh 4 | 5 | infile=$audiopath/3clicks8.wav 6 | tmpfile1=$mypath/tmp_1_$$ 7 | tmpfile2=$mypath/tmp_2_$$ 8 | 9 | trap "rm -f $tmpfile1 $tmpfile2" 0 10 | 11 | $r --skeleton $percplug > $tmpfile1 2>/dev/null || \ 12 | fail "Fails to run with --skeleton $percplug" 13 | 14 | $r -t $tmpfile1 -w csv --csv-stdout $infile > $tmpfile2 2>/dev/null || \ 15 | fail "Fails to run with -t $tmpfile1 -w csv --csv-stdout $infile" 16 | 17 | csvcompare $tmpfile2 $mypath/expected/skeleton-1.csv || \ 18 | faildiff "Output mismatch for skeleton-1.csv" $tmpfile2 $mypath/expected/skeleton-1.csv 19 | 20 | for suffix in \ 21 | -no-parameters-default-output \ 22 | -no-parameters \ 23 | "" \ 24 | -start-and-duration \ 25 | -set-parameters \ 26 | -set-step-and-block-size \ 27 | -set-sample-rate \ 28 | -df-windowtype-default \ 29 | -df-windowtype-hanning \ 30 | -df-windowtype-hamming \ 31 | -df-start-and-duration \ 32 | -multiple-outputs \ 33 | -multiple-outputs-start-and-duration \ 34 | ; do 35 | 36 | for type in xml n3 ; do 37 | 38 | transform=$mypath/transforms/percussiononsets$suffix.$type 39 | expected=$mypath/expected/percussiononsets$suffix.csv 40 | 41 | if [ ! -f $transform ]; then 42 | if [ $type = "xml" ]; then 43 | continue # not everything can be expressed in the XML 44 | # format, e.g. the multiple output test can't 45 | fi 46 | fi 47 | 48 | test -f $transform || \ 49 | fail "Internal error: no transforms file for suffix $suffix (looking for $transform)" 50 | 51 | test -f $expected || \ 52 | fail "Internal error: no expected output file for suffix $suffix (looking for $expected)" 53 | 54 | $r -t $transform -w csv --csv-stdout $infile > $tmpfile2 2>/dev/null || \ 55 | fail "Fails to run transform $transform" 56 | 57 | csvcompare $tmpfile2 $expected || \ 58 | faildiff "Output mismatch for transform $transform" $tmpfile2 $expected 59 | done 60 | done 61 | 62 | # Check we can't run with multiple transforms if one or more is missing! 63 | 64 | $r -t $mypath/transforms/percussiononsets-set-step-and-block-size.n3 \ 65 | -t $mypath/transforms/squiggly.n3 \ 66 | -t $mypath/transforms/percussiononsets-start-and-duration.n3 \ 67 | -w csv --csv-stdout $infile > $tmpfile2 2>/dev/null && \ 68 | fail "Incorrectly seems to succeed in running with a missing transform file" 69 | 70 | 71 | # Check we can run with multiple transforms if they're all present 72 | 73 | $r -t $mypath/transforms/percussiononsets-set-step-and-block-size.n3 \ 74 | -t $mypath/transforms/percussiononsets-set-parameters.xml \ 75 | -t $mypath/transforms/percussiononsets-start-and-duration.n3 \ 76 | -w csv --csv-stdout $infile > $tmpfile2 2>/dev/null || \ 77 | fail "Fails to run with multiple transforms" 78 | 79 | csvcompare $tmpfile2 $mypath/expected/multiple.csv || \ 80 | faildiff "Output mismatch for multiple transforms" $tmpfile2 $mypath/expected/multiple.csv 81 | 82 | exit 0 83 | 84 | -------------------------------------------------------------------------------- /feature-description-example.n3: -------------------------------------------------------------------------------- 1 | 2 | @prefix rdf: . 3 | @prefix rdfs: . 4 | @prefix dc: . 5 | @prefix mo: . 6 | @prefix af: . 7 | @prefix event: . 8 | @prefix tl: . 9 | @prefix xsd: . 10 | @prefix : <#> . 11 | 12 | 13 | # Describe the signal we're annotating, and associate it with a 14 | # timeline (the timeline is named as :base_timeline but never given 15 | # any attributes in this document). Any feature that is associated 16 | # with the same timeline will be taken as derived from this signal. 17 | 18 | :audio_signal a mo:Signal ; 19 | mo:available_as ; 20 | mo:time :signal_interval . 21 | 22 | :signal_interval a tl:Interval ; 23 | tl:onTimeLine :base_timeline ; 24 | tl:beginsAt "PT0"^^xsd:duration . 25 | 26 | 27 | # A sparse feature event. 28 | 29 | :event0 a af:Onset ; 30 | event:time :time0 . 31 | 32 | :time0 a tl:Instant ; 33 | tl:onTimeLine :base_timeline ; 34 | tl:at "PT0.185759637S"^^xsd:duration . 35 | 36 | # Alternatively we could write that with a blank node. 37 | 38 | :event1 a af:Onset ; 39 | event:time [ 40 | a tl:Instant ; 41 | tl:onTimeLine :base_timeline ; 42 | tl:at "PT0.510839002S"^^xsd:duration ; 43 | ] . 44 | 45 | 46 | # For a dense feature, we need an appropriately sampled, windowed timeline. 47 | 48 | :feature_timeline a tl:DiscreteTimeLine . 49 | 50 | :feature_timeline_map a tl:UniformSamplingWindowingMap ; 51 | tl:rangeTimeLine :feature_timeline ; 52 | tl:domainTimeLine :base_timeline ; 53 | tl:sampleRate "44100"^^xsd:int ; 54 | tl:windowLength "1024"^^xsd:int ; 55 | tl:hopSize "512"^^xsd:int . 56 | 57 | 58 | # ... and an interval, defined in terms of hops (the discrete steps of 59 | # the windowed timeline). 60 | 61 | :feature_interval a tl:Interval ; 62 | tl:onTimeLine :feature_timeline ; 63 | tl:beginsAt "0"^^xsd:int ; 64 | tl:duration "5634"^^xsd:int . 65 | 66 | 67 | # Then our feature is a signal that is on the interval we just 68 | # described. We associate it explicitly with the original audio 69 | # signal, although presumably we could leave the association implicit, 70 | # to be derived from the relationships between timelines, just as it 71 | # is for the sparse features above. 72 | 73 | :audio_signal af:signal_feature :feature1 . 74 | 75 | :feature_signal_type rdfs:subClassOf af:DetectionFunction ; 76 | dc:title "Detection Function from Simple Percussion Onset Detector" . 77 | 78 | :feature1 a :feature_signal_type ; 79 | mo:time :feature_interval ; 80 | af:dimensions "12 12345" ; 81 | af:value "0 0 0 0 0 0 0 1 2 3 1 24 236 123213 (etc)" . 82 | 83 | -------------------------------------------------------------------------------- /tests/test-rdf-writer/test-rdf-writer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . ../include.sh 4 | 5 | infile=$audiopath/3clicks8.wav 6 | tmpttl=$mypath/tmp_1_$$.ttl 7 | 8 | silentfile=$audiopath/20sec-silence.wav 9 | 10 | trap "rm -f $tmpttl" 0 11 | 12 | transformdir=$mypath/transforms 13 | 14 | for rdfarg in "" "--rdf-plain" ; do 15 | 16 | note="" 17 | [ -n "$rdfarg" ] && note=" with $rdfarg" 18 | 19 | rm -f "$tmpttl" 20 | 21 | $r -t $transformdir/onsets.n3 -w rdf $infile $rdfarg --rdf-one-file "$tmpttl" 2>/dev/null || \ 22 | fail "Fails to run with onsets transform and RDF writer$note" 23 | 24 | rapper -i turtle "$tmpttl" >/dev/null 2>&1 || \ 25 | fail "Fails to produce parseable RDF/TTL for onsets transform$note" 26 | 27 | rapper -i turtle -c "$tmpttl" 2>&1 | egrep -q 'Parsing returned [1-9][0-9]+ triples' || 28 | fail "RDF output contains no triples (?) for onsets transform$note" 29 | 30 | rm -f "$tmpttl" 31 | 32 | $r -t $transformdir/detectionfunction.n3 -w rdf $infile $rdfarg --rdf-one-file "$tmpttl" 2>/dev/null || \ 33 | fail "Fails to run with detectionfunction transform and RDF writer$note" 34 | 35 | rapper -i turtle "$tmpttl" >/dev/null 2>&1 || \ 36 | fail "Fails to produce parseable RDF/TTL for detectionfunction transform$note" 37 | 38 | rapper -i turtle -c "$tmpttl" 2>&1 | egrep -q 'Parsing returned [1-9][0-9]+ triples' || 39 | fail "RDF output contains no triples (?) for detectionfunction transform$note" 40 | 41 | rm -f "$tmpttl" 42 | 43 | $r -t $transformdir/onsets.n3 -t $transformdir/detectionfunction.n3 -w rdf $infile $rdfarg --rdf-one-file "$tmpttl" 2>/dev/null || \ 44 | fail "Fails to run with detectionfunction and onsets transforms together and RDF writer$note" 45 | 46 | rapper -i turtle "$tmpttl" >/dev/null 2>&1 || \ 47 | fail "Fails to produce parseable RDF/TTL for detectionfunction and onsets transforms together$note" 48 | 49 | rapper -i turtle -c "$tmpttl" 2>&1 | egrep -q 'Parsing returned [1-9][0-9]+ triples' || 50 | fail "RDF output contains no triples (?) for detectionfunction and onsets transforms together$note" 51 | 52 | # And the various structures emitted by the Vamp test plugin 53 | for output in instants curve-oss curve-fsr curve-fsr-timed curve-vsr grid-oss grid-fsr notes-regions; do 54 | 55 | $r -d "$testplug:$output" -w rdf --rdf-one-file "$tmpttl" --rdf-force "$silentfile" 2>/dev/null || \ 56 | fail "Failed to run for plugin $testplug with output $output" 57 | 58 | rapper -i turtle "$tmpttl" >/dev/null 2>&1 || \ 59 | fail "Fails to produce parseable RDF/TTL for test plugin output $output" 60 | 61 | rapper -i turtle -c "$tmpttl" 2>&1 | egrep -q 'Parsing returned [1-9][0-9]+ triples' || 62 | fail "RDF output contains no triples (?) for test plugin output $output" 63 | done 64 | done 65 | 66 | # Check the output encoding -- should be valid UTF-8 always 67 | 68 | for code in ucs-2 iso-8859-1; do 69 | $r -t $transformdir/onsets.n3 -w rdf --rdf-stdout $audiopath/id3v2-$code.mp3 2>/dev/null | iconv --from-code=utf-8 --to-code=utf-8 >/dev/null || 70 | fail "RDF/Turtle output from $code input is not valid utf-8 according to iconv" 71 | done 72 | 73 | exit 0 74 | -------------------------------------------------------------------------------- /runner/DefaultFeatureWriter.cpp: -------------------------------------------------------------------------------- 1 | /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 2 | 3 | /* 4 | Sonic Annotator 5 | A utility for batch feature extraction from audio files. 6 | Mark Levy, Chris Sutton and Chris Cannam, Queen Mary, University of London. 7 | Copyright 2007-2008 QMUL. 8 | 9 | This program is free software; you can redistribute it and/or 10 | modify it under the terms of the GNU General Public License as 11 | published by the Free Software Foundation; either version 2 of the 12 | License, or (at your option) any later version. See the file 13 | COPYING included with this distribution for more information. 14 | */ 15 | 16 | #include 17 | #include 18 | 19 | #include "DefaultFeatureWriter.h" 20 | 21 | using namespace std; 22 | 23 | namespace sv { 24 | 25 | string 26 | DefaultFeatureWriter::getDescription() const 27 | { 28 | return "Write features in a generic XML format, with or elements containing output name and some or all of timestamp, duration, values, and label."; 29 | } 30 | 31 | void DefaultFeatureWriter::write(QString, 32 | const Transform &, 33 | const Vamp::Plugin::OutputDescriptor& output, 34 | const Vamp::Plugin::FeatureList& featureList, 35 | std::string summaryType) 36 | { 37 | // generic XML output 38 | 39 | /* 40 | 41 | 42 | output.name 43 | feature.timestamp 44 | output.binName[0]:feature.value[0]... 45 | 46 | 47 | 48 | */ 49 | 50 | for (int i = 0; i < (int)featureList.size(); ++i) { 51 | 52 | if (summaryType == "") { 53 | std::cout << "" << std::endl; 54 | } else { 55 | std::cout << "" << std::endl; 56 | } 57 | std::cout << "\t" << output.name << "" << std::endl; 58 | if (featureList[i].hasTimestamp) { 59 | std::cout << "\t" << featureList[i].timestamp << "" << std::endl; 60 | } 61 | if (featureList[i].hasDuration) { 62 | std::cout << "\t" << featureList[i].duration << "" << std::endl; 63 | } 64 | if (featureList[i].values.size() > 0) 65 | { 66 | std::cout << "\t"; 67 | for (int j = 0; j < (int)featureList[i].values.size(); ++j) { 68 | if (j > 0) 69 | std::cout << " "; 70 | if (output.binNames.size() > 0) 71 | std::cout << output.binNames[j] << ":"; 72 | std::cout << featureList[i].values[j]; 73 | } 74 | std::cout << "" << std::endl; 75 | } 76 | if (featureList[i].label.length() > 0) 77 | std::cout << "\t" << std::endl; 78 | if (summaryType == "") { 79 | std::cout << "" << std::endl; 80 | } else { 81 | std::cout << "" << std::endl; 82 | } 83 | } 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /tests/test-csv-writer/test-csv-writer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . ../include.sh 4 | 5 | infile=$audiopath/20sec-silence.wav 6 | tmpcsv=$mypath/tmp_1_$$.csv 7 | 8 | trap "rm -f $tmpcsv" 0 9 | 10 | for output in notes-regions curve-vsr grid-oss; do 11 | 12 | flag="" 13 | 14 | $r -d "$testplug:$output" -w csv --csv-stdout "$infile" 2>/dev/null > "$tmpcsv" || \ 15 | fail "Failed to run for plugin $testplug with output $output and no additional flags" 16 | 17 | csvcompare "$tmpcsv" "$mypath/expected/$output-no-flags.csv" || \ 18 | faildiff "Output differs from expected for output $output and no additional flags" "$tmpcsv" "$mypath/expected/$output-no-flags.csv" 19 | 20 | flag=sample-timing 21 | 22 | $r -d "$testplug:$output" -w csv --csv-$flag --csv-stdout "$infile" 2>/dev/null > "$tmpcsv" || \ 23 | fail "Failed to run for plugin $testplug with output $output and $flag flag" 24 | 25 | csvcompare "$tmpcsv" "$mypath/expected/$output-$flag.csv" || \ 26 | faildiff "Output differs from expected for output $output and $flag flag" "$tmpcsv" "$mypath/expected/$output-$flag.csv" 27 | 28 | flag=fill-ends 29 | 30 | $r -d "$testplug:$output" -w csv --csv-$flag --csv-stdout "$infile" 2>/dev/null > "$tmpcsv" || \ 31 | fail "Failed to run for plugin $testplug with output $output and $flag flag" 32 | 33 | csvcompare "$tmpcsv" "$mypath/expected/$output-$flag.csv" || \ 34 | faildiff "Output differs from expected for output $output and $flag flag" "$tmpcsv" "$mypath/expected/$output-$flag.csv" 35 | 36 | flag=end-times 37 | 38 | $r -d "$testplug:$output" -w csv --csv-$flag --csv-stdout "$infile" 2>/dev/null > "$tmpcsv" || \ 39 | fail "Failed to run for plugin $testplug with output $output and $flag flag" 40 | 41 | csvcompare "$tmpcsv" "$mypath/expected/$output-$flag.csv" || \ 42 | faildiff "Output differs from expected for output $output and $flag flag" "$tmpcsv" "$mypath/expected/$output-$flag.csv" 43 | 44 | flag=separator 45 | 46 | $r -d "$testplug:$output" -w csv --csv-$flag '@' --csv-stdout "$infile" 2>/dev/null > "$tmpcsv" || \ 47 | fail "Failed to run for plugin $testplug with output $output and $flag flag" 48 | 49 | csvcompare "$tmpcsv" "$mypath/expected/$output-$flag.csv" || \ 50 | faildiff "Output differs from expected for output $output and $flag flag" "$tmpcsv" "$mypath/expected/$output-$flag.csv" 51 | 52 | flag=all 53 | 54 | $r -d "$testplug:$output" -w csv --csv-sample-timing --csv-fill-ends --csv-end-times --csv-separator '@' --csv-stdout "$infile" 2>/dev/null > "$tmpcsv" || \ 55 | fail "Failed to run for plugin $testplug with output $output and all flags" 56 | 57 | csvcompare "$tmpcsv" "$mypath/expected/$output-$flag.csv" || \ 58 | faildiff "Output differs from expected for output $output and all flags" "$tmpcsv" "$mypath/expected/$output-$flag.csv" 59 | 60 | done 61 | 62 | for output in grid-oss; do 63 | for digits in 0 6 2; do 64 | 65 | $r -d "$testplug:$output" -w csv --csv-stdout --csv-digits "$digits" "$infile" 2>/dev/null > "$tmpcsv" || \ 66 | fail "Failed to run for plugin $testplug with output $output and digits $digits" 67 | 68 | # no fuzz here 69 | cmp -s "$tmpcsv" "$mypath/expected/$output-$digits.csv" || \ 70 | faildiff "Output differs from expected for CSV writer with output $output and digits $digits" "$tmpcsv" "$mypath/expected/$output-$digits.csv" 71 | 72 | done 73 | done 74 | 75 | exit 0 76 | 77 | -------------------------------------------------------------------------------- /runner/JAMSFeatureWriter.h: -------------------------------------------------------------------------------- 1 | /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ 2 | 3 | /* 4 | Sonic Annotator 5 | A utility for batch feature extraction from audio files. 6 | 7 | Mark Levy, Chris Sutton and Chris Cannam, Queen Mary, University of London. 8 | Copyright 2007-2014 QMUL. 9 | 10 | This program is free software; you can redistribute it and/or 11 | modify it under the terms of the GNU General Public License as 12 | published by the Free Software Foundation; either version 2 of the 13 | License, or (at your option) any later version. See the file 14 | COPYING included with this distribution for more information. 15 | */ 16 | 17 | #ifndef JAMS_FEATURE_WRITER_H 18 | #define JAMS_FEATURE_WRITER_H 19 | 20 | #include "transform/FileFeatureWriter.h" 21 | 22 | #include "rdf/PluginRDFDescription.h" 23 | 24 | namespace sv { 25 | 26 | class JAMSFileWriter; 27 | 28 | class JAMSFeatureWriter : public FileFeatureWriter 29 | { 30 | public: 31 | JAMSFeatureWriter(); 32 | virtual ~JAMSFeatureWriter(); 33 | 34 | std::string getDescription() const; 35 | 36 | virtual ParameterList getSupportedParameters() const; 37 | virtual void setParameters(std::map ¶ms); 38 | 39 | virtual void setTrackMetadata(QString trackid, TrackMetadata metadata); 40 | 41 | virtual void setNofM(int, int); 42 | 43 | virtual void write(QString trackid, 44 | const Transform &transform, 45 | const Vamp::Plugin::OutputDescriptor &output, 46 | const Vamp::Plugin::FeatureList &features, 47 | std::string summaryType = ""); 48 | 49 | virtual void finish(); 50 | 51 | virtual QString getWriterTag() const { return "jams"; } 52 | 53 | private: 54 | enum Task { 55 | UnknownTask, 56 | BeatTask, 57 | OnsetTask, 58 | ChordTask, 59 | SegmentTask, 60 | KeyTask, 61 | NoteTask, 62 | MelodyTask, 63 | PitchTask, 64 | }; 65 | 66 | typedef std::map RDFDescriptionMap; // by plugin id 67 | RDFDescriptionMap m_rdfDescriptions; 68 | 69 | typedef QString TrackId; 70 | typedef std::pair DataId; 71 | 72 | typedef std::map TrackMetadataMap; 73 | TrackMetadataMap m_trackMetadata; 74 | 75 | typedef std::set TrackIds; 76 | typedef std::map StreamTrackMap; 77 | StreamTrackMap m_streamTracks; 78 | 79 | typedef std::set Tasks; 80 | typedef std::map StreamTaskMap; 81 | StreamTaskMap m_streamTasks; 82 | 83 | typedef std::set DataIds; 84 | typedef std::map StreamDataMap; 85 | StreamDataMap m_streamData; 86 | 87 | typedef std::map DataMap; 88 | DataMap m_data; 89 | 90 | typedef std::map TaskMap; 91 | TaskMap m_tasks; 92 | 93 | void loadRDFDescription(const Transform &); 94 | void identifyTask(const Transform &); 95 | 96 | QString getTaskKey(Task); 97 | 98 | QString writeTransformToObjectContents(const Transform &); 99 | 100 | std::string m_format; 101 | bool m_network; 102 | bool m_networkRetrieved; 103 | int m_n; 104 | int m_m; 105 | int m_digits; 106 | }; 107 | 108 | } 109 | 110 | #endif 111 | 112 | -------------------------------------------------------------------------------- /tests/test-audioformat/test-audioformat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | . ../include.sh 4 | 5 | inbase=$audiopath/3clicks 6 | tmpfile1=$mypath/tmp_1_$$ 7 | tmpfile2=$mypath/tmp_2_$$ 8 | 9 | trap "rm -f $tmpfile1 $tmpfile2" 0 10 | 11 | # Files with extensions 12 | 13 | for extension in wav ogg mp3 opus ; do 14 | 15 | transform=$mypath/transforms/percussiononsets.n3 16 | expected=$mypath/expected/percussiononsets-$extension.csv 17 | 18 | test -f $transform || \ 19 | fail "Internal error: no transforms file" 20 | 21 | test -f $expected || \ 22 | fail "Internal error: no expected output file for extension $extension" 23 | 24 | infile=$inbase.$extension 25 | if [ "$extension" = "wav" ]; then infile=${inbase}8.$extension; fi 26 | 27 | test -f $infile || \ 28 | fail "Internal error: no input audio file for extension $extension" 29 | 30 | $r -t $transform -w csv --csv-stdout $infile > $tmpfile2 2>/dev/null || \ 31 | fail "Fails to run transform $transform against audio file $infile" 32 | 33 | csvcompare $tmpfile2 $expected || \ 34 | faildiff "Output mismatch for transform $transform for format $extension with audio file $infile" $tmpfile2 $expected 35 | done 36 | 37 | # The same files, but without extensions: do we recognise them correctly? 38 | 39 | for extension in wav ogg mp3 opus ; do 40 | 41 | transform=$mypath/transforms/percussiononsets.n3 42 | expected=$mypath/expected/percussiononsets-$extension.csv 43 | 44 | infile=$inbase.$extension 45 | if [ "$extension" = "wav" ]; then infile=${inbase}8.$extension; fi 46 | 47 | cp $infile mystery 48 | 49 | $r -t $transform -w csv --csv-stdout mystery > $tmpfile1 2>/dev/null || \ 50 | fail "Fails to run transform $transform against audio file $infile when renamed without an extension" 51 | 52 | cat $tmpfile1 | sed 's,mystery,'"$infile"',' > $tmpfile2 53 | 54 | csvcompare $tmpfile2 $expected || \ 55 | faildiff "Output mismatch for transform $transform for format $extension with audio file $infile when renamed without an extension" $tmpfile2 $expected 56 | done 57 | 58 | # Check the normalise flag 59 | 60 | $r -d $amplplug -w csv --csv-stdout ${inbase}8quiet.wav 2>/dev/null | head > $tmpfile1 || \ 61 | fail "Fails to run default transform for plugin $amplplug against audio file ${inbase}8quiet.wav" 62 | csvcompare $tmpfile1 $mypath/expected/norm-off.csv || \ 63 | faildiff "Output mismatch for default transform for plugin $amplplug against audio file ${inbase}8quiet.wav without normalisation" $tmpfile1 $mypath/expected/norm-off.csv 64 | 65 | $r -d $amplplug -n -w csv --csv-stdout ${inbase}8quiet.wav 2>/dev/null | head > $tmpfile1 || \ 66 | fail "Fails to run default transform for plugin $amplplug against audio file ${inbase}8quiet.wav with normalisation" 67 | csvcompare $tmpfile1 $mypath/expected/norm-on.csv || \ 68 | faildiff "Output mismatch for default transform for plugin $amplplug against audio file ${inbase}8quiet.wav with normalisation" $tmpfile1 $mypath/expected/norm-on.csv 69 | 70 | $r -d $amplplug --normalise -w csv --csv-stdout ${inbase}8quiet.wav 2>/dev/null | head > $tmpfile1 || \ 71 | fail "Fails to run default transform for plugin $amplplug against audio file ${inbase}8quiet.wav with normalisation" 72 | csvcompare $tmpfile1 $mypath/expected/norm-on.csv || \ 73 | faildiff "Output mismatch for default transform for plugin $amplplug against audio file ${inbase}8quiet.wav with normalisation" $tmpfile1 $mypath/expected/norm-on.csv 74 | 75 | exit 0 76 | -------------------------------------------------------------------------------- /tests/include.sh: -------------------------------------------------------------------------------- 1 | 2 | set -e 3 | 4 | mypath=$(dirname $0) 5 | 6 | case "$(pwd)/$mypath" in 7 | *" "*) 8 | echo 1>&2 9 | echo "ERROR: Test scripts do not handle paths containing spaces (yes, I know)" 1>&2 10 | echo "(Path is: \"$(pwd)/$mypath\")" 1>&2 11 | exit 1;; 12 | *) 13 | ;; 14 | esac 15 | 16 | testdir=$mypath/.. 17 | r=$testdir/../build/sonic-annotator 18 | 19 | version=$(perl -p -e 's/^[^"]*"([^"]*)".*$/$1/' $testdir/../build/version.h | sed 's/-//g') 20 | nextversion=$version.1 21 | 22 | audiopath=$testdir/audio 23 | 24 | percplug=vamp:vamp-example-plugins:percussiononsets 25 | amplplug=vamp:vamp-example-plugins:amplitudefollower 26 | testplug=vamp:vamp-test-plugin:vamp-test-plugin 27 | 28 | fail() { 29 | echo "Test failed: $1" 30 | exit 1 31 | } 32 | 33 | csvcompare() { 34 | # permit some fuzz in final few digits 35 | a="$1" 36 | b="$2" 37 | perl -p -e 's/(\d+\.\d{6})\d+/$1/g' "$a" > "${a}__" 38 | perl -p -e 's/(\d+\.\d{6})\d+/$1/g' "$b" > "${b}__" 39 | cmp -s "${a}__" "${b}__" 40 | rv=$? 41 | rm "${a}__" "${b}__" 42 | return $rv 43 | } 44 | 45 | csvcompare_ignorefirst() { 46 | # a bit like the above, but ignoring first column (and without temp files) 47 | out=`cat "$1" "$2" | cut -d, -f2- | perl -p -e 's/(\d+\.\d{6})\d+/$1/' | sort | uniq -c | grep -v ' 2 '` 48 | return `[ -z "$out" ]` 49 | } 50 | 51 | midicompare() { 52 | a="$1" 53 | b="$2" 54 | od -c "$a" > "${a}__" 55 | od -c "$b" > "${b}__" 56 | cmp -s "${a}__" "${b}__" 57 | rv=$? 58 | rm "${a}__" "${b}__" 59 | return $rv 60 | } 61 | 62 | jsoncompare() { 63 | # The Sonic Annotator version number appears in the JAMS output -- 64 | # filter that out, and also reformat to ignore whitespace differences 65 | a="$1" 66 | b="$2" 67 | cat "$a" | sed 's/Sonic Annotator v[0-9a-z.]*/Sonic Annotator vXXX/' | json_reformat > "${a}__" 68 | cat "$b" | sed 's/Sonic Annotator v[0-9a-z.]*/Sonic Annotator vXXX/' | json_reformat > "${b}__" 69 | cmp -s "${a}__" "${b}__" 70 | rv=$? 71 | rm "${a}__" "${b}__" 72 | return $rv 73 | } 74 | 75 | SDIFF_WIDTH=140 76 | 77 | faildiff() { 78 | echo "Test failed: $1" 79 | if [ -n "$2" -a -n "$3" ]; then 80 | echo "Output follows:" 81 | echo "--" 82 | cat "$2" 83 | echo "--" 84 | echo "Expected output follows ($3):" 85 | echo "--" 86 | cat "$3" 87 | echo "--" 88 | echo "Diff (output on left, expected on right):" 89 | echo "--" 90 | sdiff -w${SDIFF_WIDTH} "$2" "$3" 91 | echo "--" 92 | fi 93 | exit 1 94 | } 95 | 96 | faildiff_od() { 97 | echo "Test failed: $1" 98 | if [ -n "$2" -a -n "$3" ]; then 99 | echo "Output follows:" 100 | echo "--" 101 | od -c "$2" 102 | echo "--" 103 | echo "Expected output follows ($3):" 104 | echo "--" 105 | od -c "$3" 106 | echo "--" 107 | echo "Diff:" 108 | echo "--" 109 | od -w8 -c "$3" > "${3}__" 110 | od -w8 -c "$2" | sdiff -w${SDIFF_WIDTH} - "${3}__" 111 | rm "${3}__" 112 | echo "--" 113 | fi 114 | exit 1 115 | } 116 | 117 | failshow() { 118 | echo "Test failed: $1" 119 | if [ -n "$2" ]; then 120 | echo "Output follows:" 121 | echo "--" 122 | cat $2 123 | echo "--" 124 | fi 125 | exit 1 126 | } 127 | 128 | check_json() { 129 | test -f $1 || \ 130 | fail "Fails to write output to expected location $1 for $2" 131 | cat $1 | json_verify -q || \ 132 | failshow "Writes invalid JSON to location $1 for $2" $1 133 | rm -f $1 134 | } 135 | 136 | 137 | --------------------------------------------------------------------------------