# HG changeset patch # User Carl Bussey # Date 1404912752 -3600 # Node ID 1d0b7dcea27f58670727c1ade83c507eb8fa033d # Parent 3fd1a41b089b470883f3c986fbf6399c4dad52a0 Added manual setting of timestamps as wasn't working on both test machines. diff -r 3fd1a41b089b -r 1d0b7dcea27f Makefile --- a/Makefile Wed Jul 09 10:26:51 2014 +0100 +++ b/Makefile Wed Jul 09 14:32:32 2014 +0100 @@ -38,7 +38,7 @@ ## Xcode 4 command-line tools. CXX := g++ -CXXFLAGS := -arch x86_64 -I$(VAMP_SDK_DIR) -Wall -fPIC +CXXFLAGS := -mmacosx-version-min=10.6 -arch x86_64 -I$(VAMP_SDK_DIR) -Wall -fPIC PLUGIN_EXT := .dylib LDFLAGS := $(CXXFLAGS) -dynamiclib -install_name $(PLUGIN_LIBRARY_NAME)$(PLUGIN_EXT) /usr/local/lib/libvamp-sdk.a -exported_symbols_list vamp-plugin.list @@ -97,7 +97,7 @@ $(PLUGIN_OBJECTS): $(PLUGIN_HEADERS) install: $(PLUGIN_LIBRARY_NAME)$(PLUGIN_EXT) - cp $(PLUGIN_LIBRARY_NAME)$(PLUGIN_EXT) /Library/Audio/Plug-Ins/Vamp + cp $(PLUGIN_LIBRARY_NAME)$(PLUGIN_EXT) ~/Library/Audio/Plug-Ins/Vamp clean: rm -f *.o *.dylib diff -r 3fd1a41b089b -r 1d0b7dcea27f Tempogram.cpp --- a/Tempogram.cpp Wed Jul 09 10:26:51 2014 +0100 +++ b/Tempogram.cpp Wed Jul 09 14:32:32 2014 +0100 @@ -240,6 +240,18 @@ d.hasDuration = false; list.push_back(d); + d.identifier = "spect"; + d.name = "spect"; + d.description = "spect"; + d.unit = ""; + d.hasFixedBinCount = true; + d.binCount = m_blockSize/2; + d.hasKnownExtents = false; + d.isQuantized = false; + d.sampleType = OutputDescriptor::OneSamplePerStep; + d.hasDuration = false; + list.push_back(d); + return list; } @@ -274,11 +286,11 @@ const float *in = inputBuffers[0]; - //Calculate log magnitude float sum = 0; for (int i = 0; i < n; i++){ float magnitude = sqrt(in[2*i] * in[2*i] + in[2*i + 1] * in[2*i + 1]); - currentY[i] = log(1+compressionConstant*magnitude); //should be 1+C*magnitude + feature.values.push_back(magnitude); + currentY[i] = log(1+compressionConstant*magnitude); if(currentY[i] >= previousY[i]){ sum += (currentY[i] - previousY[i]); } @@ -289,10 +301,12 @@ float *tmpY = currentY; currentY = previousY; previousY = tmpY; + tmpY = NULL; ncTimestamps.push_back(timestamp); + featureSet[2].push_back(feature); - return FeatureSet(); + return featureSet; } void @@ -339,17 +353,18 @@ noveltyCurve[i] -= noveltyCurveLocalAverage[i]; noveltyCurve[i] = noveltyCurve[i] >= 0 ? noveltyCurve[i] : 0; Feature ncFeature; + ncFeature.hasTimestamp = true; + ncFeature.timestamp = ncTimestamps[i]; ncFeature.values.push_back(noveltyCurve[i]); featureSet[1].push_back(ncFeature); } - int i=0; WindowFunction::hanning(hannWindowtN, tN); + int timestampInc = floor((((float)ncTimestamps[1].nsec - ncTimestamps[0].nsec)/1e9)*(thopSize) + 0.5); + int i=0; int index; int frameBeginOffset = floor(tN/2 + 0.5); - int timestampInc = floor((((float)ncTimestamps[1].nsec - ncTimestamps[0].nsec)/1e9)*(thopSize) + 0.5); - //cout << timestampInc << endl; while(i < ncLength){ Feature feature;