File: Bank.cpp

package info (click to toggle)
csound-plugins 1.0.2~dfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,960 kB
  • sloc: cpp: 16,586; ansic: 7,522; python: 458; sh: 94; makefile: 25
file content (190 lines) | stat: -rw-r--r-- 4,639 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/*
    Bank.cpp:

    Copyright (C) 2006 Steven Yi

    This file is part of Csound.

    The Csound Library is free software; you can redistribute it
    and/or modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    Csound is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with Csound; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
    02110-1301 USA
*/

#include "Bank.hpp"

static char* gm[] = {
  (char *)"Acoustic Grand",
  (char *)"Bright Acoustic",
  (char *)"Electric Grand",
  (char *)"Honky-Tonk",
  (char *)"Electric Piano 1",
  (char *)"Electric Piano 2",
  (char *)"Harpsichord",
  (char *)"Clavinet",

  (char *)"Celesta",
  (char *)"Glockenspiel",
  (char *)"Music Box",
  (char *)"Vibraphone",
  (char *)"Marimba",
  (char *)"Xylophone",
  (char *)"Tubular Bells",
  (char *)"Dulcimer",

  (char *)"Drawbar Organ",
  (char *)"Percussive Organ",
  (char *)"Rock Organ",
  (char *)"Church Organ",
  (char *)"Reed Organ",
  (char *)"Accoridan",
  (char *)"Harmonica",
  (char *)"Tango Accordian",

  (char *)"Nylon String Guitar",
  (char *)"Steel String Guitar",
  (char *)"Electric Jazz Guitar",
  (char *)"Electric Clean Guitar",
  (char *)"Electric Muted Guitar",
  (char *)"Overdriven Guitar",
  (char *)"Distortion Guitar",
  (char *)"Guitar Harmonics",

  (char *)"Acoustic Bass",
  (char *)"Electric Bass(finger)",
  (char *)"Electric Bass(pick)",
  (char *)"Fretless Bass",
  (char *)"Slap Bass 1",
  (char *)"Slap Bass 2",
  (char *)"Synth Bass 1",
  (char *)"Synth Bass 2",

  (char *)"Violin",
  (char *)"Viola",
  (char *)"Cello",
  (char *)"Contrabass",
  (char *)"Tremolo Strings",
  (char *)"Pizzicato Strings",
  (char *)"Orchestral Strings",
  (char *)"Timpani",

  (char *)"String Ensemble 1",
  (char *)"String Ensemble 2",
  (char *)"SynthStrings 1",
  (char *)"SynthStrings 2",
  (char *)"Choir Aahs",
  (char *)"Voice Oohs",
  (char *)"Synth Voice",
  (char *)"Orchestra Hit",

  (char *)"Trumpet",
  (char *)"Trombone",
  (char *)"Tuba",
  (char *)"Muted Trumpet",
  (char *)"French Horn",
  (char *)"Brass Section",
  (char *)"SynthBrass 1",
  (char *)"SynthBrass 2",

  (char *)"Soprano Sax",
  (char *)"Alto Sax",
  (char *)"Tenor Sax",
  (char *)"Baritone Sax",
  (char *)"Oboe",
  (char *)"English Horn",
  (char *)"Bassoon",
  (char *)"Clarinet",

  (char *)"Piccolo",
  (char *)"Flute",
  (char *)"Recorder",
  (char *)"Pan Flute",
  (char *)"Blown Bottle",
  (char *)"Skakuhachi",
  (char *)"Whistle",
  (char *)"Ocarina",

  (char *)"Lead 1 (square)",
  (char *)"Lead 2 (sawtooth)",
  (char *)"Lead 3 (calliope)",
  (char *)"Lead 4 (chiff)",
  (char *)"Lead 5 (charang)",
  (char *)"Lead 6 (voice)",
  (char *)"Lead 7 (fifths)",
  (char *)"Lead 8 (bass+lead)",

  (char *)"Pad 1 (new age)",
  (char *)"Pad 2 (warm)",
  (char *)"Pad 3 (polysynth)",
  (char *)"Pad 4 (choir)",
  (char *)"Pad 5 (bowed)",
  (char *)"Pad 6 (metallic)",
  (char *)"Pad 7 (halo)",
  (char *)"Pad 8 (sweep)",

  (char *)"FX 1 (rain)",
  (char *)"FX 2 (soundtrack)",
  (char *)"FX 3 (crystal)",
  (char *)"FX 4 (atmosphere)",
  (char *)"FX 5 (brightness)",
  (char *)"FX 6 (goblins)",
  (char *)"FX 7 (echoes)",
  (char *)"FX 8 (sci-fi)",

  (char *)"Sitar",
  (char *)"Banjo",
  (char *)"Shamisen",
  (char *)"Koto",
  (char *)"Kalimba",
  (char *)"Bagpipe",
  (char *)"Fiddle",
  (char *)"Shanai",

  (char *)"Tinkle Bell",
  (char *)"Agogo",
  (char *)"Steel Drums",
  (char *)"Woodblock",
  (char *)"Taiko Drum",
  (char *)"Melodic Tom",
  (char *)"Synth Drum",
  (char *)"Reverse Cymbal",

  (char *)"Guitar Fret Noise",
  (char *)"Breath Noise",
  (char *)"Seashore",
  (char *)"Bird Tweet",
  (char *)"Telephone Ring",
  (char *)"Helicopter",
  (char *)"Applause",
  (char *)"Gunshot"
};

Bank::Bank(CSOUND *csound, char* bankName) : bankNum(0) {
        this->name = bankName;
        IGN(csound);
        currentProgram = 0;
        previousProgram = -1;
}

Bank::~Bank() {
        while( !programs.empty() ) {
        programs.erase( programs.begin() );
        }
}

void Bank::initializeGM() {
        for(int i = 0; i < 128; i++) {
                Program temp(i, gm[i]);
                this->programs.push_back(temp);
        }
}