# HG changeset patch # User Carl Bussey # Date 1412084679 -3600 # Node ID b27e42b68c617e04b390cc6fb39c2a6b68cbd5c6 # Parent 8c151a9ca20244c421aec7cdaa519e4f8be24538 * Added reference tempo parameter for cyclic tempogram diff -r 8c151a9ca202 -r b27e42b68c61 Makefile.osx --- a/Makefile.osx Mon Sep 29 16:22:16 2014 +0100 +++ b/Makefile.osx Tue Sep 30 14:44:39 2014 +0100 @@ -19,18 +19,18 @@ # Flags to determine processor architecture and system SDK -ARCHFLAGS ?= -mmacosx-version-min=10.6 -arch x86_64 -arch i386 +ARCHFLAGS ?= -mmacosx-version-min=10.6 -arch x86_64 # Location of Vamp plugin SDK relative to the project directory -VAMPSDK_DIR := ../vamp-plugin-sdk +VAMPSDK_DIR := /usr/local/include # Libraries and linker flags required by plugin: add any -l # options here -PLUGIN_LDFLAGS := -dynamiclib -exported_symbols_list vamp-plugin.list $(VAMPSDK_DIR)/libvamp-sdk.a +PLUGIN_LDFLAGS := -dynamiclib -exported_symbols_list vamp-plugin.list /usr/local/lib/libvamp-sdk.a # File extension for plugin library on this platform diff -r 8c151a9ca202 -r b27e42b68c61 TempogramPlugin.cpp --- a/TempogramPlugin.cpp Mon Sep 29 16:22:16 2014 +0100 +++ b/TempogramPlugin.cpp Tue Sep 30 14:44:39 2014 +0100 @@ -39,7 +39,8 @@ m_tempogramMaxLag(0), //set in initialise() m_cyclicTempogramMinBPM(30), //reset in initialise() m_cyclicTempogramNumberOfOctaves(0), //set in initialise() - m_cyclicTempogramOctaveDivider(30) //parameter + m_cyclicTempogramOctaveDivider(30), //parameter + m_cyclicTempogramReferenceBPM(60) // Also be sure to set your plugin parameters (presumably stored // in member variables) to their default values here -- the host @@ -238,6 +239,18 @@ d8.isQuantized = true; d8.quantizeStep = 1; list.push_back(d8); + + ParameterDescriptor d9; + d9.identifier = "refBPM"; + d9.name = "Cyclic Tempogram Reference BPM"; + d9.description = "The reference BPM used when calculating the parameter \'s\' of the cyclic tempogram."; + d9.unit = ""; + d9.minValue = 30; + d9.maxValue = 240; + d9.defaultValue = 60; + d9.isQuantized = true; + d9.quantizeStep = 1; + list.push_back(d9); return list; } @@ -269,6 +282,9 @@ else if (identifier == "octDiv"){ return m_cyclicTempogramOctaveDivider; } + else if (identifier == "refBPM"){ + return m_cyclicTempogramReferenceBPM; + } return 0; } @@ -301,6 +317,9 @@ else if (identifier == "octDiv"){ m_cyclicTempogramOctaveDivider = value; } + else if (identifier == "refBPM"){ + m_cyclicTempogramReferenceBPM = value; + } } @@ -348,6 +367,14 @@ d1.sampleType = OutputDescriptor::FixedSampleRate; d_sampleRate = tempogramInputSampleRate/m_tempogramHopSize; d1.sampleRate = d_sampleRate > 0.0 && !isnan(d_sampleRate) ? d_sampleRate : 0; + vector< vector > logBins = calculateTempogramNearestNeighbourLogBins(); + if (!logBins.empty()){ + //assert((int)logBins[0].size() == m_cyclicTempogramOctaveDivider); + for(int i = 0; i < (int)m_cyclicTempogramOctaveDivider; i++){ + //float s = binToBPM(logBins[0][i])/m_cyclicTempogramReferenceBPM; + //d1.binNames.push_back(floatToString(s)); + } + } d1.hasDuration = false; list.push_back(d1); diff -r 8c151a9ca202 -r b27e42b68c61 TempogramPlugin.h --- a/TempogramPlugin.h Mon Sep 29 16:22:16 2014 +0100 +++ b/TempogramPlugin.h Tue Sep 30 14:44:39 2014 +0100 @@ -115,6 +115,7 @@ float m_cyclicTempogramMinBPM; int m_cyclicTempogramNumberOfOctaves; int m_cyclicTempogramOctaveDivider; + float m_cyclicTempogramReferenceBPM; string floatToString(float value) const; vector< vector > calculateTempogramNearestNeighbourLogBins() const;