comparison src/Silvet.cpp @ 161:6003a9af43af

Introduce InstrumentPack class
author Chris Cannam
date Tue, 20 May 2014 15:31:05 +0100
parents 58547262e735
children 03ba9b25e0d0
comparison
equal deleted inserted replaced
160:58547262e735 161:6003a9af43af
36 static int processingHeight = 545; 36 static int processingHeight = 545;
37 static int processingNotes = 88; 37 static int processingNotes = 88;
38 38
39 Silvet::Silvet(float inputSampleRate) : 39 Silvet::Silvet(float inputSampleRate) :
40 Plugin(inputSampleRate), 40 Plugin(inputSampleRate),
41 m_instruments(InstrumentPack::listInstrumentPacks()),
41 m_resampler(0), 42 m_resampler(0),
42 m_cq(0), 43 m_cq(0),
43 m_hqMode(true) 44 m_hqMode(true)
44 { 45 {
45 } 46 }
138 desc.minValue = 0; 139 desc.minValue = 0;
139 desc.maxValue = 1; 140 desc.maxValue = 1;
140 desc.defaultValue = 1; 141 desc.defaultValue = 1;
141 desc.isQuantized = true; 142 desc.isQuantized = true;
142 desc.quantizeStep = 1; 143 desc.quantizeStep = 1;
143 desc.valueNames.push_back("Draft (faster)"); 144 desc.valueNames.push_back("Draft: faster");
144 desc.valueNames.push_back("Intensive (higher quality)"); 145 desc.valueNames.push_back("Intensive: usually higher quality");
146 list.push_back(desc);
147
148 desc.identifier = "soloinstrument";
149 desc.name = "The recording contains";
150 desc.unit = "";
151 desc.description = "Determines the tradeoff of processing speed against transcription quality";
152 desc.minValue = 0;
153 desc.maxValue = 1;
154 desc.defaultValue = 1;
155 desc.isQuantized = true;
156 desc.quantizeStep = 1;
157 desc.valueNames.clear();
158 desc.valueNames.push_back("Multiple or unknown instruments");
159
145 list.push_back(desc); 160 list.push_back(desc);
146 161
147 return list; 162 return list;
148 } 163 }
149 164
344 359
345 // cerr << "sum: " << sum << endl; 360 // cerr << "sum: " << sum << endl;
346 361
347 if (sum < 1e-5) continue; 362 if (sum < 1e-5) continue;
348 363
349 EM em(m_hqMode); 364 EM em(&m_instruments[0], m_hqMode);
350 365
351 for (int j = 0; j < iterations; ++j) { 366 for (int j = 0; j < iterations; ++j) {
352 em.iterate(filtered.at(i).data()); 367 em.iterate(filtered.at(i).data());
353 } 368 }
354 369