Mercurial > hg > silvet
comparison src/Instruments.cpp @ 342:ad45b18427e0
Merge from branch livemode
author | Chris Cannam |
---|---|
date | Mon, 06 Jul 2015 09:15:21 +0100 |
parents | 1bfde6dba499 |
children |
comparison
equal
deleted
inserted
replaced
313:fa2ffbb786df | 342:ad45b18427e0 |
---|---|
17 | 17 |
18 #include "data/include/templates.h" | 18 #include "data/include/templates.h" |
19 | 19 |
20 #include <iostream> | 20 #include <iostream> |
21 | 21 |
22 const int InstrumentPack::templateNoteCount = SILVET_TEMPLATE_NOTE_COUNT; | |
23 const int InstrumentPack::templateHeight = SILVET_TEMPLATE_HEIGHT; | |
24 const int InstrumentPack::templateMaxShift = SILVET_TEMPLATE_MAX_SHIFT; | |
25 const int InstrumentPack::templateSize = SILVET_TEMPLATE_SIZE; | |
26 | |
27 using std::string; | 22 using std::string; |
28 using std::vector; | 23 using std::vector; |
29 using std::cerr; | 24 using std::cerr; |
30 using std::endl; | 25 using std::endl; |
26 | |
27 InstrumentPack::InstrumentPack(int lowest, int highest, | |
28 std::string n, std::vector<Templates> tt) : | |
29 templateNoteCount(SILVET_TEMPLATE_NOTE_COUNT), | |
30 templateHeight(SILVET_TEMPLATE_HEIGHT), | |
31 templateMaxShift(SILVET_TEMPLATE_MAX_SHIFT), | |
32 templateSize(SILVET_TEMPLATE_SIZE), | |
33 lowestNote(lowest), | |
34 highestNote(highest), | |
35 maxPolyphony(5), | |
36 pitchSparsity(1.1), | |
37 sourceSparsity(1.2), | |
38 levelThreshold(5), | |
39 name(n), | |
40 templates(tt) | |
41 { | |
42 } | |
31 | 43 |
32 const char *simpleInstruments[] = { | 44 const char *simpleInstruments[] = { |
33 // Each instrument has two consecutive slots, one for the pack | 45 // Each instrument has two consecutive slots, one for the pack |
34 // name and one for the template to look up | 46 // name and one for the template to look up |
35 "Guitar", "guitar", | 47 "Guitar", "guitar", |
132 InstrumentPack piano(silvet_templates_lowest_note, | 144 InstrumentPack piano(silvet_templates_lowest_note, |
133 silvet_templates_highest_note, | 145 silvet_templates_highest_note, |
134 "Piano", | 146 "Piano", |
135 pianoTemplates); | 147 pianoTemplates); |
136 piano.maxPolyphony = 6; | 148 piano.maxPolyphony = 6; |
137 piano.levelThreshold = 6; | 149 piano.levelThreshold = 5; |
138 piano.pitchSparsity = 1.0; | 150 piano.pitchSparsity = 1.0; |
139 piano.sourceSparsity = 1.0; | 151 piano.sourceSparsity = 1.0; |
140 if (isOK(piano)) { | 152 if (isOK(piano)) { |
141 ii.push_back(piano); | 153 ii.push_back(piano); |
142 } | 154 } |
186 | 198 |
187 InstrumentPack strings(silvet_templates_lowest_note, // cello | 199 InstrumentPack strings(silvet_templates_lowest_note, // cello |
188 silvet_templates_highest_note, // violin | 200 silvet_templates_highest_note, // violin |
189 "String quartet", | 201 "String quartet", |
190 stringTemplates); | 202 stringTemplates); |
191 strings.maxPolyphony = 5; | 203 strings.maxPolyphony = 6; |
192 strings.levelThreshold = 5; | 204 strings.levelThreshold = 3; |
193 if (isOK(strings)) { | 205 if (isOK(strings)) { |
194 ii.push_back(strings); | 206 ii.push_back(strings); |
195 } | 207 } |
196 | 208 |
197 InstrumentPack winds(silvet_templates_lowest_note, // basson | 209 InstrumentPack winds(silvet_templates_lowest_note, // basson |