Index: Samples/CLAMDescriptors.pro
===================================================================
--- Samples/CLAMDescriptors.pro (revision 10285)
+++ Samples/CLAMDescriptors.pro (working copy)
@@ -3,14 +3,14 @@
<h1>Example project for the CLAM Descriptors Extractor</h1>
<p>
-<em>This is a generated project to test the CLAM music annotator.Descriptors have been generated by the program <tt>ClamExtractorExample</tt> provided with the annotator.You could use that extractor as example to build your own one.</em></p>
+<em>This is a generated project to test the CLAM music annotator. Descriptors have been generated by the program <tt>ClamExtractorExample</tt> provided with the annotator. You could use that extractor as example to build your own one.</em></p>
<h2>Description:</h2>
<p>
-In a real project this documentation may be useful for example to give instructions aboutthe annotation task or the aspects to take into account for the review.</p>
+In a real project this documentation may be useful for example to give instructions about the annotation task or the aspects to take into account for the review.</p>
<h2>Reference descriptors:</h2>
<p>
You can take some descriptors as reference such as the energy.
-Consider that such descriptors are computed every 2048 samples so their precission may be not as accurate as it seems.
+Consider that such descriptors are computed every 2048 samples so their precision may be not as accurate as it seems.
</p>
Index: src/SchemaBrowser.cxx
===================================================================
--- src/SchemaBrowser.cxx (revision 10285)
+++ src/SchemaBrowser.cxx (working copy)
@@ -214,6 +214,18 @@
}
documentation+=".";
}
+ if (attributeSchema.HasFirstBinFreq())
+ {
+ documentation+=tr("
First Bin Frequency: %1").arg(attributeSchema.GetFirstBinFreq());
+ }
+ if (attributeSchema.HasBinGap())
+ {
+ documentation+=tr("Bin Gap: %1").arg(attributeSchema.GetBinGap());
+ }
+ if (attributeSchema.HasNBins())
+ {
+ documentation+=tr("Number of Bins: %1").arg(attributeSchema.GetNBins());
+ }
if (attributeSchema.HasUnits())
{
documentation+=tr("Units: %1").arg(attributeSchema.GetUnits().c_str());
Index: src/Schema.hxx
===================================================================
--- src/Schema.hxx (revision 10285)
+++ src/Schema.hxx (working copy)
@@ -88,8 +88,32 @@
schemaAttribute.UpdateData();
for (const char ** value = keys; *value; value++)
schemaAttribute.GetBinLabels().push_back(*value);
+
AddAttribute(schemaAttribute);
}
+
+ void AddFloatArray(
+ const std::string & scope,
+ const std::string & attribute,
+ double firstBin,
+ double binGap,
+ int nBins)
+ {
+ CLAM_Annotator::SchemaAttribute schemaAttribute;
+ schemaAttribute.SetScope(scope);
+ schemaAttribute.SetName(attribute);
+ schemaAttribute.SetType("FloatArray");
+
+ schemaAttribute.AddFirstBinFreq();
+ schemaAttribute.AddBinGap();
+ schemaAttribute.AddNBins();
+ schemaAttribute.SetFirstBinFreq(firstBin);
+ schemaAttribute.SetBinGap(binGap);
+ schemaAttribute.SetNBins(nBins);
+
+ AddAttribute(schemaAttribute);
+ }
+
void AddRangedInt(
const std::string & scope,
const std::string & attribute,
Index: src/SchemaAttribute.hxx
===================================================================
--- src/SchemaAttribute.hxx (revision 10285)
+++ src/SchemaAttribute.hxx (working copy)
@@ -71,7 +71,7 @@
class SchemaAttribute:public CLAM::DynamicType
{
- DYNAMIC_TYPE(SchemaAttribute,11);
+ DYNAMIC_TYPE(SchemaAttribute,14);
DYN_ATTRIBUTE(0, public, std::string, Name); ///< The attribute name, unique within the scope.
DYN_ATTRIBUTE(1, public, std::string, Scope); ///< The scope name at which the attribute sticks.
DYN_ATTRIBUTE(2, public, std::string, Type); ///< The type name. Should be at the Type factory.
@@ -88,8 +88,15 @@
DYN_ATTRIBUTE(9, public, SegmentationPolicy, SegmentationPolicy);
/// To be added when you have a float array
DYN_CONTAINER_ATTRIBUTE(10, public, std::list, BinLabels, Value);
-
+ /// To be added when you have a float array and are looking to store MFCC or Spectrum data
+ /// Store First Bin Frequency
+ DYN_ATTRIBUTE(11, public, CLAM::TData, FirstBinFreq);
+ /// Store Frequency Gap between Bins
+ DYN_ATTRIBUTE(12, public, CLAM::TData, BinGap);
+ /// Store Number of Bins
+ DYN_ATTRIBUTE(13, public, CLAM::TData, NBins);
+
void DefaultInit();
public:
template
@@ -124,6 +131,9 @@
StoreChildScope(storage);
StoreSegmentationPolicy(storage);
StoreBinLabels(storage);
+ StoreFirstBinFreq(storage);
+ StoreBinGap(storage);
+ StoreNBins(storage);
}
void LoadFrom(CLAM::Storage & storage)
@@ -145,6 +155,9 @@
LoadChildScope(storage);
LoadSegmentationPolicy(storage);
LoadBinLabels(storage);
+ LoadFirstBinFreq(storage);
+ LoadBinGap(storage);
+ LoadNBins(storage);
UpdateData();
UpdateTypePlugin();
}