Mercurial > hg > mirex2013
changeset 16:e8d3c68863f9
Some work on Chordino task
author | Chris Cannam |
---|---|
date | Mon, 02 Sep 2013 16:28:48 +0100 |
parents | bd1482e8c459 |
children | de76a12dcec4 |
files | audio_chord_estimation/chordino/README.txt audio_chord_estimation/chordino/chordino.sh audio_chord_estimation/chordino/chordino.ttl audio_chord_estimation/chordino/nnls-chroma.n3 audio_chord_estimation/chordino/nnls-chroma.so |
diffstat | 5 files changed, 476 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/audio_chord_estimation/chordino/README.txt Mon Sep 02 15:56:43 2013 +0100 +++ b/audio_chord_estimation/chordino/README.txt Mon Sep 02 16:28:48 2013 +0100 @@ -0,0 +1,10 @@ + +this script is UNFINISHED! + +* Harte format output by Chordino does not superficially seem to match + that in the submission guidelines + +* Command line calling format in the guidelines differs from most of + the other categories (because it explicitly allows for training + phase) +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audio_chord_estimation/chordino/chordino.sh Mon Sep 02 16:28:48 2013 +0100 @@ -0,0 +1,33 @@ + +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 + +echo "Processing input WAV file $infile, writing results to $outfile..." 1>&2 + +# Convert +# +# ;time;"label" +# +# to +# +# starttime<TAB>endtime<TAB>label +# +# NB this omits the final chord! In practice the final one will almost +# certainly be an N rather than a chord but this will surely be a +# problem sometimes. What to do about it? + +VAMP_PATH="$mydir" sonic-annotator \ + -t "$mydir"/chordino.ttl \ + -w csv --csv-stdout --csv-separator ";" \ + "$infile" \ + | perl -e 'while (<>) { chomp; @a = split /;/; if (defined $p) { print "$p\t$a[1]\t$pl\n"; }; $p = $a[1]; $pl = $a[2]; $pl =~ s/"//g; }' \ + > "$outfile" +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audio_chord_estimation/chordino/chordino.ttl Mon Sep 02 16:28:48 2013 +0100 @@ -0,0 +1,37 @@ +@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/nnls-chroma#chordino> ; + vamp:step_size "2048"^^xsd:int ; + vamp:block_size "16384"^^xsd:int ; + vamp:parameter_binding [ + vamp:parameter [ vamp:identifier "boostn" ] ; + vamp:value "0.1"^^xsd:float ; + ] ; + vamp:parameter_binding [ + vamp:parameter [ vamp:identifier "rollon" ] ; + vamp:value "0"^^xsd:float ; + ] ; + vamp:parameter_binding [ + vamp:parameter [ vamp:identifier "spectralshape" ] ; + vamp:value "0"^^xsd:float ; + ] ; + vamp:parameter_binding [ + vamp:parameter [ vamp:identifier "tuningmode" ] ; + vamp:value "0"^^xsd:float ; + ] ; + vamp:parameter_binding [ + vamp:parameter [ vamp:identifier "useNNLS" ] ; + vamp:value "1"^^xsd:float ; + ] ; + vamp:parameter_binding [ + vamp:parameter [ vamp:identifier "usehartesyntax" ] ; + vamp:value "1"^^xsd:float ; + ] ; + vamp:parameter_binding [ + vamp:parameter [ vamp:identifier "whitening" ] ; + vamp:value "1"^^xsd:float ; + ] ; + vamp:output <http://vamp-plugins.org/rdf/plugins/nnls-chroma#chordino_output_simplechord> .
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/audio_chord_estimation/chordino/nnls-chroma.n3 Mon Sep 02 16:28:48 2013 +0100 @@ -0,0 +1,396 @@ +@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/nnls-chroma#> . +@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 cc: <http://web.resource.org/cc/> . +@prefix : <#> . + +<> a vamp:PluginDescription ; + foaf:maker <http://www.vamp-plugins.org/doap.rdf#template-generator> ; + foaf:primaryTopic <http://vamp-plugins.org/rdf/plugins/nnls-chromannls-chroma> . + +:nnls-chroma a vamp:PluginLibrary ; + vamp:identifier "nnls-chroma" ; + vamp:available_plugin plugbase:chordino ; + vamp:available_plugin plugbase:nnls-chroma ; + vamp:available_plugin plugbase:tuning ; +# foaf:page <Place more-information HTML page URL here and uncomment> ; + . + +plugbase:chordino a vamp:Plugin ; + dc:title "Chordino" ; + vamp:name "Chordino" ; + dc:description """Chordino provides a simple chord transcription based on NNLS Chroma (as in the NNLS Chroma plugin). Chord profiles given by the user in the file chord.dict are used to calculate frame-wise chord similarities. A simple (non-state-of-the-art!) algorithm smoothes these to provide a chord transcription using a standard HMM/Viterbi approach.""" ; + foaf:maker [ foaf:name "Matthias Mauch" ] ; # FIXME could give plugin author's URI here + dc:rights """GPL""" ; +# cc:license <Place plugin license URI here and uncomment> ; + vamp:identifier "chordino" ; + vamp:vamp_API_version vamp:api_version_2 ; + owl:versionInfo "3" ; + vamp:input_domain vamp:FrequencyDomain ; + + + vamp:parameter plugbase:chordino_param_useNNLS ; + vamp:parameter plugbase:chordino_param_rollon ; + vamp:parameter plugbase:chordino_param_tuningmode ; + vamp:parameter plugbase:chordino_param_whitening ; + vamp:parameter plugbase:chordino_param_spectralshape ; + vamp:parameter plugbase:chordino_param_boostn ; + vamp:parameter plugbase:chordino_param_usehartesyntax ; + + vamp:output plugbase:chordino_output_simplechord ; + vamp:output plugbase:chordino_output_chordnotes ; + vamp:output plugbase:chordino_output_harmonicchange ; + vamp:output plugbase:chordino_output_loglikelihood ; + . +plugbase:chordino_param_useNNLS a vamp:QuantizedParameter ; + vamp:identifier "useNNLS" ; + dc:title "use approximate transcription (NNLS)" ; + dc:format "" ; + vamp:min_value 0 ; + vamp:max_value 1 ; + vamp:unit "" ; + vamp:quantize_step 1 ; + vamp:default_value 1 ; + vamp:value_names (); + . +plugbase:chordino_param_rollon a vamp:QuantizedParameter ; + vamp:identifier "rollon" ; + dc:title "bass noise threshold" ; + dc:format "%" ; + vamp:min_value 0 ; + vamp:max_value 5 ; + vamp:unit "%" ; + vamp:quantize_step 0.5 ; + vamp:default_value 0 ; + vamp:value_names (); + . +plugbase:chordino_param_tuningmode a vamp:QuantizedParameter ; + vamp:identifier "tuningmode" ; + dc:title "tuning mode" ; + dc:format "" ; + vamp:min_value 0 ; + vamp:max_value 1 ; + vamp:unit "" ; + vamp:quantize_step 1 ; + vamp:default_value 0 ; + vamp:value_names ( "global tuning" "local tuning"); + . +plugbase:chordino_param_whitening a vamp:Parameter ; + vamp:identifier "whitening" ; + dc:title "spectral whitening" ; + dc:format "" ; + vamp:min_value 0 ; + vamp:max_value 1 ; + vamp:unit "" ; + vamp:default_value 1 ; + vamp:value_names (); + . +plugbase:chordino_param_spectralshape a vamp:Parameter ; + vamp:identifier "spectralshape" ; + dc:title "spectral shape" ; + dc:format "" ; + vamp:min_value 0.5 ; + vamp:max_value 0.9 ; + vamp:unit "" ; + vamp:default_value 0.7 ; + vamp:value_names (); + . +plugbase:chordino_param_boostn a vamp:Parameter ; + vamp:identifier "boostn" ; + dc:title "boost N" ; + dc:format "" ; + vamp:min_value 0 ; + vamp:max_value 1 ; + vamp:unit "" ; + vamp:default_value 0.1 ; + vamp:value_names (); + . +plugbase:chordino_param_usehartesyntax a vamp:QuantizedParameter ; + vamp:identifier "usehartesyntax" ; + dc:title "use Harte syntax" ; + dc:format "" ; + vamp:min_value 0 ; + vamp:max_value 1 ; + vamp:unit "" ; + vamp:quantize_step 1 ; + vamp:default_value 0 ; + vamp:value_names ( "no" "yes"); + . +plugbase:chordino_output_simplechord a vamp:SparseOutput ; + vamp:identifier "simplechord" ; + dc:title "Chord Estimate" ; + dc:description """Estimated chord times and labels.""" ; + vamp:fixed_bin_count "true" ; + vamp:unit "" ; + vamp:bin_count 0 ; + vamp:sample_type vamp:VariableSampleRate ; + vamp:sample_rate 21.5332 ; + vamp:computes_event_type af:ChordSegment ; +# vamp:computes_feature <Place feature attribute URI here and uncomment> ; +# vamp:computes_signal_type <Place signal type URI here and uncomment> ; + . +plugbase:chordino_output_chordnotes a vamp:SparseOutput ; + vamp:identifier "chordnotes" ; + dc:title "Note Representation of Chord Estimate" ; + dc:description """A simple represenation of the estimated chord with bass note (if applicable) and chord notes.""" ; + vamp:fixed_bin_count "true" ; + vamp:unit "MIDI units" ; + a vamp:QuantizedOutput ; + vamp:quantize_step 1 ; + a vamp:KnownExtentsOutput ; + vamp:min_value 0 ; + vamp:max_value 127 ; + vamp:bin_count 1 ; + vamp:sample_type vamp:VariableSampleRate ; + vamp:sample_rate 21.5332 ; + vamp:computes_event_type af:Note ; +# vamp:computes_feature <Place feature attribute URI here and uncomment> ; +# vamp:computes_signal_type <Place signal type URI here and uncomment> ; + . +plugbase:chordino_output_harmonicchange a vamp:DenseOutput ; + vamp:identifier "harmonicchange" ; + dc:title "Harmonic Change Value" ; + dc:description """An indication of the likelihood of harmonic change. Depends on the chord dictionary. Calculation is different depending on whether the Viterbi algorithm is used for chord estimation, or the simple chord estimate.""" ; + vamp:fixed_bin_count "true" ; + vamp:unit "" ; + vamp:bin_count 1 ; +# vamp:computes_event_type <Place event type URI here and uncomment> ; +# vamp:computes_feature <Place feature attribute URI here and uncomment> ; +# vamp:computes_signal_type <Place signal type URI here and uncomment> ; + . +plugbase:chordino_output_loglikelihood a vamp:DenseOutput ; + vamp:identifier "loglikelihood" ; + dc:title "Log-Likelihood of Chord Estimate" ; + dc:description """Logarithm of the likelihood value of the simple chord estimate.""" ; + vamp:fixed_bin_count "true" ; + vamp:unit "" ; + vamp:bin_count 1 ; +# vamp:computes_event_type <Place event type URI here and uncomment> ; +# vamp:computes_feature <Place feature attribute URI here and uncomment> ; +# vamp:computes_signal_type <Place signal type URI here and uncomment> ; + . +plugbase:nnls-chroma a vamp:Plugin ; + dc:title "NNLS Chroma" ; + vamp:name "NNLS Chroma" ; + dc:description """This plugin provides a number of features derived from a DFT-based log-frequency amplitude spectrum: some variants of the log-frequency spectrum, including a semitone spectrum derived from approximate transcription using the NNLS algorithm; and based on this semitone spectrum, different chroma features.""" ; + foaf:maker [ foaf:name "Matthias Mauch" ] ; # FIXME could give plugin author's URI here + dc:rights """GPL""" ; +# cc:license <Place plugin license URI here and uncomment> ; + vamp:identifier "nnls-chroma" ; + vamp:vamp_API_version vamp:api_version_2 ; + owl:versionInfo "3" ; + vamp:input_domain vamp:FrequencyDomain ; + + + vamp:parameter plugbase:nnls-chroma_param_useNNLS ; + vamp:parameter plugbase:nnls-chroma_param_rollon ; + vamp:parameter plugbase:nnls-chroma_param_tuningmode ; + vamp:parameter plugbase:nnls-chroma_param_whitening ; + vamp:parameter plugbase:nnls-chroma_param_s ; + vamp:parameter plugbase:nnls-chroma_param_chromanormalize ; + + vamp:output plugbase:nnls-chroma_output_logfreqspec ; + vamp:output plugbase:nnls-chroma_output_tunedlogfreqspec ; + vamp:output plugbase:nnls-chroma_output_semitonespectrum ; + vamp:output plugbase:nnls-chroma_output_chroma ; + vamp:output plugbase:nnls-chroma_output_basschroma ; + vamp:output plugbase:nnls-chroma_output_bothchroma ; + . +plugbase:nnls-chroma_param_useNNLS a vamp:QuantizedParameter ; + vamp:identifier "useNNLS" ; + dc:title "use approximate transcription (NNLS)" ; + dc:format "" ; + vamp:min_value 0 ; + vamp:max_value 1 ; + vamp:unit "" ; + vamp:quantize_step 1 ; + vamp:default_value 1 ; + vamp:value_names (); + . +plugbase:nnls-chroma_param_rollon a vamp:QuantizedParameter ; + vamp:identifier "rollon" ; + dc:title "bass noise threshold" ; + dc:format "%" ; + vamp:min_value 0 ; + vamp:max_value 5 ; + vamp:unit "%" ; + vamp:quantize_step 0.5 ; + vamp:default_value 0 ; + vamp:value_names (); + . +plugbase:nnls-chroma_param_tuningmode a vamp:QuantizedParameter ; + vamp:identifier "tuningmode" ; + dc:title "tuning mode" ; + dc:format "" ; + vamp:min_value 0 ; + vamp:max_value 1 ; + vamp:unit "" ; + vamp:quantize_step 1 ; + vamp:default_value 0 ; + vamp:value_names ( "global tuning" "local tuning"); + . +plugbase:nnls-chroma_param_whitening a vamp:Parameter ; + vamp:identifier "whitening" ; + dc:title "spectral whitening" ; + dc:format "" ; + vamp:min_value 0 ; + vamp:max_value 1 ; + vamp:unit "" ; + vamp:default_value 1 ; + vamp:value_names (); + . +plugbase:nnls-chroma_param_s a vamp:Parameter ; + vamp:identifier "s" ; + dc:title "spectral shape" ; + dc:format "" ; + vamp:min_value 0.5 ; + vamp:max_value 0.9 ; + vamp:unit "" ; + vamp:default_value 0.7 ; + vamp:value_names (); + . +plugbase:nnls-chroma_param_chromanormalize a vamp:QuantizedParameter ; + vamp:identifier "chromanormalize" ; + dc:title "chroma normalization" ; + dc:format "" ; + vamp:min_value 0 ; + vamp:max_value 3 ; + vamp:unit "" ; + vamp:quantize_step 1 ; + vamp:default_value 0 ; + vamp:value_names ( "none" "maximum norm" "L1 norm" "L2 norm"); + . +plugbase:nnls-chroma_output_logfreqspec a vamp:DenseOutput ; + vamp:identifier "logfreqspec" ; + dc:title "Log-Frequency Spectrum" ; + dc:description """A Log-Frequency Spectrum (constant Q) that is obtained by cosine filter mapping.""" ; + vamp:fixed_bin_count "true" ; + vamp:unit "" ; + vamp:bin_count 256 ; +# vamp:computes_event_type <Place event type URI here and uncomment> ; +# vamp:computes_feature <Place feature attribute URI here and uncomment> ; +# vamp:computes_signal_type <Place signal type URI here and uncomment> ; + . +plugbase:nnls-chroma_output_tunedlogfreqspec a vamp:DenseOutput ; + vamp:identifier "tunedlogfreqspec" ; + dc:title "Tuned Log-Frequency Spectrum" ; + dc:description """A Log-Frequency Spectrum (constant Q) that is obtained by cosine filter mapping, then its tuned using the estimated tuning frequency.""" ; + vamp:fixed_bin_count "true" ; + vamp:unit "" ; + vamp:bin_count 256 ; +# vamp:computes_event_type <Place event type URI here and uncomment> ; +# vamp:computes_feature <Place feature attribute URI here and uncomment> ; +# vamp:computes_signal_type <Place signal type URI here and uncomment> ; + . +plugbase:nnls-chroma_output_semitonespectrum a vamp:DenseOutput ; + vamp:identifier "semitonespectrum" ; + dc:title "Semitone Spectrum" ; + dc:description """A semitone-spaced log-frequency spectrum derived from the third-of-a-semitone-spaced tuned log-frequency spectrum.""" ; + vamp:fixed_bin_count "true" ; + vamp:unit "" ; + vamp:bin_count 84 ; +# vamp:computes_event_type <Place event type URI here and uncomment> ; +# vamp:computes_feature <Place feature attribute URI here and uncomment> ; +# vamp:computes_signal_type <Place signal type URI here and uncomment> ; + . +plugbase:nnls-chroma_output_chroma a vamp:DenseOutput ; + vamp:identifier "chroma" ; + dc:title "Chromagram" ; + dc:description """Tuning-adjusted chromagram from NNLS approximate transcription, with an emphasis on the medium note range.""" ; + vamp:fixed_bin_count "true" ; + vamp:unit "" ; + vamp:bin_count 12 ; + vamp:bin_names ( "A" "Bb" "B" "C" "C#" "D" "Eb" "E" "F" "F#" "G" "Ab"); +# vamp:computes_event_type <Place event type URI here and uncomment> ; +# vamp:computes_feature <Place feature attribute URI here and uncomment> ; + vamp:computes_signal_type af:Chromagram ; + . +plugbase:nnls-chroma_output_basschroma a vamp:DenseOutput ; + vamp:identifier "basschroma" ; + dc:title "Bass Chromagram" ; + dc:description """Tuning-adjusted bass chromagram from NNLS approximate transcription, with an emphasis on the bass note range.""" ; + vamp:fixed_bin_count "true" ; + vamp:unit "" ; + vamp:bin_count 12 ; + vamp:bin_names ( "A" "Bb" "B" "C" "C#" "D" "Eb" "E" "F" "F#" "G" "Ab"); +# vamp:computes_event_type <Place event type URI here and uncomment> ; +# vamp:computes_feature <Place feature attribute URI here and uncomment> ; + vamp:computes_signal_type af:Chromagram ; + . +plugbase:nnls-chroma_output_bothchroma a vamp:DenseOutput ; + vamp:identifier "bothchroma" ; + dc:title "Chromagram and Bass Chromagram" ; + dc:description """Tuning-adjusted chromagram and bass chromagram (stacked on top of each other) from NNLS approximate transcription.""" ; + vamp:fixed_bin_count "true" ; + vamp:unit "" ; + vamp:bin_count 24 ; + vamp:bin_names ( "A (bass)" "Bb (bass)" "B (bass)" "C (bass)" "C# (bass)" "D (bass)" "Eb (bass)" "E (bass)" "F (bass)" "F# (bass)" "G (bass)" "Ab (bass)" "A" "Bb" "B" "C" "C#" "D" "Eb" "E" "F" "F#" "G" "Ab"); +# vamp:computes_event_type <Place event type URI here and uncomment> ; +# vamp:computes_feature <Place feature attribute URI here and uncomment> ; + vamp:computes_signal_type af:Chromagram ; + . +plugbase:tuning a vamp:Plugin ; + dc:title "Tuning" ; + vamp:name "Tuning" ; + dc:description """The tuning plugin can estimate the local and global tuning of piece. The same tuning method is used for the NNLS Chroma and Chordino plugins.""" ; + foaf:maker [ foaf:name "Matthias Mauch" ] ; # FIXME could give plugin author's URI here + dc:rights """GPL""" ; +# cc:license <Place plugin license URI here and uncomment> ; + vamp:identifier "tuning" ; + vamp:vamp_API_version vamp:api_version_2 ; + owl:versionInfo "3" ; + vamp:input_domain vamp:FrequencyDomain ; + + + vamp:parameter plugbase:tuning_param_rollon ; + + vamp:output plugbase:tuning_output_tuning ; + vamp:output plugbase:tuning_output_localtuning ; + . +plugbase:tuning_param_rollon a vamp:QuantizedParameter ; + vamp:identifier "rollon" ; + dc:title "bass noise threshold" ; + dc:format "%" ; + vamp:min_value 0 ; + vamp:max_value 5 ; + vamp:unit "%" ; + vamp:quantize_step 0.5 ; + vamp:default_value 0 ; + vamp:value_names (); + . +plugbase:tuning_output_tuning a vamp:SparseOutput ; + vamp:identifier "tuning" ; + dc:title "Tuning" ; + dc:description """Returns a single label (at time 0 seconds) containing an estimate of the concert pitch in Hz.""" ; + vamp:fixed_bin_count "true" ; + vamp:unit "Hz" ; + a vamp:KnownExtentsOutput ; + vamp:min_value 427.47 ; + vamp:max_value 452.89 ; + vamp:bin_count 1 ; + vamp:sample_type vamp:VariableSampleRate ; + vamp:sample_rate 1.47994e-39 ; +# vamp:computes_event_type <Place event type URI here and uncomment> ; +# vamp:computes_feature <Place feature attribute URI here and uncomment> ; +# vamp:computes_signal_type <Place signal type URI here and uncomment> ; + . +plugbase:tuning_output_localtuning a vamp:DenseOutput ; + vamp:identifier "localtuning" ; + dc:title "Local Tuning" ; + dc:description """Returns a tuning estimate at every analysis frame, an average of the (recent) previous frame-wise estimates of the concert pitch in Hz.""" ; + vamp:fixed_bin_count "true" ; + vamp:unit "Hz" ; + a vamp:KnownExtentsOutput ; + vamp:min_value 427.47 ; + vamp:max_value 452.89 ; + vamp:bin_count 1 ; +# vamp:computes_event_type <Place event type URI here and uncomment> ; +# vamp:computes_feature <Place feature attribute URI here and uncomment> ; +# vamp:computes_signal_type <Place signal type URI here and uncomment> ; + . +