comparison src/Instruments.cpp @ 231:d9b688700819 norm eval-norm-todate

Merge from default branch
author Chris Cannam
date Wed, 16 Jul 2014 17:46:15 +0100
parents 81288afddf43
children 8788fe838c49
comparison
equal deleted inserted replaced
215:5ba328aae5be 231:d9b688700819
32 const char *simpleInstruments[] = { 32 const char *simpleInstruments[] = {
33 // Each instrument has two consecutive slots, one for the pack 33 // Each instrument has two consecutive slots, one for the pack
34 // name and one for the template to look up 34 // name and one for the template to look up
35 "Guitar", "guitar", 35 "Guitar", "guitar",
36 "Violin", "violin", 36 "Violin", "violin",
37 "Viola", "viola",
37 "Cello", "cello", 38 "Cello", "cello",
38 "Horn", "horn", 39 "Horn", "horn",
39 "Flute", "flute", 40 "Flute", "flute",
40 "Oboe", "oboe", 41 "Oboe", "oboe",
41 "Clarinet", "clarinet", 42 "Clarinet", "clarinet",
42 "Tenor Sax", "tenorsax", 43 "Tenor Sax", "tenorsax",
43 "Bassoon", "bassoon", 44 "Bassoon", "bassoon",
44 }; 45 };
45 46
46 static bool 47 static bool
47 isString(int i) 48 isBowedString(int i)
48 { 49 {
49 string tname(simpleInstruments[i+1]); 50 string tname(simpleInstruments[i+1]);
50 return tname == "violin" 51 return tname == "violin"
52 || tname == "viola"
51 || tname == "cello" 53 || tname == "cello"
52 ; 54 ;
53 } 55 }
54 56
55 static bool 57 static bool
122 vector<Templates> allTemplates; 124 vector<Templates> allTemplates;
123 //!!! is piano-maps-SptkBGCl the same as one of piano1, piano2, piano3? 125 //!!! is piano-maps-SptkBGCl the same as one of piano1, piano2, piano3?
124 allTemplates.push_back(templatesFor("piano1")); 126 allTemplates.push_back(templatesFor("piano1"));
125 allTemplates.push_back(templatesFor("piano2")); 127 allTemplates.push_back(templatesFor("piano2"));
126 allTemplates.push_back(templatesFor("piano3")); 128 allTemplates.push_back(templatesFor("piano3"));
129 allTemplates.push_back(templatesFor("pianorwc"));
127 130
128 vector<Templates> pianoTemplates; 131 vector<Templates> pianoTemplates;
129 pianoTemplates.push_back(templatesFor("piano1")); 132 pianoTemplates.push_back(templatesFor("piano1"));
130 pianoTemplates.push_back(templatesFor("piano2")); 133 pianoTemplates.push_back(templatesFor("piano2"));
131 pianoTemplates.push_back(templatesFor("piano3")); 134 pianoTemplates.push_back(templatesFor("piano3"));
135 pianoTemplates.push_back(templatesFor("pianorwc"));
132 InstrumentPack piano(silvet_templates_lowest_note, 136 InstrumentPack piano(silvet_templates_lowest_note,
133 silvet_templates_highest_note, 137 silvet_templates_highest_note,
134 "Piano", 138 "Piano",
135 pianoTemplates); 139 pianoTemplates);
136 // piano.maxPolyphony = 8; 140 // piano.maxPolyphony = 8;
159 simpleInstruments[i], 163 simpleInstruments[i],
160 tt); 164 tt);
161 // instr.pitchSparsity = 1.5; 165 // instr.pitchSparsity = 1.5;
162 instr.maxPolyphony = 5; 166 instr.maxPolyphony = 5;
163 instr.levelThreshold = 6; 167 instr.levelThreshold = 6;
164 if (isString(i)) { 168 if (isBowedString(i)) {
165 // instr.maxPolyphony = 2; 169 // instr.maxPolyphony = 2;
166 // instr.levelThreshold = 3; 170 // instr.levelThreshold = 3;
167 stringTemplates.push_back(t); 171 stringTemplates.push_back(t);
168 } 172 }
169 if (isWind(i)) { 173 if (isWind(i)) {
186 ii.insert(ii.begin(), all); 190 ii.insert(ii.begin(), all);
187 } 191 }
188 192
189 InstrumentPack strings(silvet_templates_lowest_note, // cello 193 InstrumentPack strings(silvet_templates_lowest_note, // cello
190 silvet_templates_highest_note, // violin 194 silvet_templates_highest_note, // violin
191 "String ensemble", 195 "String quartet",
192 stringTemplates); 196 stringTemplates);
193 strings.maxPolyphony = 5; 197 strings.maxPolyphony = 5;
194 strings.levelThreshold = 3; 198 strings.levelThreshold = 3;
195 if (isOK(strings)) { 199 if (isOK(strings)) {
196 ii.push_back(strings); 200 ii.push_back(strings);