1 : <?php
2 :
3 : /**
4 : * \Midi\Util\Instrument
5 : *
6 : * @package Midi
7 : * @subpackage Util
8 : * @copyright © 2009 Tommy Montgomery <http://phpmidiparser.com/>
9 : * @since 1.0
10 : */
11 :
12 : namespace Midi\Util;
13 :
14 : /**
15 : * Enumeration representing each of the 128 MIDI instruments
16 : *
17 : * @package Midi
18 : * @subpackage Util
19 : * @copyright © 2009 Tommy Montgomery <http://phpmidiparser.com/>
20 : * @since 1.0
21 : */
22 1 : final class Instrument {
23 : /**
24 : * Concert Grand (MIDI instrument 0)
25 : *
26 : * @var int
27 : */
28 : const ConcertGrand = 0;
29 : /**
30 : * Piano (MIDI instrument 1)
31 : *
32 : * @var int
33 : */
34 : const Piano = 1;
35 : /**
36 : * Electric Piano (MIDI instrument 2)
37 : *
38 : * @var int
39 : */
40 : const ElectricPiano = 2;
41 : /**
42 : * Honky Tonk (MIDI instrument 3)
43 : *
44 : * @var int
45 : */
46 : const HonkyTonk = 3;
47 : /**
48 : * Fender Rhodes Electric Piano (MIDI instrument 4)
49 : *
50 : * @var int
51 : */
52 : const FenderRhodesElectricPiano = 4;
53 : /**
54 : * Piano with Chorus (MIDI instrument 5)
55 : *
56 : * @var int
57 : */
58 : const PianoWithChorus = 5;
59 : /**
60 : * Harpsichord (MIDI instrument 6)
61 : *
62 : * @var int
63 : */
64 : const Harpsichord = 6;
65 : /**
66 : * Hohner Clavinet D6 (MIDI instrument 7)
67 : *
68 : * @var int
69 : */
70 : const HohnerClavinetD6 = 7;
71 : /**
72 : * Celesta (MIDI instrument 8)
73 : *
74 : * @var int
75 : */
76 : const Celesta = 8;
77 : /**
78 : * Glockenspiel (MIDI instrument 9)
79 : *
80 : * @var int
81 : */
82 : const Glockenspiel = 9;
83 : /**
84 : * Music Box (MIDI instrument 10)
85 : *
86 : * @var int
87 : */
88 : const MusicBox = 10;
89 : /**
90 : * Vibraphone (MIDI instrument 11)
91 : *
92 : * @var int
93 : */
94 : const Vibraphone = 11;
95 : /**
96 : * Marimba (MIDI instrument 12)
97 : *
98 : * @var int
99 : */
100 : const Marimba = 12;
101 : /**
102 : * Xylophone (MIDI instrument 13)
103 : *
104 : * @var int
105 : */
106 : const Xylophone = 13;
107 : /**
108 : * Tubular Bells (MIDI instrument 14)
109 : *
110 : * @var int
111 : */
112 : const TubularBells = 14;
113 : /**
114 : * Dulcimer (MIDI instrument 15)
115 : *
116 : * @var int
117 : */
118 : const Dulcimer = 15;
119 : /**
120 : * Hammond Organ (MIDI instrument 16)
121 : *
122 : * @var int
123 : */
124 : const HammondOrgan = 16;
125 : /**
126 : * Percussive Organ (MIDI instrument 17)
127 : *
128 : * @var int
129 : */
130 : const PercussiveOrgan = 17;
131 : /**
132 : * Rock Organ (MIDI instrument 18)
133 : *
134 : * @var int
135 : */
136 : const RockOrgan = 18;
137 : /**
138 : * Church Organ (MIDI instrument 19)
139 : *
140 : * @var int
141 : */
142 : const ChurchOrgan = 19;
143 : /**
144 : * Reed Organ (MIDI instrument 20)
145 : *
146 : * @var int
147 : */
148 : const ReedOrgan = 20;
149 : /**
150 : * Accordion (MIDI instrument 21)
151 : *
152 : * @var int
153 : */
154 : const Accordion = 21;
155 : /**
156 : * Harmonica (MIDI instrument 22)
157 : *
158 : * @var int
159 : */
160 : const Harmonica = 22;
161 : /**
162 : * Tango Accordion (MIDI instrument 23)
163 : *
164 : * @var int
165 : */
166 : const TangoAccordion = 23;
167 : /**
168 : * Acoustic Guitar (nylon) (MIDI instrument 24)
169 : *
170 : * @var int
171 : */
172 : const AcousticGuitarNylon = 24;
173 : /**
174 : * Acoustic Guitar (steel) (MIDI instrument 25)
175 : *
176 : * @var int
177 : */
178 : const AcousticGuitarSteel = 25;
179 : /**
180 : * Electric Guitar (jazz) (MIDI instrument 26)
181 : *
182 : * @var int
183 : */
184 : const ElectricGuitarJazz = 26;
185 : /**
186 : * Electric Guitar (clean) (MIDI instrument 27)
187 : *
188 : * @var int
189 : */
190 : const ElectricGuitarClean = 27;
191 : /**
192 : * Electric Guitar (muted) (MIDI instrument 28)
193 : *
194 : * @var int
195 : */
196 : const ElectricGuitarMuted = 28;
197 : /**
198 : * Electric Guitar (overdriven) (MIDI instrument 29)
199 : *
200 : * @var int
201 : */
202 : const ElectricGuitarOverdriven = 29;
203 : /**
204 : * Electric Guitar (distorted) (MIDI instrument 30)
205 : *
206 : * @var int
207 : */
208 : const ElectricGuitarDistorted = 30;
209 : /**
210 : * Guitar Harmonics (MIDI instrument 31)
211 : *
212 : * @var int
213 : */
214 : const GuitarHarmonics = 31;
215 : /**
216 : * Double Bass (finger) (MIDI instrument 32)
217 : *
218 : * @var int
219 : */
220 : const DoubleBassFinger = 32;
221 : /**
222 : * Electric Bass (finger) (MIDI instrument 33)
223 : *
224 : * @var int
225 : */
226 : const ElectricBassFinger = 33;
227 : /**
228 : * Electric Bass (plectrum) (MIDI instrument 34)
229 : *
230 : * @var int
231 : */
232 : const ElectricBassPlectrum = 34;
233 : /**
234 : * Fretless Bass (MIDI instrument 35)
235 : *
236 : * @var int
237 : */
238 : const FretlessBass = 35;
239 : /**
240 : * Slap Bass 1 (MIDI instrument 36)
241 : *
242 : * @var int
243 : */
244 : const SlapBass1 = 36;
245 : /**
246 : * Slap Bass 2 (MIDI instrument 37)
247 : *
248 : * @var int
249 : */
250 : const SlapBass2 = 37;
251 : /**
252 : * Synthesizer Bass 1 (MIDI instrument 38)
253 : *
254 : * @var int
255 : */
256 : const SynthesizerBass1 = 38;
257 : /**
258 : * Synthesizer Bass 2 (MIDI instrument 39)
259 : *
260 : * @var int
261 : */
262 : const SynthesizerBass2 = 39;
263 : /**
264 : * Violin (MIDI instrument 40)
265 : *
266 : * @var int
267 : */
268 : const Violin = 40;
269 : /**
270 : * Viola (MIDI instrument 41)
271 : *
272 : * @var int
273 : */
274 : const Viola = 41;
275 : /**
276 : * Cello (MIDI instrument 42)
277 : *
278 : * @var int
279 : */
280 : const Cello = 42;
281 : /**
282 : * Double Bass (bowed) (MIDI instrument 43)
283 : *
284 : * @var int
285 : */
286 : const DoubleBassBowed = 43;
287 : /**
288 : * Violin (tremolo) (MIDI instrument 44)
289 : *
290 : * @var int
291 : */
292 : const ViolinTremolo = 44;
293 : /**
294 : * Violin (pizzicato) (MIDI instrument 45)
295 : *
296 : * @var int
297 : */
298 : const ViolinPizzicato = 45;
299 : /**
300 : * Orchestra Harp (MIDI instrument 46)
301 : *
302 : * @var int
303 : */
304 : const OrchestraHarp = 46;
305 : /**
306 : * Drum (MIDI instrument 47)
307 : *
308 : * @var int
309 : */
310 : const Drum = 47;
311 : /**
312 : * String Ensemble 1 (MIDI instrument 48)
313 : *
314 : * @var int
315 : */
316 : const StringEnsemble1 = 48;
317 : /**
318 : * String Ensemble 2 (MIDI instrument 49)
319 : *
320 : * @var int
321 : */
322 : const StringEnsemble2 = 49;
323 : /**
324 : * Synthesizer Strings 1 (MIDI instrument 50)
325 : *
326 : * @var int
327 : */
328 : const SynthesizerStrings1 = 50;
329 : /**
330 : * Synthesizer Strings 2 (MIDI instrument 51)
331 : *
332 : * @var int
333 : */
334 : const SynthesizerStrings2 = 51;
335 : /**
336 : * Choir Aahs (MIDI instrument 52)
337 : *
338 : * @var int
339 : */
340 : const ChoirAahs = 52;
341 : /**
342 : * Choir Oohs (MIDI instrument 53)
343 : *
344 : * @var int
345 : */
346 : const ChoirOohs = 53;
347 : /**
348 : * Synthesizer Voice (MIDI instrument 54)
349 : *
350 : * @var int
351 : */
352 : const SynthesizerVoice = 54;
353 : /**
354 : * Orchestra Complete (MIDI instrument 55)
355 : *
356 : * @var int
357 : */
358 : const OrchestraComplete = 55;
359 : /**
360 : * Trumpet (MIDI instrument 56)
361 : *
362 : * @var int
363 : */
364 : const Trumpet = 56;
365 : /**
366 : * Trombone (MIDI instrument 57)
367 : *
368 : * @var int
369 : */
370 : const Trombone = 57;
371 : /**
372 : * Tuba (MIDI instrument 58)
373 : *
374 : * @var int
375 : */
376 : const Tuba = 58;
377 : /**
378 : * Muted Trumpet (MIDI instrument 59)
379 : *
380 : * @var int
381 : */
382 : const MutedTrumpet = 59;
383 : /**
384 : * Horn (MIDI instrument 60)
385 : *
386 : * @var int
387 : */
388 : const Horn = 60;
389 : /**
390 : * Brass Section (MIDI instrument 61)
391 : *
392 : * @var int
393 : */
394 : const BrassSection = 61;
395 : /**
396 : * Synthesizer Brass 1 (MIDI instrument 62)
397 : *
398 : * @var int
399 : */
400 : const SynthesizerBrass1 = 62;
401 : /**
402 : * Synthesizer Brass 2 (MIDI instrument 63)
403 : *
404 : * @var int
405 : */
406 : const SynthesizerBrass2 = 63;
407 : /**
408 : * Soprano Saxophone (MIDI instrument 64)
409 : *
410 : * @var int
411 : */
412 : const SopranoSaxophone = 64;
413 : /**
414 : * Alto Saxophone (MIDI instrument 65)
415 : *
416 : * @var int
417 : */
418 : const AltoSaxophone = 65;
419 : /**
420 : * Tenor Saxophone (MIDI instrument 66)
421 : *
422 : * @var int
423 : */
424 : const TenorSaxophone = 66;
425 : /**
426 : * Baritone Saxophone (MIDI instrument 67)
427 : *
428 : * @var int
429 : */
430 : const BaritoneSaxophone = 67;
431 : /**
432 : * Oboe (MIDI instrument 68)
433 : *
434 : * @var int
435 : */
436 : const Oboe = 68;
437 : /**
438 : * English Horn (MIDI instrument 69)
439 : *
440 : * @var int
441 : */
442 : const EnglishHorn = 69;
443 : /**
444 : * Bassoon (MIDI instrument 70)
445 : *
446 : * @var int
447 : */
448 : const Bassoon = 70;
449 : /**
450 : * Clarinet (MIDI instrument 71)
451 : *
452 : * @var int
453 : */
454 : const Clarinet = 71;
455 : /**
456 : * Piccolo Flute (MIDI instrument 72)
457 : *
458 : * @var int
459 : */
460 : const PiccoloFlute = 72;
461 : /**
462 : * Flute (MIDI instrument 73)
463 : *
464 : * @var int
465 : */
466 : const Flute = 73;
467 : /**
468 : * Recorder (MIDI instrument 74)
469 : *
470 : * @var int
471 : */
472 : const Recorder = 74;
473 : /**
474 : * Pan Pipes (MIDI instrument 75)
475 : *
476 : * @var int
477 : */
478 : const PanPipes = 75;
479 : /**
480 : * Bottle Blow (MIDI instrument 76)
481 : *
482 : * @var int
483 : */
484 : const BottleBlow = 76;
485 : /**
486 : * Shakuhachi (MIDI instrument 77)
487 : *
488 : * @var int
489 : */
490 : const Shakuhachi = 77;
491 : /**
492 : * Whistle (MIDI instrument 78)
493 : *
494 : * @var int
495 : */
496 : const Whistle = 78;
497 : /**
498 : * Ocarina (MIDI instrument 79)
499 : *
500 : * @var int
501 : */
502 : const Ocarina = 79;
503 : /**
504 : * Square (synth) (MIDI instrument 80)
505 : *
506 : * @var int
507 : */
508 : const SquareSynth = 80;
509 : /**
510 : * Saw Tooth (synth) (MIDI instrument 81)
511 : *
512 : * @var int
513 : */
514 : const SawToothSynth = 81;
515 : /**
516 : * Caliope (synth) (MIDI instrument 82)
517 : *
518 : * @var int
519 : */
520 : const CaliopeSynth = 82;
521 : /**
522 : * Chiff (synth) (MIDI instrument 83)
523 : *
524 : * @var int
525 : */
526 : const ChiffSynth = 83;
527 : /**
528 : * Charang (synth) (MIDI instrument 84)
529 : *
530 : * @var int
531 : */
532 : const CharangSynth = 84;
533 : /**
534 : * Voice (synth) (MIDI instrument 85)
535 : *
536 : * @var int
537 : */
538 : const VoiceSynth = 85;
539 : /**
540 : * Fifth (synth) (MIDI instrument 86)
541 : *
542 : * @var int
543 : */
544 : const FifthSynth = 86;
545 : /**
546 : * Brass+Lead (synth) (MIDI instrument 87)
547 : *
548 : * @var int
549 : */
550 : const BrassLeadSynth = 87;
551 : /**
552 : * New Age (synth pad) (MIDI instrument 88)
553 : *
554 : * @var int
555 : */
556 : const NewAgeSynthPad = 88;
557 : /**
558 : * Warm (synth pad) (MIDI instrument 89)
559 : *
560 : * @var int
561 : */
562 : const WarmSynthPad = 89;
563 : /**
564 : * Polysynth (synth pad) (MIDI instrument 90)
565 : *
566 : * @var int
567 : */
568 : const PolysynthSynthPad = 90;
569 : /**
570 : * Choir (synth pad) (MIDI instrument 91)
571 : *
572 : * @var int
573 : */
574 : const ChoirSynthPad = 91;
575 : /**
576 : * Bowed (synth pad) (MIDI instrument 92)
577 : *
578 : * @var int
579 : */
580 : const BowedSynthPad = 92;
581 : /**
582 : * Metallic (synth pad) (MIDI instrument 93)
583 : *
584 : * @var int
585 : */
586 : const MetallicSynthPad = 93;
587 : /**
588 : * Halo (synth pad) (MIDI instrument 94)
589 : *
590 : * @var int
591 : */
592 : const HaloSynthPad = 94;
593 : /**
594 : * Sweep (synth pad) (MIDI instrument 95)
595 : *
596 : * @var int
597 : */
598 : const SweepSynthPad = 95;
599 : /**
600 : * Rain (synth effect) (MIDI instrument 96)
601 : *
602 : * @var int
603 : */
604 : const RainSynthEffect = 96;
605 : /**
606 : * Soundtrack (synth effect) (MIDI instrument 97)
607 : *
608 : * @var int
609 : */
610 : const SoundtrackSynthEffect = 97;
611 : /**
612 : * Crystal (synth effect) (MIDI instrument 98)
613 : *
614 : * @var int
615 : */
616 : const CrystalSynthEffect = 98;
617 : /**
618 : * Atmosphere (synth effect) (MIDI instrument 99)
619 : *
620 : * @var int
621 : */
622 : const AtmosphereSynthEffect = 99;
623 : /**
624 : * Brightness (synth effect) (MIDI instrument 100)
625 : *
626 : * @var int
627 : */
628 : const BrightnessSynthEffect = 100;
629 : /**
630 : * Goblins (synth effect) (MIDI instrument 101)
631 : *
632 : * @var int
633 : */
634 : const GoblinsSynthEffect = 101;
635 : /**
636 : * Echoes (synth effect) (MIDI instrument 102)
637 : *
638 : * @var int
639 : */
640 : const EchoesSynthEffect = 102;
641 : /**
642 : * Sci Fi (synth effect) (MIDI instrument 103)
643 : *
644 : * @var int
645 : */
646 : const SciFiSynthEffect = 103;
647 : /**
648 : * Sitar (MIDI instrument 104)
649 : *
650 : * @var int
651 : */
652 : const Sitar = 104;
653 : /**
654 : * Banjo (MIDI instrument 105)
655 : *
656 : * @var int
657 : */
658 : const Banjo = 105;
659 : /**
660 : * Shamisen (MIDI instrument 106)
661 : *
662 : * @var int
663 : */
664 : const Shamisen = 106;
665 : /**
666 : * Koto (MIDI instrument 107)
667 : *
668 : * @var int
669 : */
670 : const Koto = 107;
671 : /**
672 : * Kalimba (MIDI instrument 108)
673 : *
674 : * @var int
675 : */
676 : const Kalimba = 108;
677 : /**
678 : * Bagpipe (MIDI instrument 109)
679 : *
680 : * @var int
681 : */
682 : const Bagpipe = 109;
683 : /**
684 : * Fiddle (MIDI instrument 110)
685 : *
686 : * @var int
687 : */
688 : const Fiddle = 110;
689 : /**
690 : * Shanai (MIDI instrument 111)
691 : *
692 : * @var int
693 : */
694 : const Shanai = 111;
695 : /**
696 : * Tinkle Bell (MIDI instrument 112)
697 : *
698 : * @var int
699 : */
700 : const TinkleBell = 112;
701 : /**
702 : * Agogo (MIDI instrument 113)
703 : *
704 : * @var int
705 : */
706 : const Agogo = 113;
707 : /**
708 : * Steel Drum (MIDI instrument 114)
709 : *
710 : * @var int
711 : */
712 : const SteelDrum = 114;
713 : /**
714 : * Woodblock (MIDI instrument 115)
715 : *
716 : * @var int
717 : */
718 : const Woodblock = 115;
719 : /**
720 : * Taiko-drum (MIDI instrument 116)
721 : *
722 : * @var int
723 : */
724 : const Taikodrum = 116;
725 : /**
726 : * Melodic Tom (MIDI instrument 117)
727 : *
728 : * @var int
729 : */
730 : const MelodicTom = 117;
731 : /**
732 : * Synthesized Drum (MIDI instrument 118)
733 : *
734 : * @var int
735 : */
736 : const SynthesizedDrum = 118;
737 : /**
738 : * Cymbal Hi-Hat (MIDI instrument 119)
739 : *
740 : * @var int
741 : */
742 : const CymbalHiHat = 119;
743 : /**
744 : * Guitar Fret Noise (MIDI instrument 120)
745 : *
746 : * @var int
747 : */
748 : const GuitarFretNoise = 120;
749 : /**
750 : * Breath Noise (MIDI instrument 121)
751 : *
752 : * @var int
753 : */
754 : const BreathNoise = 121;
755 : /**
756 : * Seashore (MIDI instrument 122)
757 : *
758 : * @var int
759 : */
760 : const Seashore = 122;
761 : /**
762 : * Bird Song (MIDI instrument 123)
763 : *
764 : * @var int
765 : */
766 : const BirdSong = 123;
767 : /**
768 : * Telephone Ring (MIDI instrument 124)
769 : *
770 : * @var int
771 : */
772 : const TelephoneRing = 124;
773 : /**
774 : * Helicopter (MIDI instrument 125)
775 : *
776 : * @var int
777 : */
778 : const Helicopter = 125;
779 : /**
780 : * Applause (MIDI instrument 126)
781 : *
782 : * @var int
783 : */
784 : const Applause = 126;
785 : /**
786 : * Gunshot (MIDI instrument 127)
787 : *
788 : * @var int
789 : */
790 : const Gunshot = 127;
791 :
792 : private static $instrumentMap = array(
793 : self::ConcertGrand => 'Concert Grand',
794 : self::Piano => 'Piano',
795 : self::ElectricPiano => 'Electric Piano',
796 : self::HonkyTonk => 'Honky Tonk',
797 : self::FenderRhodesElectricPiano => 'Fender Rhodes Electric Piano',
798 : self::PianoWithChorus => 'Piano with Chorus',
799 : self::Harpsichord => 'Harpsichord',
800 : self::HohnerClavinetD6 => 'Hohner Clavinet D6',
801 : self::Celesta => 'Celesta',
802 : self::Glockenspiel => 'Glockenspiel',
803 : self::MusicBox => 'Music Box',
804 : self::Vibraphone => 'Vibraphone',
805 : self::Marimba => 'Marimba',
806 : self::Xylophone => 'Xylophone',
807 : self::TubularBells => 'Tubular Bells',
808 : self::Dulcimer => 'Dulcimer',
809 : self::HammondOrgan => 'Hammond Organ',
810 : self::PercussiveOrgan => 'Percussive Organ',
811 : self::RockOrgan => 'Rock Organ',
812 : self::ChurchOrgan => 'Church Organ',
813 : self::ReedOrgan => 'Reed Organ',
814 : self::Accordion => 'Accordion',
815 : self::Harmonica => 'Harmonica',
816 : self::TangoAccordion => 'Tango Accordion',
817 : self::AcousticGuitarNylon => 'Acoustic Guitar (nylon)',
818 : self::AcousticGuitarSteel => 'Acoustic Guitar (steel)',
819 : self::ElectricGuitarJazz => 'Electric Guitar (jazz)',
820 : self::ElectricGuitarClean => 'Electric Guitar (clean)',
821 : self::ElectricGuitarMuted => 'Electric Guitar (muted)',
822 : self::ElectricGuitarOverdriven => 'Electric Guitar (overdriven)',
823 : self::ElectricGuitarDistorted => 'Electric Guitar (distorted)',
824 : self::GuitarHarmonics => 'Guitar Harmonics',
825 : self::DoubleBassFinger => 'Double Bass (finger)',
826 : self::ElectricBassFinger => 'Electric Bass (finger)',
827 : self::ElectricBassPlectrum => 'Electric Bass (plectrum)',
828 : self::FretlessBass => 'Fretless Bass',
829 : self::SlapBass1 => 'Slap Bass 1',
830 : self::SlapBass2 => 'Slap Bass 2',
831 : self::SynthesizerBass1 => 'Synthesizer Bass 1',
832 : self::SynthesizerBass2 => 'Synthesizer Bass 2',
833 : self::Violin => 'Violin',
834 : self::Viola => 'Viola',
835 : self::Cello => 'Cello',
836 : self::DoubleBassBowed => 'Double Bass (bowed)',
837 : self::ViolinTremolo => 'Violin (tremolo)',
838 : self::ViolinPizzicato => 'Violin (pizzicato)',
839 : self::OrchestraHarp => 'Orchestra Harp',
840 : self::Drum => 'Drum',
841 : self::StringEnsemble1 => 'String Ensemble 1',
842 : self::StringEnsemble2 => 'String Ensemble 2',
843 : self::SynthesizerStrings1 => 'Synthesizer Strings 1',
844 : self::SynthesizerStrings2 => 'Synthesizer Strings 2',
845 : self::ChoirAahs => 'Choir Aahs',
846 : self::ChoirOohs => 'Choir Oohs',
847 : self::SynthesizerVoice => 'Synthesizer Voice',
848 : self::OrchestraComplete => 'Orchestra Complete',
849 : self::Trumpet => 'Trumpet',
850 : self::Trombone => 'Trombone',
851 : self::Tuba => 'Tuba',
852 : self::MutedTrumpet => 'Muted Trumpet',
853 : self::Horn => 'Horn',
854 : self::BrassSection => 'Brass Section',
855 : self::SynthesizerBrass1 => 'Synthesizer Brass 1',
856 : self::SynthesizerBrass2 => 'Synthesizer Brass 2',
857 : self::SopranoSaxophone => 'Soprano Saxophone',
858 : self::AltoSaxophone => 'Alto Saxophone',
859 : self::TenorSaxophone => 'Tenor Saxophone',
860 : self::BaritoneSaxophone => 'Baritone Saxophone',
861 : self::Oboe => 'Oboe',
862 : self::EnglishHorn => 'English Horn',
863 : self::Bassoon => 'Bassoon',
864 : self::Clarinet => 'Clarinet',
865 : self::PiccoloFlute => 'Piccolo Flute',
866 : self::Flute => 'Flute',
867 : self::Recorder => 'Recorder',
868 : self::PanPipes => 'Pan Pipes',
869 : self::BottleBlow => 'Bottle Blow',
870 : self::Shakuhachi => 'Shakuhachi',
871 : self::Whistle => 'Whistle',
872 : self::Ocarina => 'Ocarina',
873 : self::SquareSynth => 'Square (synth)',
874 : self::SawToothSynth => 'Saw Tooth (synth)',
875 : self::CaliopeSynth => 'Caliope (synth)',
876 : self::ChiffSynth => 'Chiff (synth)',
877 : self::CharangSynth => 'Charang (synth)',
878 : self::VoiceSynth => 'Voice (synth)',
879 : self::FifthSynth => 'Fifth (synth)',
880 : self::BrassLeadSynth => 'Brass+Lead (synth)',
881 : self::NewAgeSynthPad => 'New Age (synth pad)',
882 : self::WarmSynthPad => 'Warm (synth pad)',
883 : self::PolysynthSynthPad => 'Polysynth (synth pad)',
884 : self::ChoirSynthPad => 'Choir (synth pad)',
885 : self::BowedSynthPad => 'Bowed (synth pad)',
886 : self::MetallicSynthPad => 'Metallic (synth pad)',
887 : self::HaloSynthPad => 'Halo (synth pad)',
888 : self::SweepSynthPad => 'Sweep (synth pad)',
889 : self::RainSynthEffect => 'Rain (synth effect)',
890 : self::SoundtrackSynthEffect => 'Soundtrack (synth effect)',
891 : self::CrystalSynthEffect => 'Crystal (synth effect)',
892 : self::AtmosphereSynthEffect => 'Atmosphere (synth effect)',
893 : self::BrightnessSynthEffect => 'Brightness (synth effect)',
894 : self::GoblinsSynthEffect => 'Goblins (synth effect)',
895 : self::EchoesSynthEffect => 'Echoes (synth effect)',
896 : self::SciFiSynthEffect => 'Sci Fi (synth effect)',
897 : self::Sitar => 'Sitar',
898 : self::Banjo => 'Banjo',
899 : self::Shamisen => 'Shamisen',
900 : self::Koto => 'Koto',
901 : self::Kalimba => 'Kalimba',
902 : self::Bagpipe => 'Bagpipe',
903 : self::Fiddle => 'Fiddle',
904 : self::Shanai => 'Shanai',
905 : self::TinkleBell => 'Tinkle Bell',
906 : self::Agogo => 'Agogo',
907 : self::SteelDrum => 'Steel Drum',
908 : self::Woodblock => 'Woodblock',
909 : self::Taikodrum => 'Taiko-drum',
910 : self::MelodicTom => 'Melodic Tom',
911 : self::SynthesizedDrum => 'Synthesized Drum',
912 : self::CymbalHiHat => 'Cymbal Hi-Hat',
913 : self::GuitarFretNoise => 'Guitar Fret Noise',
914 : self::BreathNoise => 'Breath Noise',
915 : self::Seashore => 'Seashore',
916 : self::BirdSong => 'Bird Song',
917 : self::TelephoneRing => 'Telephone Ring',
918 : self::Helicopter => 'Helicopter',
919 : self::Applause => 'Applause',
920 : self::Gunshot => 'Gunshot'
921 : );
922 :
923 : /**
924 : * Gets the name of the specified MIDI instrument
925 : *
926 : * @since 1.0
927 : *
928 : * @param int $instrument One of the \Midi\Instrument constants
929 : * @throws InvalidArgumentException
930 : * @return string The friendly name of the MIDI instrument
931 : */
932 : public static function getInstrumentName($instrument) {
933 3 : if (!isset(self::$instrumentMap[$instrument])) {
934 1 : throw new \InvalidArgumentException('Invalid instrument; use one of the \Midi\Instrument constants');
935 : }
936 :
937 2 : return self::$instrumentMap[$instrument];
938 : }
939 : }
940 :
|