changeset 60:9a1f83057e84 matthiasm-plugin

harmonic change had no identifier, changed that in .cpp and .n3 files
author Matthias Mauch <mail@matthiasmauch.net>
date Tue, 26 Oct 2010 13:01:54 +0900
parents 1ccb883b585f
children 08d24cc21312
files Chordino.cpp NNLSBase.cpp nnls-chroma.n3 simplechord.n3
diffstat 4 files changed, 20 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/Chordino.cpp	Mon Oct 25 23:47:06 2010 +0900
+++ b/Chordino.cpp	Tue Oct 26 13:01:54 2010 +0900
@@ -185,15 +185,15 @@
     m_outputChords = index++;
     
     OutputDescriptor d8;
-    d8.identifier = "";
+    d8.identifier = "harmonicchange";
     d8.name = "Harmonic Change Value";
     d8.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.";
     d8.unit = "";
     d8.hasFixedBinCount = true;
     d8.binCount = 1;
-    d8.hasKnownExtents = true;
-    d8.minValue = 0.0;
-    d8.maxValue = 0.999;
+    d8.hasKnownExtents = false;
+    // d8.minValue = 0.0;
+    // d8.maxValue = 0.999;
     d8.isQuantized = false;
     d8.sampleType = OutputDescriptor::FixedSampleRate;
     d8.hasDuration = false;
@@ -510,8 +510,9 @@
         chord_feature.hasTimestamp = true;
         chord_feature.timestamp = timestamps[0];
         chord_feature.label = m_chordnames[chordpath[0]];
-        fsOut[0].push_back(chord_feature);
+        fsOut[m_outputChords].push_back(chord_feature);
         
+        chordchange[0] = 0;
         for (int iFrame = 1; iFrame < chordpath.size(); ++iFrame) {
             // cerr << chordpath[iFrame] << endl;
             if (chordpath[iFrame] != oldchord ) {
@@ -519,7 +520,7 @@
                 chord_feature.hasTimestamp = true;
                 chord_feature.timestamp = timestamps[iFrame];
                 chord_feature.label = m_chordnames[chordpath[iFrame]];
-                fsOut[0].push_back(chord_feature);
+                fsOut[m_outputChords].push_back(chord_feature);
                 oldchord = chordpath[iFrame];         
             }
             /* calculating simple chord change prob */            
@@ -672,7 +673,7 @@
             if (oldChord != maxChord) {
                 oldChord = maxChord;
                 chord_feature.label = m_chordnames[maxChordIndex];
-                fsOut[0].push_back(chord_feature);
+                fsOut[m_outputChords].push_back(chord_feature);
             }
             count++;
         }
@@ -681,7 +682,7 @@
     chord_feature.hasTimestamp = true;
     chord_feature.timestamp = timestamps[timestamps.size()-1];
     chord_feature.label = "N";
-    fsOut[0].push_back(chord_feature);
+    fsOut[m_outputChords].push_back(chord_feature);
     cerr << "done." << endl;
     
     for (int iFrame = 0; iFrame < nFrame; iFrame++) {
@@ -689,10 +690,11 @@
         chordchange_feature.hasTimestamp = true;
         chordchange_feature.timestamp = timestamps[iFrame];
         chordchange_feature.values.push_back(chordchange[iFrame]);
-        fsOut[1].push_back(chordchange_feature);
+        // cerr << chordchange[iFrame] << endl;
+        fsOut[m_outputHarmonicChange].push_back(chordchange_feature);
     }
     
-    
+    // for (int iFrame = 0; iFrame < nFrame; iFrame++) cerr << fsOut[m_outputHarmonicChange][iFrame].values[0] << endl;
     
     
     return fsOut;     
--- a/NNLSBase.cpp	Mon Oct 25 23:47:06 2010 +0900
+++ b/NNLSBase.cpp	Tue Oct 26 13:01:54 2010 +0900
@@ -49,11 +49,11 @@
     m_kernelFftIndex(0),
     m_kernelNoteIndex(0),
     m_dict(0),
-    m_tuneLocal(false),
+    m_tuneLocal(0),
     m_chorddict(0),
     m_chordnames(0),
     m_doNormalizeChroma(0),
-    m_rollon(0.0),
+    m_rollon(0),
 	m_s(0.7),
 	m_useNNLS(1),
 	m_useHMM(1)
@@ -290,7 +290,8 @@
     }
     
     if (identifier == "tuningmode") {
-        m_tuneLocal = (value > 0) ? true : false;
+        // m_tuneLocal = (value > 0) ? true : false;
+        m_tuneLocal = value;
         // cerr << "m_tuneLocal :" << m_tuneLocal << endl;
     }
     // if (identifier == "preset") {
@@ -555,7 +556,7 @@
         f2.timestamp = f1.timestamp;
         f2.values.push_back(0.0); f2.values.push_back(0.0); // set lower edge to zero
 		
-        if (m_tuneLocal) {
+        if (m_tuneLocal == 1.0) {
             intShift = floor(m_localTuning[count] * 3);
             intFactor = m_localTuning[count] * 3 - intShift; // intFactor is a really bad name for this
         }
--- a/nnls-chroma.n3	Mon Oct 25 23:47:06 2010 +0900
+++ b/nnls-chroma.n3	Tue Oct 26 13:01:54 2010 +0900
@@ -44,7 +44,7 @@
     vamp:parameter   plugbase:chordino_param_s ;
 
     vamp:output      plugbase:chordino_output_simplechord ;
-    vamp:output      plugbase:chordino_output_ ;
+    vamp:output      plugbase:chordino_output_harmonicchange ;
     .
 plugbase:chordino_param_useNNLS a  vamp:QuantizedParameter ;
     vamp:identifier     "useNNLS" ;
@@ -123,8 +123,8 @@
     vamp:sample_rate      21.5332 ;
     vamp:computes_event_type   af:ChordSegment ;
     .
-plugbase:chordino_output_ a  vamp:DenseOutput ;
-    vamp:identifier       "" ;
+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" ;
--- a/simplechord.n3	Mon Oct 25 23:47:06 2010 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-@prefix xsd:      <http://www.w3.org/2001/XMLSchema#> .
-@prefix vamp:     <http://purl.org/ontology/vamp/> .
-@prefix :         <#> .
-
-:transform_plugin a vamp:Plugin ;
-    vamp:identifier "nnls_chroma" .
-
-:transform_library a vamp:PluginLibrary ;
-    vamp:identifier "matthiasm" ;
-    vamp:available_plugin :transform_plugin .
-
-:transform a vamp:Transform ;
-    vamp:plugin :transform_plugin ;
-    vamp:step_size "2048"^^xsd:int ; 
-    vamp:block_size "16384"^^xsd:int ; 
-    vamp:parameter_binding [
-        vamp:parameter [ vamp:identifier "notedict" ] ;
-        vamp:value "0"^^xsd:float ;
-    ] ;
-    vamp:parameter_binding [
-        vamp:parameter [ vamp:identifier "tuningmode" ] ;
-        vamp:value "0"^^xsd:float ;
-    ] ;
-    vamp:output [ vamp:identifier "simplechord" ] .