Add standard MIDI midnam file and remove hard coded equivalent.
[ardour.git] / libs / midi++2 / midnam_patch.cc
1 /*
2     Copyright (C) 2008 Hans Baier
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18     $Id$
19 */
20
21 #include <algorithm>
22 #include <iostream>
23
24 #include "midi++/midnam_patch.h"
25 #include "pbd/compose.h"
26 #include "pbd/convert.h"
27 #include "pbd/error.h"
28 #include "pbd/failed_constructor.h"
29
30 using namespace std;
31 using PBD::error;
32
33 namespace MIDI
34 {
35
36 namespace Name
37 {
38         
39 Patch::Patch (std::string name, uint8_t p_number, uint16_t b_number)
40         : _name (name)
41         , _id (p_number, b_number)
42 {
43 }
44
45 int initialize_primary_key_from_commands (PatchPrimaryKey& id, const XMLNode* node)
46 {
47         id.bank_number = 0;
48
49         const XMLNodeList events = node->children();
50         for (XMLNodeList::const_iterator i = events.begin(); i != events.end(); ++i) {
51
52                 XMLNode* node = *i;
53                 if (node->name() == "ControlChange") {
54                         string control = node->property("Control")->value();
55                         assert(control != "");
56                         string value = node->property("Value")->value();
57                         assert(value != "");
58
59                         if (control == "0") {
60                                 id.bank_number |= (PBD::atoi (value)) << 7;
61                         } else if (control == "32") {
62                                 id.bank_number |= PBD::atoi (value);
63                         }
64
65                 } else if (node->name() == "ProgramChange") {
66                         string number = node->property("Number")->value();
67                         assert(number != "");
68                         id.program_number = PBD::atoi(number);
69                 }
70         }
71
72         return 0;
73 }
74
75 XMLNode&
76 Patch::get_state (void)
77 {
78         XMLNode* node = new XMLNode("Patch");
79
80         /* XXX this is totally wrong */
81
82         node->add_property("Number", string_compose ("%1", _id.program_number));
83         node->add_property("Name",   _name);
84
85         /*
86         typedef std::list< boost::shared_ptr< Evoral::MIDIEvent<double> > > PatchMidiCommands;
87         XMLNode* commands = node->add_child("PatchMIDICommands");
88         for (PatchMidiCommands::const_iterator event = _patch_midi_commands.begin();
89             event != _patch_midi_commands.end();
90             ++event) {
91                 commands->add_child_copy(*((((Evoral::MIDIEvent&)*event)).to_xml()));
92         }
93         */
94
95         return *node;
96 }
97
98 int
99 Patch::set_state (const XMLTree&, const XMLNode& node)
100 {
101         if (node.name() != "Patch") {
102                 cerr << "Incorrect node " << node.name() << " handed to Patch" << endl;
103                 return -1;
104         }
105
106         const XMLProperty* prop = node.property ("Number");
107
108         if (!prop) {
109                 return -1;
110         }
111         _id.program_number = PBD::atoi (prop->value());
112
113         prop = node.property ("Name");
114
115         if (!prop) {
116                 return -1;
117         }
118         _name   = prop->value();
119
120         XMLNode* commands = node.child("PatchMIDICommands");
121
122         if (commands) {
123                 if (initialize_primary_key_from_commands(_id, commands)) {
124                         return -1;
125                 }
126         } else {
127                 string program_change = node.property("ProgramChange")->value();
128                 assert(program_change.length());
129                 _id.program_number = PBD::atoi(program_change);
130         }
131
132         return 0;
133 }
134
135 XMLNode&
136 Note::get_state (void)
137 {
138         XMLNode* node = new XMLNode("Note");
139         node->add_property("Number", _number);
140         node->add_property("Name",   _name);
141
142         return *node;
143 }
144
145 int
146 Note::set_state (const XMLTree&, const XMLNode& node)
147 {
148         assert(node.name() == "Note");
149         _number = node.property("Number")->value();
150         _name   = node.property("Name")->value();
151
152         return 0;
153 }
154
155 XMLNode&
156 NoteNameList::get_state (void)
157 {
158         XMLNode* node = new XMLNode("NoteNameList");
159         node->add_property("Name",   _name);
160
161         return *node;
162 }
163
164 int
165 NoteNameList::set_state (const XMLTree& tree, const XMLNode& node)
166 {
167         assert(node.name() == "NoteNameList");
168         _name   = node.property("Name")->value();
169
170         boost::shared_ptr<XMLSharedNodeList> notes = tree.find("//Note");
171         for (XMLSharedNodeList::const_iterator i = notes->begin(); i != notes->end(); ++i) {
172                 boost::shared_ptr<Note> note(new Note());
173                 note->set_state (tree, *(*i));
174                 _notes.push_back(note);
175         }
176
177         return 0;
178 }
179
180 XMLNode&
181 Control::get_state (void)
182 {
183         XMLNode* node = new XMLNode("Control");
184         node->add_property("Type",   _type);
185         node->add_property("Number", _number);
186         node->add_property("Name",   _name);
187
188         return *node;
189 }
190
191 int
192 Control::set_state (const XMLTree&, const XMLNode& node)
193 {
194         assert(node.name() == "Control");
195         _type   = node.property("Type")->value();
196         _number = node.property("Number")->value();
197         _name   = node.property("Name")->value();
198
199         return 0;
200 }
201
202 XMLNode&
203 ControlNameList::get_state (void)
204 {
205         XMLNode* node = new XMLNode("ControlNameList");
206         node->add_property("Name", _name);
207
208         return *node;
209 }
210
211 int
212 ControlNameList::set_state (const XMLTree& tree, const XMLNode& node)
213 {
214         assert(node.name() == "ControlNameList");
215         _name = node.property("Name")->value();
216
217         for (XMLNodeList::const_iterator i = node.children().begin();
218              i != node.children().end(); ++i) {
219                 if ((*i)->name() != "comment") {
220                         boost::shared_ptr<Control> control(new Control());
221                         control->set_state (tree, *(*i));
222                         _controls.push_back(control);
223                 }
224         }
225
226         return 0;
227 }
228
229 XMLNode&
230 PatchBank::get_state (void)
231 {
232         XMLNode* node = new XMLNode("PatchBank");
233         node->add_property("Name",   _name);
234         XMLNode* patch_name_list = node->add_child("PatchNameList");
235         for (PatchNameList::iterator patch = _patch_name_list.begin();
236             patch != _patch_name_list.end();
237             ++patch) {
238                 patch_name_list->add_child_nocopy((*patch)->get_state());
239         }
240
241         return *node;
242 }
243
244 int
245 PatchBank::set_state (const XMLTree& tree, const XMLNode& node)
246 {
247         assert(node.name() == "PatchBank");
248         _name   = node.property("Name")->value();
249
250         XMLNode* commands = node.child("MIDICommands");
251         if (commands) {
252                 PatchPrimaryKey id (0, 0);
253                 if (initialize_primary_key_from_commands (id, commands)) {
254                         return -1;
255                 }
256                 _number = id.bank_number;
257         }
258
259         XMLNode* patch_name_list = node.child("PatchNameList");
260
261         if (patch_name_list) {
262                 const XMLNodeList patches = patch_name_list->children();
263                 for (XMLNodeList::const_iterator i = patches.begin(); i != patches.end(); ++i) {
264                         boost::shared_ptr<Patch> patch (new Patch (string(), 0, _number));
265                         patch->set_state(tree, *(*i));
266                         _patch_name_list.push_back(patch);
267                 }
268         } else {
269                 XMLNode* use_patch_name_list = node.child ("UsesPatchNameList");
270                 if (use_patch_name_list) {
271                         _patch_list_name = use_patch_name_list->property ("Name")->value();
272                 } else {
273                         error << "Patch without patch name list - patchfile will be ignored" << endmsg;
274                         return -1;
275                 }
276         }
277
278         return 0;
279 }
280
281 int
282 PatchBank::set_patch_name_list (const PatchNameList& pnl)
283 {
284         _patch_name_list = pnl;
285         _patch_list_name = "";
286
287         for (PatchNameList::iterator p = _patch_name_list.begin(); p != _patch_name_list.end(); p++) {
288                 (*p)->set_bank_number (_number);
289         }
290
291         return 0;
292 }
293
294 std::ostream&
295 operator<< (std::ostream& os, const ChannelNameSet& cns)
296 {
297         os << "Channel Name Set: name = " << cns._name << endl
298            << "Map size " << cns._patch_map.size () << endl
299            << "List size " << cns._patch_list.size() << endl
300            << "Patch list name = [" << cns._patch_list_name << ']' << endl
301            << "Available channels : ";
302         for (set<uint8_t>::iterator x = cns._available_for_channels.begin(); x != cns._available_for_channels.end(); ++x) {
303                 os << (int) (*x) << ' ';
304         }
305         os << endl;
306         
307         for (ChannelNameSet::PatchBanks::const_iterator pbi = cns._patch_banks.begin(); pbi != cns._patch_banks.end(); ++pbi) {
308                 os << "\tPatch Bank " << (*pbi)->name() << " with " << (*pbi)->patch_name_list().size() << " patches\n";
309                 for (PatchBank::PatchNameList::const_iterator pni = (*pbi)->patch_name_list().begin(); pni != (*pbi)->patch_name_list().end(); ++pni) {
310                         os << "\t\tPatch name " << (*pni)->name() << " prog " << (int) (*pni)->program_number() << " bank " << (*pni)->bank_number() << endl;
311                 }
312         }
313
314         return os;
315 }
316
317 void
318 ChannelNameSet::set_patch_banks (const ChannelNameSet::PatchBanks& pb)
319 {
320         _patch_banks = pb;
321         
322         _patch_map.clear ();
323         _patch_list.clear ();
324         _patch_list_name = "";
325         _available_for_channels.clear ();
326         
327         for (PatchBanks::const_iterator pbi = _patch_banks.begin(); pbi != _patch_banks.end(); ++pbi) {
328                 for (PatchBank::PatchNameList::const_iterator pni = (*pbi)->patch_name_list().begin(); pni != (*pbi)->patch_name_list().end(); ++pni) {
329                         _patch_map[(*pni)->patch_primary_key()] = (*pni);
330                         _patch_list.push_back ((*pni)->patch_primary_key());
331                 }
332         }
333
334         for (uint8_t n = 0; n < 16; ++n) {
335                 _available_for_channels.insert (n);
336         }
337 }
338
339 void
340 ChannelNameSet::use_patch_name_list (const PatchBank::PatchNameList& pnl)
341 {
342         for (PatchBank::PatchNameList::const_iterator p = pnl.begin(); p != pnl.end(); ++p) {
343                 _patch_map[(*p)->patch_primary_key()] = (*p);
344                 _patch_list.push_back ((*p)->patch_primary_key());
345         }
346 }
347
348 XMLNode&
349 ChannelNameSet::get_state (void)
350 {
351         XMLNode* node = new XMLNode("ChannelNameSet");
352         node->add_property("Name",   _name);
353
354         XMLNode* available_for_channels = node->add_child("AvailableForChannels");
355         assert(available_for_channels);
356
357         for (uint8_t channel = 0; channel < 16; ++channel) {
358                 XMLNode* available_channel = available_for_channels->add_child("AvailableChannel");
359                 assert(available_channel);
360
361                 available_channel->add_property("Channel", (long) channel);
362
363                 if (_available_for_channels.find(channel) != _available_for_channels.end()) {
364                         available_channel->add_property("Available", "true");
365                 } else {
366                         available_channel->add_property("Available", "false");
367                 }
368         }
369
370         for (PatchBanks::iterator patch_bank = _patch_banks.begin();
371             patch_bank != _patch_banks.end();
372             ++patch_bank) {
373                 node->add_child_nocopy((*patch_bank)->get_state());
374         }
375
376         return *node;
377 }
378
379 int
380 ChannelNameSet::set_state (const XMLTree& tree, const XMLNode& node)
381 {
382         assert(node.name() == "ChannelNameSet");
383         _name   = node.property("Name")->value();
384
385         const XMLNodeList children = node.children();
386         for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) {
387                 XMLNode* node = *i;
388                 assert(node);
389                 if (node->name() == "AvailableForChannels") {
390                         boost::shared_ptr<XMLSharedNodeList> channels =
391                                 tree.find("//AvailableChannel[@Available = 'true']/@Channel", node);
392                         for(XMLSharedNodeList::const_iterator i = channels->begin();
393                             i != channels->end();
394                             ++i) {
395                                 _available_for_channels.insert(atoi((*i)->attribute_value().c_str()));
396                         }
397                 }
398
399                 if (node->name() == "PatchBank") {
400                         boost::shared_ptr<PatchBank> bank (new PatchBank ());
401                         bank->set_state(tree, *node);
402                         _patch_banks.push_back(bank);
403                         const PatchBank::PatchNameList& patches = bank->patch_name_list();
404                         for (PatchBank::PatchNameList::const_iterator patch = patches.begin();
405                              patch != patches.end();
406                              ++patch) {
407                                 _patch_map[(*patch)->patch_primary_key()] = *patch;
408                                 _patch_list.push_back((*patch)->patch_primary_key());
409                         }
410                 }
411         }
412
413         return 0;
414 }
415
416 int
417 CustomDeviceMode::set_state(const XMLTree& tree, const XMLNode& a_node)
418 {
419         assert(a_node.name() == "CustomDeviceMode");
420
421         _name = a_node.property("Name")->value();
422
423         boost::shared_ptr<XMLSharedNodeList> channel_name_set_assignments =
424                 tree.find("//ChannelNameSetAssign", const_cast<XMLNode *>(&a_node));
425         for(XMLSharedNodeList::const_iterator i = channel_name_set_assignments->begin();
426             i != channel_name_set_assignments->end();
427             ++i) {
428                 int channel = atoi((*i)->property("Channel")->value().c_str());
429                 string name_set = (*i)->property("NameSet")->value();
430                 assert( 1 <= channel && channel <= 16 );
431                 _channel_name_set_assignments[channel - 1] = name_set;
432         }
433         return 0;
434 }
435
436 XMLNode&
437 CustomDeviceMode::get_state(void)
438 {
439         XMLNode* custom_device_mode = new XMLNode("CustomDeviceMode");
440         custom_device_mode->add_property("Name",   _name);
441         XMLNode* channel_name_set_assignments =
442                 custom_device_mode->add_child("ChannelNameSetAssignments");
443         for (int i = 0; i < 15 && !_channel_name_set_assignments[i].empty(); i++) {
444                 XMLNode* channel_name_set_assign =
445                         channel_name_set_assignments->add_child("ChannelNameSetAssign");
446                 channel_name_set_assign->add_property("Channel", i + 1);
447                 channel_name_set_assign->add_property("NameSet", _channel_name_set_assignments[i]);
448         }
449
450         return *custom_device_mode;
451 }
452
453 boost::shared_ptr<CustomDeviceMode> 
454 MasterDeviceNames::custom_device_mode_by_name(std::string mode_name)
455 {
456         // can't assert this, since in many of the patch files the mode name is empty
457         //assert(mode_name != "");
458         return _custom_device_modes[mode_name];
459 }
460
461 boost::shared_ptr<ChannelNameSet> 
462 MasterDeviceNames::channel_name_set_by_device_mode_and_channel(std::string mode, uint8_t channel)
463 {
464         boost::shared_ptr<CustomDeviceMode> cdm = custom_device_mode_by_name(mode);
465         boost::shared_ptr<ChannelNameSet> cns =  _channel_name_sets[cdm->channel_name_set_name_by_channel(channel)];
466         return cns;
467 }
468
469 boost::shared_ptr<Patch> 
470 MasterDeviceNames::find_patch(std::string mode, uint8_t channel, PatchPrimaryKey& key) 
471 {
472         return channel_name_set_by_device_mode_and_channel(mode, channel)->find_patch(key);
473 }
474
475 int
476 MasterDeviceNames::set_state(const XMLTree& tree, const XMLNode&)
477 {
478         // Manufacturer
479         boost::shared_ptr<XMLSharedNodeList> manufacturer = tree.find("//Manufacturer");
480         assert(manufacturer->size() == 1);
481         _manufacturer = manufacturer->front()->children().front()->content();
482
483         // Models
484         boost::shared_ptr<XMLSharedNodeList> models = tree.find("//Model");
485         assert(models->size() >= 1);
486         for (XMLSharedNodeList::iterator i = models->begin();
487              i != models->end();
488              ++i) {
489                 const XMLNodeList& contents = (*i)->children();
490                 assert(contents.size() == 1);
491                 XMLNode * content = *(contents.begin());
492                 assert(content->is_content());
493                 _models.push_back(content->content());
494         }
495
496         // CustomDeviceModes
497         boost::shared_ptr<XMLSharedNodeList> custom_device_modes = tree.find("//CustomDeviceMode");
498         for (XMLSharedNodeList::iterator i = custom_device_modes->begin();
499              i != custom_device_modes->end();
500              ++i) {
501                 boost::shared_ptr<CustomDeviceMode> custom_device_mode(new CustomDeviceMode());
502                 custom_device_mode->set_state(tree, *(*i));
503
504                 _custom_device_modes[custom_device_mode->name()] = custom_device_mode;
505                 _custom_device_mode_names.push_back(custom_device_mode->name());
506         }
507
508         // ChannelNameSets
509         boost::shared_ptr<XMLSharedNodeList> channel_name_sets = tree.find("//ChannelNameSet");
510         for (XMLSharedNodeList::iterator i = channel_name_sets->begin();
511              i != channel_name_sets->end();
512              ++i) {
513                 boost::shared_ptr<ChannelNameSet> channel_name_set(new ChannelNameSet());
514                 channel_name_set->set_state(tree, *(*i));
515                 _channel_name_sets[channel_name_set->name()] = channel_name_set;
516         }
517
518         // NoteNameLists
519         boost::shared_ptr<XMLSharedNodeList> note_name_lists = tree.find("//NoteNameList");
520         for (XMLSharedNodeList::iterator i = note_name_lists->begin();
521              i != note_name_lists->end();
522              ++i) {
523                 boost::shared_ptr<NoteNameList> note_name_list(new NoteNameList());
524                 note_name_list->set_state (tree, *(*i));
525                 _note_name_lists.push_back(note_name_list);
526         }
527
528         // ControlNameLists
529         boost::shared_ptr<XMLSharedNodeList> control_name_lists = tree.find("//ControlNameList");
530         for (XMLSharedNodeList::iterator i = control_name_lists->begin();
531              i != control_name_lists->end();
532              ++i) {
533                 boost::shared_ptr<ControlNameList> control_name_list(new ControlNameList());
534                 control_name_list->set_state (tree, *(*i));
535                 _control_name_lists.push_back(control_name_list);
536         }
537
538         // global/post-facto PatchNameLists
539         boost::shared_ptr<XMLSharedNodeList> patch_name_lists = tree.find("/child::MIDINameDocument/child::MasterDeviceNames/child::PatchNameList");
540         for (XMLSharedNodeList::iterator i = patch_name_lists->begin();
541              i != patch_name_lists->end();
542              ++i) {
543
544                 PatchBank::PatchNameList patch_name_list;
545                 const XMLNodeList patches = (*i)->children();
546
547                 for (XMLNodeList::const_iterator p = patches.begin(); p != patches.end(); ++p) {
548                         boost::shared_ptr<Patch> patch (new Patch ());
549                         patch->set_state(tree, *(*p));
550                         patch_name_list.push_back(patch);
551                 }
552
553                 if (!patch_name_list.empty()) {
554                         _patch_name_lists[(*i)->property ("Name")->value()] = patch_name_list;
555                 }
556         }
557
558         /* now traverse patches and hook up anything that used UsePatchNameList
559          * to the right patch list
560          */
561
562         for (ChannelNameSets::iterator cns = _channel_name_sets.begin(); cns != _channel_name_sets.end(); ++cns) {
563                 ChannelNameSet::PatchBanks pbs = cns->second->patch_banks();
564                 PatchNameLists::iterator p;
565
566                 for (ChannelNameSet::PatchBanks::iterator pb = pbs.begin(); pb != pbs.end(); ++pb) {
567                         std::string pln = (*pb)->patch_list_name();
568                         if (!pln.empty()) {
569                                 if ((p = _patch_name_lists.find (pln)) != _patch_name_lists.end()) {
570                                         if ((*pb)->set_patch_name_list (p->second)) {
571                                                 return -1;
572                                         }
573                                         cns->second->use_patch_name_list (p->second);
574                                 } else {
575                                         error << string_compose ("Patch list name %1 was not found - patch file ignored", pln) << endmsg;
576                                         return -1;
577                                 }
578                         }
579                 }
580
581         }
582
583         return 0;
584 }
585
586 XMLNode&
587 MasterDeviceNames::get_state(void)
588 {
589         static XMLNode nothing("<nothing>");
590         return nothing;
591 }
592
593 MIDINameDocument::MIDINameDocument (const string& filename)
594 {
595         if (!_document.read (filename)) {
596                 throw failed_constructor ();
597         }
598
599         set_state (_document, *_document.root());
600 }
601
602 int
603 MIDINameDocument::set_state (const XMLTree& tree, const XMLNode&)
604 {
605         // Author
606
607         boost::shared_ptr<XMLSharedNodeList> author = tree.find("//Author");
608         if (author->size() < 1) {
609                 error << "No author information in MIDNAM file" << endmsg;
610                 return -1;
611         }
612         
613         if (author->front()->children().size() > 0) {
614                 _author = author->front()->children().front()->content();
615         }
616
617         // MasterDeviceNames
618
619         boost::shared_ptr<XMLSharedNodeList> master_device_names_list = tree.find ("//MasterDeviceNames");
620
621         for (XMLSharedNodeList::iterator i = master_device_names_list->begin();
622              i != master_device_names_list->end();
623              ++i) {
624                 boost::shared_ptr<MasterDeviceNames> master_device_names(new MasterDeviceNames());
625
626                 if (master_device_names->set_state(tree, *(*i))) {
627                         return -1;
628                 }
629
630                 for (MasterDeviceNames::Models::const_iterator model = master_device_names->models().begin();
631                      model != master_device_names->models().end();
632                      ++model) {
633                         _master_device_names_list.insert(
634                                 std::pair<std::string, boost::shared_ptr<MasterDeviceNames> >
635                                 (*model,      master_device_names));
636                         
637                         _all_models.push_back(*model);
638                 }
639         }
640
641         return 0;
642 }
643
644 XMLNode&
645 MIDINameDocument::get_state(void)
646 {
647         static XMLNode nothing("<nothing>");
648         return nothing;
649 }
650
651 boost::shared_ptr<MasterDeviceNames>
652 MIDINameDocument::master_device_names(const std::string& model)
653 {
654         MasterDeviceNamesList::const_iterator m = _master_device_names_list.find(model);
655         if (m != _master_device_names_list.end()) {
656                 return boost::shared_ptr<MasterDeviceNames>(m->second);
657         }
658         return boost::shared_ptr<MasterDeviceNames>();
659 }
660
661 const char* general_midi_program_names[128] = {
662         "Acoustic Grand Piano",
663         "Bright Acoustic Piano",
664         "Electric Grand Piano",
665         "Honky-tonk Piano",
666         "Rhodes Piano",
667         "Chorused Piano",
668         "Harpsichord",
669         "Clavinet",
670         "Celesta",
671         "Glockenspiel",
672         "Music Box",
673         "Vibraphone",
674         "Marimba",
675         "Xylophone",
676         "Tubular Bells",
677         "Dulcimer",
678         "Hammond Organ",
679         "Percussive Organ",
680         "Rock Organ",
681         "Church Organ",
682         "Reed Organ",
683         "Accordion",
684         "Harmonica",
685         "Tango Accordion",
686         "Acoustic Guitar (nylon)",
687         "Acoustic Guitar (steel)",
688         "Electric Guitar (jazz)",
689         "Electric Guitar (clean)",
690         "Electric Guitar (muted)",
691         "Overdriven Guitar",
692         "Distortion Guitar",
693         "Guitar Harmonics",
694         "Acoustic Bass",
695         "Electric Bass (finger)",
696         "Electric Bass (pick)",
697         "Fretless Bass",
698         "Slap Bass 1",
699         "Slap Bass 2",
700         "Synth Bass 1",
701         "Synth Bass 2",
702         "Violin",
703         "Viola",
704         "Cello",
705         "Contrabass",
706         "Tremolo Strings",
707         "Pizzicato Strings",
708         "Orchestral Harp",
709         "Timpani",
710         "String Ensemble 1",
711         "String Ensemble 2",
712         "SynthStrings 1",
713         "SynthStrings 2",
714         "Choir Aahs",
715         "Voice Oohs",
716         "Synth Voice",
717         "Orchestra Hit",
718         "Trumpet",
719         "Trombone",
720         "Tuba",
721         "Muted Trumpet",
722         "French Horn",
723         "Brass Section",
724         "Synth Brass 1",
725         "Synth Brass 2",
726         "Soprano Sax",
727         "Alto Sax",
728         "Tenor Sax",
729         "Baritone Sax",
730         "Oboe",
731         "English Horn",
732         "Bassoon",
733         "Clarinet",
734         "Piccolo",
735         "Flute",
736         "Recorder",
737         "Pan Flute",
738         "Bottle Blow",
739         "Shakuhachi",
740         "Whistle",
741         "Ocarina",
742         "Lead 1 (square)",
743         "Lead 2 (sawtooth)",
744         "Lead 3 (calliope lead)",
745         "Lead 4 (chiff lead)",
746         "Lead 5 (charang)",
747         "Lead 6 (voice)",
748         "Lead 7 (fifths)",
749         "Lead 8 (bass + lead)",
750         "Pad 1 (new age)",
751         "Pad 2 (warm)",
752         "Pad 3 (polysynth)",
753         "Pad 4 (choir)",
754         "Pad 5 (bowed)",
755         "Pad 6 (metallic)",
756         "Pad 7 (halo)",
757         "Pad 8 (sweep)",
758         "FX 1 (rain)",
759         "FX 2 (soundtrack)",
760         "FX 3 (crystal)",
761         "FX 4 (atmosphere)",
762         "FX 5 (brightness)",
763         "FX 6 (goblins)",
764         "FX 7 (echoes)",
765         "FX 8 (sci-fi)",
766         "Sitar",
767         "Banjo",
768         "Shamisen",
769         "Koto",
770         "Kalimba",
771         "Bagpipe",
772         "Fiddle",
773         "Shanai",
774         "Tinkle Bell",
775         "Agogo",
776         "Steel Drums",
777         "Woodblock",
778         "Taiko Drum",
779         "Melodic Tom",
780         "Synth Drum",
781         "Reverse Cymbal",
782         "Guitar Fret Noise",
783         "Breath Noise",
784         "Seashore",
785         "Bird Tweet",
786         "Telephone Ring",
787         "Helicopter",
788         "Applause",
789         "Gunshot",
790 };
791
792 } //namespace Name
793
794 } //namespace MIDI
795