Mercurial > hg > mirex2013
changeset 63:6f2e82e453da
Live mode
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/multiple_f0_estimation/silvet-live/README.txt Wed Aug 12 17:38:52 2015 +0100 @@ -0,0 +1,75 @@ + +# MIREX 2015 submission +# +# Multiple Fundamental Frequency Estimation & Tracking +# Chris Cannam, c.cannam@qmul.ac.uk + + This submission uses the Silvet note estimation Vamp plugin in "live + mode", running in Sonic Annotator. + + Live mode is much, much faster to run than the default Silvet mode, + but produces far worse results! + + Four scripts are provided: + + * doFramewiseF0.sh runs the plugin in "unknown instrument" mode and + produces framewise output. This should be used for the framewise + multi-F0 task on the general multi-instrument dataset. + + * doFramewiseF0-piano.sh runs the plugin in "piano" mode and + produces framewise output. This should be used for the framewise + multi-F0 task, if being evaluated on a dedicated piano-only + dataset. + + * doNoteTracking.sh runs the plugin in "unknown instrument" mode + (the default for this plugin) and produces note-tracked + output. This should be used for the note tracking task on the + general multi-instrument dataset. + + * doNoteTracking-piano.sh runs the plugin in "piano" mode and + produces note-tracked output. This should be used for the note + tracking task, if being evaluated on a dedicated piano-only + dataset. + + +# Architecture + +- Linux 64-bit + + +# Dependencies + +- Sonic Annotator v1.1 + http://code.soundsoftware.ac.uk/projects/sonic-annotator/files + +- GNU libc 2.15 or newer, GNU libstdc++ 3.4.15 or newer + +- Typical Unix/GNU shell commands + + +# How to run + +In a terminal window run: + +./doFramewiseF0.sh /path/to/audiofile.wav /path/to/outputfile.txt + +(for framewise multi-F0 on multi-instrument datasets) + +or + +./doFramewiseF0-piano.sh /path/to/audiofile.wav /path/to/outputfile.txt + +(for framewise multi-F0 on piano-only datasets) + +or + +./doNoteTracking.sh /path/to/audiofile.wav /path/to/outputfile.txt + +(for note tracking on multi-instrument datasets) + +or + +./doNoteTracking-piano.sh /path/to/audiofile.wav /path/to/outputfile.txt + +(for note tracking on piano-only datasets) +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/multiple_f0_estimation/silvet-live/doFramewiseF0-piano.sh Wed Aug 12 17:38:52 2015 +0100 @@ -0,0 +1,46 @@ +#!/bin/sh + +mydir=`dirname "$0"` +infile="$1" +outfile="$2" + +if [ t"$infile" = "t" ] || [ t"$outfile" = "t" ]; then + echo "Usage: $0 infile.wav outfile.txt" + exit 2 +fi + +mkdir -p "$mydir"/out || exit 1 + +inbase=`basename "$infile"` +inbase=${inbase%.*} + +echo "Processing input WAV file $infile, writing results to $outfile..." 1>&2 + +# Run the Silvet plugin. +# +# 1. Run the plugin. This will produce an output file +# out/${inbase}.csv + +VAMP_PATH="$mydir" sonic-annotator \ + -t "$mydir"/silvet-for-framewise-piano.ttl \ + -w csv \ + --csv-separator ' ' \ + --csv-one-file "$mydir/out/$inbase.csv" \ + --csv-omit-filename \ + --csv-force \ + "$infile" || exit 1 + +# 2. Check the output file exists + +poutfile="$mydir/out/$inbase.csv" +if [ ! -f "$poutfile" ]; then + echo "output file $poutfile not found! bailing out"; exit 1 +fi + +# 3. Convert the format to framewise data + +ppoutfile="$mydir/out/$inbase.csv.sorted" +cat "$poutfile" | sort -n > "$ppoutfile" +./frames.py "$ppoutfile" > "$outfile" + +echo "Done, output is in $outfile"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/multiple_f0_estimation/silvet-live/doFramewiseF0.sh Wed Aug 12 17:38:52 2015 +0100 @@ -0,0 +1,46 @@ +#!/bin/sh + +mydir=`dirname "$0"` +infile="$1" +outfile="$2" + +if [ t"$infile" = "t" ] || [ t"$outfile" = "t" ]; then + echo "Usage: $0 infile.wav outfile.txt" + exit 2 +fi + +mkdir -p "$mydir"/out || exit 1 + +inbase=`basename "$infile"` +inbase=${inbase%.*} + +echo "Processing input WAV file $infile, writing results to $outfile..." 1>&2 + +# Run the Silvet plugin. +# +# 1. Run the plugin. This will produce an output file +# out/${inbase}.csv + +VAMP_PATH="$mydir" sonic-annotator \ + -t "$mydir"/silvet-for-framewise.ttl \ + -w csv \ + --csv-separator ' ' \ + --csv-one-file "$mydir/out/$inbase.csv" \ + --csv-omit-filename \ + --csv-force \ + "$infile" || exit 1 + +# 2. Check the output file exists + +poutfile="$mydir/out/$inbase.csv" +if [ ! -f "$poutfile" ]; then + echo "output file $poutfile not found! bailing out"; exit 1 +fi + +# 3. Convert the format to framewise data + +ppoutfile="$mydir/out/$inbase.csv.sorted" +cat "$poutfile" | sort -n > "$ppoutfile" +./frames.py "$ppoutfile" > "$outfile" + +echo "Done, output is in $outfile"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/multiple_f0_estimation/silvet-live/doNoteTracking-piano.sh Wed Aug 12 17:38:52 2015 +0100 @@ -0,0 +1,50 @@ +#!/bin/sh + +mydir=`dirname "$0"` +infile="$1" +outfile="$2" + +if [ t"$infile" = "t" ] || [ t"$outfile" = "t" ]; then + echo "Usage: $0 infile.wav outfile.txt" + exit 2 +fi + +mkdir -p "$mydir"/out || exit 1 + +inbase=`basename "$infile"` +inbase=${inbase%.*} + +echo "Processing input WAV file $infile, writing results to $outfile..." 1>&2 + +# Run the Silvet plugin. +# +# 1. Run the plugin. This will produce an output file +# out/${inbase}.csv + +VAMP_PATH="$mydir" sonic-annotator \ + -t "$mydir"/silvet-piano.ttl \ + -w csv \ + --csv-separator ' ' \ + --csv-one-file "$mydir/out/$inbase.csv" \ + --csv-omit-filename \ + --csv-force \ + "$infile" || exit 1 + +# 2. Check the output file exists + +poutfile="out/${inbase}.csv" +if [ ! -f "$poutfile" ]; then + echo "output file $poutfile not found! bailing out"; exit 1 +fi + +# 3. Convert the format. Sonic Annotator produced +# +# starttime duration freq note label +# +# while we want +# +# starttime endtime freq + +cat "$poutfile" | awk '{ print $1, $1+$2, $3 }' > "$outfile" + +echo "Done, output is in $outfile"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/multiple_f0_estimation/silvet-live/doNoteTracking.sh Wed Aug 12 17:38:52 2015 +0100 @@ -0,0 +1,50 @@ +#!/bin/sh + +mydir=`dirname "$0"` +infile="$1" +outfile="$2" + +if [ t"$infile" = "t" ] || [ t"$outfile" = "t" ]; then + echo "Usage: $0 infile.wav outfile.txt" + exit 2 +fi + +mkdir -p "$mydir"/out || exit 1 + +inbase=`basename "$infile"` +inbase=${inbase%.*} + +echo "Processing input WAV file $infile, writing results to $outfile..." 1>&2 + +# Run the Silvet plugin. +# +# 1. Run the plugin. This will produce an output file +# out/${inbase}.csv + +VAMP_PATH="$mydir" sonic-annotator \ + -t "$mydir"/silvet.ttl \ + -w csv \ + --csv-separator ' ' \ + --csv-one-file "$mydir/out/$inbase.csv" \ + --csv-omit-filename \ + --csv-force \ + "$infile" || exit 1 + +# 2. Check the output file exists + +poutfile="$mydir/out/$inbase.csv" +if [ ! -f "$poutfile" ]; then + echo "output file $poutfile not found! bailing out"; exit 1 +fi + +# 3. Convert the format. Sonic Annotator produced +# +# starttime duration freq note label +# +# while we want +# +# starttime endtime freq + +cat "$poutfile" | awk '{ print $1, $1+$2, $3 }' > "$outfile" + +echo "Done, output is in $outfile"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/multiple_f0_estimation/silvet-live/frames.py Wed Aug 12 17:38:52 2015 +0100 @@ -0,0 +1,37 @@ +#!/usr/bin/env python + +import sys + +if __name__ == '__main__': + + nargs = len(sys.argv) + if nargs != 2: + print("\nUsage: " + sys.argv[0] + " file.txt") + exit(1) + + fname = sys.argv[1] + + f = open(fname, 'r') + + data = [ line.split(' ') for line in f ]; + ms = 0 + extant = {} + ix = 0 + + while ix < len(data): + + sec = ms / 1000.0 + + while ix < len(data) and sec >= float(data[ix][0]): + time, freq, vely = data[ix][:3] + if vely == "0": + del extant[freq] + else: + extant[freq] = vely + ix = ix + 1 + + print("\t".join([str(sec)] + list(extant.keys()))) + + ms = ms + 10 + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/multiple_f0_estimation/silvet-live/silvet-for-framewise-piano.ttl Wed Aug 12 17:38:52 2015 +0100 @@ -0,0 +1,25 @@ +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . +@prefix vamp: <http://purl.org/ontology/vamp/> . +@prefix : <#> . + +:transform a vamp:Transform ; + vamp:plugin <http://vamp-plugins.org/rdf/plugins/silvet#silvet> ; + vamp:plugin_version 3 ; + vamp:step_size "1024"^^xsd:int ; + vamp:block_size "1024"^^xsd:int ; + vamp:parameter_binding [ + vamp:parameter [ vamp:identifier "finetune" ] ; + vamp:value "0"^^xsd:float ; + ] ; + vamp:parameter_binding [ + vamp:parameter [ vamp:identifier "instrument" ] ; + vamp:value "1"^^xsd:float ; + ] ; + vamp:parameter_binding [ + vamp:parameter [ vamp:identifier "mode" ] ; + vamp:value "0"^^xsd:float ; + ] ; + vamp:output [ + vamp:identifier "onoffsets" ; + ] ; + .
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/multiple_f0_estimation/silvet-live/silvet-for-framewise.ttl Wed Aug 12 17:38:52 2015 +0100 @@ -0,0 +1,25 @@ +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . +@prefix vamp: <http://purl.org/ontology/vamp/> . +@prefix : <#> . + +:transform a vamp:Transform ; + vamp:plugin <http://vamp-plugins.org/rdf/plugins/silvet#silvet> ; + vamp:plugin_version 3 ; + vamp:step_size "1024"^^xsd:int ; + vamp:block_size "1024"^^xsd:int ; + vamp:parameter_binding [ + vamp:parameter [ vamp:identifier "finetune" ] ; + vamp:value "0"^^xsd:float ; + ] ; + vamp:parameter_binding [ + vamp:parameter [ vamp:identifier "instrument" ] ; + vamp:value "0"^^xsd:float ; + ] ; + vamp:parameter_binding [ + vamp:parameter [ vamp:identifier "mode" ] ; + vamp:value "0"^^xsd:float ; + ] ; + vamp:output [ + vamp:identifier "onoffsets" ; + ] ; + .
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/multiple_f0_estimation/silvet-live/silvet-piano.ttl Wed Aug 12 17:38:52 2015 +0100 @@ -0,0 +1,22 @@ +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . +@prefix vamp: <http://purl.org/ontology/vamp/> . +@prefix : <#> . + +:transform a vamp:Transform ; + vamp:plugin <http://vamp-plugins.org/rdf/plugins/silvet#silvet> ; + vamp:plugin_version 3 ; + vamp:step_size "1024"^^xsd:int ; + vamp:block_size "1024"^^xsd:int ; + vamp:parameter_binding [ + vamp:parameter [ vamp:identifier "finetune" ] ; + vamp:value "0"^^xsd:float ; + ] ; + vamp:parameter_binding [ + vamp:parameter [ vamp:identifier "instrument" ] ; + vamp:value "1"^^xsd:float ; + ] ; + vamp:parameter_binding [ + vamp:parameter [ vamp:identifier "mode" ] ; + vamp:value "0"^^xsd:float ; + ] ; + .
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/multiple_f0_estimation/silvet-live/silvet.cat Wed Aug 12 17:38:52 2015 +0100 @@ -0,0 +1,1 @@ +vamp:silvet:silvet::Notes
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/multiple_f0_estimation/silvet-live/silvet.n3 Wed Aug 12 17:38:52 2015 +0100 @@ -0,0 +1,170 @@ +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . +@prefix vamp: <http://purl.org/ontology/vamp/> . +@prefix plugbase: <http://vamp-plugins.org/rdf/plugins/silvet#> . +@prefix owl: <http://www.w3.org/2002/07/owl#> . +@prefix dc: <http://purl.org/dc/elements/1.1/> . +@prefix af: <http://purl.org/ontology/af/> . +@prefix foaf: <http://xmlns.com/foaf/0.1/> . +@prefix doap: <http://usefulinc.com/ns/doap#> . +@prefix cc: <http://web.resource.org/cc/> . +@prefix : <#> . + + +## Properties of this document + +<> a vamp:PluginDescription ; + foaf:maker <http://vamp-plugins.org/rdf/template-generator> ; + foaf:primaryTopic <http://vamp-plugins.org/rdf/plugins/silvet> . + + +## Maker of the whole plugin library + +:library_maker + foaf:name "Queen Mary, University of London" ; + foaf:logo <http://vamp-plugins.org/rdf/plugins/makers/qm.png> ; + foaf:page <http://c4dm.eecs.qmul.ac.uk/> + . + + +## Properties of the plugin library, and references to the plugins it contains + +plugbase:library a vamp:PluginLibrary ; + vamp:identifier "silvet" ; + foaf:maker :library_maker ; + vamp:available_plugin plugbase:silvet ; + dc:title "Silvet Note Transcription" ; # Place library name here and uncomment + dc:description """Silvet, or Shift-Invariant Latent Variable Transcription, is a Vamp plugin for polyphonic music transcription (from audio to note times and pitches).""" ; + foaf:page <http://code.soundsoftware.ac.uk/projects/silvet> ; + doap:download-page <http://code.soundsoftware.ac.uk/projects/silvet/files> ; + . + + +## Properties of the Silvet Note Transcription plugin + +plugbase:silvet a vamp:Plugin ; + dc:title "Silvet Note Transcription" ; + vamp:name "Silvet Note Transcription" ; + dc:description """Estimate the note onsets, pitches, and durations that make up a music recording.""" ; + foaf:maker :library_maker ; + dc:rights """Method by Emmanouil Benetos and Simon Dixon; plugin by Chris Cannam and Emmanouil Benetos. GPL licence.""" ; +# cc:license <Place plugin license URI here and uncomment> ; + vamp:identifier "silvet" ; + vamp:vamp_API_version vamp:api_version_2 ; + owl:versionInfo "3" ; + vamp:input_domain vamp:TimeDomain ; + vamp:parameter plugbase:silvet_param_mode ; + vamp:parameter plugbase:silvet_param_instrument ; + vamp:parameter plugbase:silvet_param_finetune ; + + vamp:output plugbase:silvet_output_notes ; + vamp:output plugbase:silvet_output_onsets ; + vamp:output plugbase:silvet_output_timefreq ; + vamp:output plugbase:silvet_output_pitchactivation ; + vamp:output plugbase:silvet_output_chroma ; + vamp:output plugbase:silvet_output_templates ; + . + +plugbase:silvet_param_mode a vamp:QuantizedParameter ; + vamp:identifier "mode" ; + dc:title "Processing mode" ; + dc:format "" ; + vamp:min_value 0 ; + vamp:max_value 1 ; + vamp:unit "" ; + vamp:quantize_step 1 ; + vamp:default_value 1 ; + vamp:value_names ( "Live (faster and lower latency)" "Intensive (higher quality)"); + . +plugbase:silvet_param_instrument a vamp:QuantizedParameter ; + vamp:identifier "instrument" ; + dc:title "Instrument" ; + dc:format "" ; + vamp:min_value 0 ; + vamp:max_value 13 ; + vamp:unit "" ; + vamp:quantize_step 1 ; + vamp:default_value 0 ; + vamp:value_names ( "Multiple or unknown instruments" "Piano" "Guitar" "Violin" "Viola" "Cello" "Horn" "Flute" "Oboe" "Clarinet" "Tenor Sax" "Bassoon" "String quartet" "Wind ensemble"); + . +plugbase:silvet_param_finetune a vamp:QuantizedParameter ; + vamp:identifier "finetune" ; + dc:title "Return fine pitch estimates" ; + dc:format "" ; + vamp:min_value 0 ; + vamp:max_value 1 ; + vamp:unit "" ; + vamp:quantize_step 1 ; + vamp:default_value 0 ; + vamp:value_names (); + . +plugbase:silvet_output_notes a vamp:SparseOutput ; + vamp:identifier "notes" ; + dc:title "Note transcription" ; + dc:description """Overall note transcription. Each note has time, duration, estimated fundamental frequency, and a synthetic MIDI velocity (1-127) estimated from the strength of the pitch in the mixture.""" ; + vamp:fixed_bin_count "true" ; + vamp:unit "Hz" ; + vamp:bin_count 2 ; + vamp:bin_names ( "Frequency" "Velocity"); + vamp:sample_type vamp:VariableSampleRate ; + vamp:sample_rate 711 ; + vamp:computes_event_type af:Note ; + . +plugbase:silvet_output_onsets a vamp:SparseOutput ; + vamp:identifier "onsets" ; + dc:title "Note onsets" ; + dc:description """Note onsets, without durations. These can be calculated sooner than complete notes, because it isn't necessary to wait for a note to finish before returning its feature. Each event has time, estimated fundamental frequency in Hz, and a synthetic MIDI velocity (1-127) estimated from the strength of the pitch in the mixture.""" ; + vamp:fixed_bin_count "true" ; + vamp:unit "Hz" ; + vamp:bin_count 2 ; + vamp:bin_names ( "Frequency" "Velocity"); + vamp:sample_type vamp:VariableSampleRate ; + vamp:sample_rate 711 ; + vamp:computes_event_type af:Onset ; + . +plugbase:silvet_output_onoffsets a vamp:SparseOutput ; + vamp:identifier "onoffsets" ; + dc:title "Note onsets and offsets" ; + dc:description """Note onsets and offsets as separate events. Each onset event has time, estimated fundamental frequency in Hz, and a synthetic MIDI velocity (1-127) estimated from the strength of the pitch in the mixture. Offsets are represented in the same way but with a velocity of 0.""" ; + vamp:fixed_bin_count "true" ; + vamp:unit "Hz" ; + vamp:bin_count 2 ; + vamp:bin_names ( "Frequency" "Velocity"); + vamp:sample_type vamp:VariableSampleRate ; + vamp:sample_rate 711 ; + . +plugbase:silvet_output_timefreq a vamp:DenseOutput ; + vamp:identifier "timefreq" ; + dc:title "Time-frequency distribution" ; + dc:description """Filtered constant-Q time-frequency distribution as used as input to the expectation-maximisation algorithm.""" ; + vamp:fixed_bin_count "true" ; + vamp:unit "" ; + vamp:bin_count 545 ; + vamp:computes_signal_type af:Spectrogram ; + . +plugbase:silvet_output_pitchactivation a vamp:DenseOutput ; + vamp:identifier "pitchactivation" ; + dc:title "Pitch activation distribution" ; + dc:description """Pitch activation distribution resulting from expectation-maximisation algorithm, prior to note extraction.""" ; + vamp:fixed_bin_count "true" ; + vamp:unit "" ; + vamp:bin_count 88 ; + vamp:computes_signal_type af:Spectrogram ; + . +plugbase:silvet_output_chroma a vamp:DenseOutput ; + vamp:identifier "chroma" ; + dc:title "Pitch chroma distribution" ; + dc:description """Pitch chroma distribution formed by wrapping the un-thresholded pitch activation distribution into a single octave of semitone bins.""" ; + vamp:fixed_bin_count "true" ; + vamp:unit "" ; + vamp:bin_count 12 ; + vamp:computes_signal_type af:Chromagram ; + . +plugbase:silvet_output_templates a vamp:DenseOutput ; + vamp:identifier "templates" ; + dc:title "Templates" ; + dc:description """Constant-Q spectral templates for the selected instrument pack.""" ; + vamp:fixed_bin_count "true" ; + vamp:unit "" ; + vamp:bin_count 545 ; + .
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/multiple_f0_estimation/silvet-live/silvet.ttl Wed Aug 12 17:38:52 2015 +0100 @@ -0,0 +1,22 @@ +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . +@prefix vamp: <http://purl.org/ontology/vamp/> . +@prefix : <#> . + +:transform a vamp:Transform ; + vamp:plugin <http://vamp-plugins.org/rdf/plugins/silvet#silvet> ; + vamp:plugin_version 3 ; + vamp:step_size "1024"^^xsd:int ; + vamp:block_size "1024"^^xsd:int ; + vamp:parameter_binding [ + vamp:parameter [ vamp:identifier "finetune" ] ; + vamp:value "0"^^xsd:float ; + ] ; + vamp:parameter_binding [ + vamp:parameter [ vamp:identifier "instrument" ] ; + vamp:value "0"^^xsd:float ; + ] ; + vamp:parameter_binding [ + vamp:parameter [ vamp:identifier "mode" ] ; + vamp:value "0"^^xsd:float ; + ] ; + .