Skip to content

Instantly share code, notes, and snippets.

@Hadryan
Forked from tcolgate/aubio.txt
Created December 16, 2018 20:12
Show Gist options
  • Save Hadryan/b6792c9cfe9ac9e7c05d881fc1508b72 to your computer and use it in GitHub Desktop.
Save Hadryan/b6792c9cfe9ac9e7c05d881fc1508b72 to your computer and use it in GitHub Desktop.
Example of using sonic-annotator to run multiple filters
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix vamp: <http://purl.org/ontology/vamp/> .
@prefix : <#> .
:transform_plugin a vamp:Plugin ;
vamp:identifier "aubiotempo" .
:transform_library a vamp:PluginLibrary ;
vamp:identifier "vamp-aubio" ;
vamp:available_plugin :transform_plugin .
:transform a vamp:Transform ;
vamp:plugin :transform_plugin ;
vamp:step_size "512"^^xsd:int ;
vamp:block_size "1024"^^xsd:int ;
vamp:parameter_binding [
vamp:parameter [ vamp:identifier "onsettype" ] ;
vamp:value "3"^^xsd:float ;
] ;
vamp:parameter_binding [
vamp:parameter [ vamp:identifier "peakpickthreshold" ] ;
vamp:value "0.3"^^xsd:float ;
] ;
vamp:parameter_binding [
vamp:parameter [ vamp:identifier "silencethreshold" ] ;
vamp:value "-70"^^xsd:float ;
] ;
vamp:output [ vamp:identifier "tempo" ] .
# This was picked up from a quick scan of
# http://www.omras2.org/sonicannotator
# There are a few different ways to do this, but this seemed the easiest and
# most versatile
# It turns out that it is a bad idea to run sonic-annotator plugins with thier
# default settings, as those can change. instead, for each plugin, you can
# generate a tempalte of the settings, and get documentation. You can then use
# these template to run one or more plugins. To generate the "skeleton" you use
# -s as f in...
sonic-annotator -s vamp:mvamp:marsyas_ibt:beat_times > ibt.txt
sonic-annotator -s vamp:vamp-aubio:aubiotempo:tempo > aubio.txt
sonic-annotator -s vamp:libqm-vamp-plugins:qm-tempotracker:tempo > qm.txt
# These actually generate "transform" files that can be used to describe
# more complex process, but the ones above just run the one transformer each
# To run them together you use -t, and you can pass it more than once.
sonic-annotator -t aubio.txt -t qm.txt -t ibt.txt -w csv --csv-stdout helloworld.wav
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment