[go: up one dir, main page]

Menu

[21ef45]: / configure.sh  Maximize  Restore  History

Download this file

268 lines (260 with data), 9.0 kB

  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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
#!/bin/bash
read_char() {
stty -icanon -echo
eval "$1=\$(dd bs=1 count=1 2>/dev/null)"
stty icanon echo
}
clear
echo "Welcome to BackupBand's source code configuration tool. This"
echo "tool allows you to customize BackupBand's source code to compile"
echo "only those features you want, and remove features you don't want."
echo "You will be presented with a series of screens, each one asking"
echo "about a particular feature. When you're done, compiling BackupBand"
echo "will produce your customized version."
echo
echo "You need to run this tool once only to customize BackupBand's source"
echo "code. If you update to the latest source code, your customization"
echo "will automatically be applied to the new version."
echo
echo "If you later decide you'd like to restore a feature that you have"
echo -e "removed now, just run \033[1mconfigure.sh\033[0m again, and answer these"
echo "questions the right way this time. Stupid git."
echo
echo "To produce a version of BackupBand with its full features/options,"
echo -e "press the \033[1mEnter\033[0m key to every question you are asked. For example,"
echo -e "press the \033[1mEnter\033[0m key right now to start... monkey."
read_char ANS
clear
SYNTH="y"
ALSAAUDIO="y"
JACK="y"
REVERB="y"
SONG="y"
MIDIIN="y"
MIDIINCLOCK="y"
MIDIOUT="y"
SEQOUT="y"
SEQIN="y"
echo "Let's cut to the chase. Do you just want a vanilla version with all"
echo "possible features enabled? If so, this is the only question you need"
echo -e "to answer. Press the \033[1mEnter\033[0m key to receive the bloatware,"
echo "and then you can go back to surfing for porn on the internet. After"
echo "evaluating BackupBand, you can later run this tool to make a custom"
echo "version. And if you're still not satisfied, you can rerun this tool,"
echo "and go back to the full version."
echo
echo "Or would you rather become an unpaid beta tester for some oddball"
echo "experimental version that will probably destroy your system (not to"
echo "say the full version won't)?"
echo
echo "Do you just want the full version? Or do you want a customized one?"
echo
echo -e "Press \033[1mEnter\033[0m for the full steaming pile, or press \033[1mN\033[0m if not."
read_char ANS
if [ "$ANS" = "n" ]; then
clear
echo "Do you use a MIDI controller to operate BackupBand, or do you"
echo "instead use only the graphical user interface? For example, you"
echo "use the mouse on the graphical piano to change chords, or"
echo "use the computer's keyboard, or use a Song Sheet, or perhaps even"
echo "use another MIDI program to operate BackupBand (such as a Virtual"
echo "Piano program)."
echo
echo -e "Press \033[1mEnter\033[0m if you use a MIDI controller, or press \033[1mN\033[0m if"
echo "you can't afford one because you deliver pizzas for a living."
read_char ANS
if [ "$ANS" = "n" ]; then
MIDIIN="n"
MIDIINCLOCK="n"
else
clear
echo "Do you intend to sync BackupBand's tempo to some external"
echo "hardware's MIDI clock?"
echo
echo -e "Press \033[1mEnter\033[0m if yes, or press \033[1mN\033[0m if no."
read_char ANS
if [ "$ANS" = "n" ]; then
MIDIINCLOCK="n"
fi
fi
clear
echo "Do you intend to use another MIDI program to operate BackupBand"
echo "(such as a Virtual Piano program)?"
echo
echo -e "Press \033[1mEnter\033[0m if yes, or press \033[1mN\033[0m if no."
read_char ANS
if [ "$ANS" = "n" ]; then
SEQIN="n"
fi
clear
echo "BackupBand's bassist, guitarist, and drummer can make their sounds"
echo "using only BackupBand's internal audio engine, along with its own"
echo "sampled instruments or instruments you create for BackupBand."
echo "BackupBand's engine tracks you reliably, offers the lowest"
echo "latency, and is easy to configure."
echo
echo "Although harder to setup, and less reliable at tracking,"
echo "BackupBand offers the option of using additional software"
echo "synths/hosts for its bass, guitar, and drum sounds. This"
echo "includes Carla, LinuxSampler, Etc."
echo
echo "BackupBand can also use external hardware synths attached to"
echo "your computer via USB or a MIDI Interface."
echo
echo "Do you want these additional options? Or are you content using"
echo "only BackupBand's internal audio engine?"
echo
echo -e "Press \033[1mEnter\033[0m if you want these options, or press \033[1mN\033[0m if not."
read_char ANS
if [ "$ANS" = "n" ]; then
MIDIOUT="n"
SEQOUT="n"
else
clear
echo "If you don't ever intend to use external MIDI hardware synths,"
echo "you can simplify BackupBand's setup if you remove this feature."
echo
echo "Do you want the option to use external hardware synths?"
echo
echo -e "Press \033[1mEnter\033[0m to keep this option, or press \033[1mN\033[0m if not."
read_char ANS
if [ "$ANS" = "n" ]; then
MIDIOUT="n"
fi
clear
echo "BackupBand's internal audio engine involves a lot of code."
echo "Although you can turn it on or off within BackupBand's settings,"
echo "you'll save memory if you remove it entirely. Since you've"
echo "already admitted you'll use other software/hardware synths (you"
echo "gutless traitor!), maybe you're plotting its demise?"
echo
echo "Do you want to keep the internal engine, or remove it?"
echo
echo -e "Press \033[1mEnter\033[0m to keep the internal audio engine, or press \033[1mN\033[0m"
echo "if not."
read_char ANS
if [ "$ANS" = "n" ]; then
SYNTH="n"
ALSAAUDIO="n"
JACK="n"
REVERB="n"
fi
fi
if [ "$SYNTH" = "y" ]; then
clear
echo "BackupBand's internal audio engine can output sound directly to"
echo "your audio card. This offers the lowest latency, and is easy to"
echo "configure."
echo
echo "Although harder to setup, and more cpu demanding, BackupBand offers"
echo "the option of using an additional software layer known as JACK."
echo "You can switch between JACK and direct output within BackupBand's"
echo "settings. But if you use only one, you'll save memory and overhead"
echo "if you remove the other entirely."
echo
echo "Do you want to keep both options? Or will you use only JACK or"
echo "direct audio (but not both)?"
echo
echo -e "Press \033[1mEnter\033[0m to keep both options, press \033[1mJ\033[0m"
echo -e "if JACK only, or press \033[1mD\033[0m if direct audio only."
if [ "$ANS" = "d" ]; then
ALSAAUDIO="n"
fi
if [ "$ANS" = "j" ]; then
JACK="n"
fi
fi
if [ "$REVERB" = "y" ]; then
clear
echo "BackupBand includes a built-in software reverb as part of its"
echo "internal audio engine. Although you can turn it on or off"
echo "within BackupBand's settings, you'll save memory if you"
echo "remove it entirely."
echo
echo "Do you want to keep the reverb, or remove it?"
echo
echo -e "Press \033[1mEnter\033[0m to keep the reverb, or press \033[1mN\033[0m if not."
read_char ANS
if [ "$ANS" = "n" ]; then
REVERB="n"
fi
fi
clear
echo "Normally, BackupBand's bassist and guitarist monitor you while"
echo "you play your MIDI controller. They will detect every chord"
echo "you play and will follow you. But BackupBand has another"
echo "option where you tell BackupBand all the chord changes (and"
echo "when to play them) before you start playing. Essentially, you're"
echo "giving the bassist/guitarist a fake sheet, which we refer to as"
echo "a songsheet. They will store this song sheet, so that if you"
echo "ever want to replay this song, you need only tell them to"
echo "use that songsheet."
echo
echo "Although you're never forced to use songsheets, if you"
echo "never do, you can save a small amount of memory/overhead"
echo "if you remove the feature entirely. It ain't much, but"
echo "if you don't need it..."
echo
echo "Do you want to keep the songsheet feature, or remove it?"
echo
echo -e "Press \033[1mEnter\033[0m to keep the songsheets, or press \033[1mN\033[0m if not."
read_char ANS
if [ "$ANS" = "n" ]; then
SONG="n"
fi
fi
clear
echo "Modifying the BackupBand source code now..."
{
echo "/* Generated by configure.sh */"
echo "#ifndef BACKUPBAND_OPTS_H"
echo "#define BACKUPBAND_OPTS_H"
if [ "$MIDIIN" = "n" ]; then
echo "#define NO_MIDI_IN_SUPPORT"
fi
if [ "$MIDIINCLOCK" = "n" ]; then
echo "#define NO_MIDICLOCK_IN"
fi
if [ "$SEQOUT" = "n" ]; then
echo "#define NO_SEQ_OUT_SUPPORT"
fi
if [ "$SEQIN" = "n" ]; then
echo "#define NO_SEQ_IN_SUPPORT"
fi
if [ "$MIDIOUT" = "n" ]; then
echo "#define NO_MIDI_OUT_SUPPORT"
fi
if [ "$JACK" = "n" ]; then
echo "#define NO_JACK_SUPPORT"
fi
if [ "$ALSAAUDIO" = "n" ]; then
echo "#define NO_ALSA_AUDIO_SUPPORT"
fi
if [ "$REVERB" = "n" ]; then
echo "#define NO_REVERB_SUPPORT"
fi
if [ "$SONG" = "n" ]; then
echo "#define NO_SONGSHEET_SUPPORT"
fi
echo "#endif"
} > ./src/Options.h
eval "rm > /dev/null -f ./src/*.o ./src/*.gch *.o ./BackupBand"
clear
echo "BackupBand's source code has been successfully modified"
echo "to your individual needs. Now that's quality service!"
if [ SYNTH="n" ]; then
echo "You're welcome, you traitorous ingrate."
else
echo "If you find a bug, it's your fault. The enduser is"
echo "always to blame."
fi
echo
echo "Do you want to compile BackupBand now?"
echo
echo -e "Press \033[1mEnter\033[0m to compile, or press \033[1mN\033[0m if not."
read_char ANS
if [ "$ANS" = "" ]; then
clear
make
fi
exit