comparison src/Instruments.cpp @ 185:78212f764251 noteagent

Merge from default branch
author Chris Cannam
date Wed, 28 May 2014 14:56:01 +0100
parents 59e3cca75b8d
children 4840c6306b4f
comparison
equal deleted inserted replaced
184:9b9cdfccbd14 185:78212f764251
129 pianoTemplates.push_back(templatesFor("piano3")); 129 pianoTemplates.push_back(templatesFor("piano3"));
130 InstrumentPack piano(silvet_templates_lowest_note, 130 InstrumentPack piano(silvet_templates_lowest_note,
131 silvet_templates_highest_note, 131 silvet_templates_highest_note,
132 "Piano", 132 "Piano",
133 pianoTemplates); 133 pianoTemplates);
134 piano.maxPolyphony = 8;
135 piano.levelThreshold = 3;
134 if (isOK(piano)) { 136 if (isOK(piano)) {
135 ii.push_back(piano); 137 ii.push_back(piano);
136 } 138 }
137 139
138 vector<Templates> stringTemplates; 140 vector<Templates> stringTemplates;
143 i += 2) { 145 i += 2) {
144 vector<Templates> tt; 146 vector<Templates> tt;
145 Templates t = templatesFor(simpleInstruments[i+1]); 147 Templates t = templatesFor(simpleInstruments[i+1]);
146 tt.push_back(t); 148 tt.push_back(t);
147 allTemplates.push_back(t); 149 allTemplates.push_back(t);
148 if (isString(i)) {
149 stringTemplates.push_back(t);
150 }
151 if (isWind(i)) {
152 windTemplates.push_back(t);
153 }
154 InstrumentPack instr(t.lowestNote, 150 InstrumentPack instr(t.lowestNote,
155 t.highestNote, 151 t.highestNote,
156 simpleInstruments[i], 152 simpleInstruments[i],
157 tt); 153 tt);
154 instr.pitchSparsity = 1.5;
155 if (isString(i)) {
156 instr.maxPolyphony = 2;
157 instr.levelThreshold = 3;
158 stringTemplates.push_back(t);
159 }
160 if (isWind(i)) {
161 instr.maxPolyphony = 1;
162 instr.levelThreshold = 5;
163 windTemplates.push_back(t);
164 }
158 if (isOK(instr)) { 165 if (isOK(instr)) {
159 ii.push_back(instr); 166 ii.push_back(instr);
160 } 167 }
161 } 168 }
162 169
163 InstrumentPack all(silvet_templates_lowest_note, 170 InstrumentPack all(silvet_templates_lowest_note,
164 silvet_templates_highest_note, 171 silvet_templates_highest_note,
165 "Multiple or unknown instruments", 172 "Multiple or unknown instruments",
166 allTemplates); 173 allTemplates);
174 all.maxPolyphony = 5;
175 all.levelThreshold = 6;//!!! but this does need to be a parameter too, or else we need to be able to detect very quiet stuff somehow
167 if (isOK(all)) { 176 if (isOK(all)) {
168 ii.insert(ii.begin(), all); 177 ii.insert(ii.begin(), all);
169 } 178 }
170 179
171 InstrumentPack strings(silvet_templates_lowest_note, // cello 180 InstrumentPack strings(silvet_templates_lowest_note, // cello
172 silvet_templates_highest_note, // violin 181 silvet_templates_highest_note, // violin
173 "String ensemble", 182 "String ensemble",
174 stringTemplates); 183 stringTemplates);
184 strings.maxPolyphony = 5;
185 strings.levelThreshold = 3;
175 if (isOK(strings)) { 186 if (isOK(strings)) {
176 ii.push_back(strings); 187 ii.push_back(strings);
177 } 188 }
178 189
179 InstrumentPack winds(silvet_templates_lowest_note, // basson 190 InstrumentPack winds(silvet_templates_lowest_note, // basson
180 silvet_templates_highest_note, // flute 191 silvet_templates_highest_note, // flute
181 "Wind ensemble", 192 "Wind ensemble",
182 windTemplates); 193 windTemplates);
194 winds.maxPolyphony = 5;
195 winds.levelThreshold = 5;
183 if (isOK(winds)) { 196 if (isOK(winds)) {
184 ii.push_back(winds); 197 ii.push_back(winds);
185 } 198 }
186 199
187 return ii; 200 return ii;