| 1 |
#!/bin/sh |
| 2 |
########################################################## |
| 3 |
### DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE ### |
| 4 |
### DOING. THIS SCRIPT MAKES MANY ASSUMPTIONS ABOUT ### |
| 5 |
### DEFAULT VALUES BEING SET TO MY PERSONAL SETUP. ### |
| 6 |
########################################################## |
| 7 |
fmmode=0 |
| •8 |
#mididevno=-1 |
| 9 |
mididevno=0 |
| 10 |
play=PLAY_MIDI |
| 11 |
gus1=/dos/ultrasnd/midi |
| 12 |
gus2=/usr/local/lib/Plib |
| 13 |
########################################################## |
| •14 |
### EITHER /dev/sndstat OR /proc/asound/oss/sndstat ### |
| 15 |
### MUST BE AVAILABLE FOR READING ### |
| 16 |
########################################################## |
| •17 |
SNDSTAT=/proc/asound/oss/sndstat |
| 18 |
test -e "$SNDSTAT" || SNDSTAT=/dev/sndstat |
| 19 |
echo "Playmidi Quick Config Utility, Copyright (C)1996 Nathan I. Laredo" |
| 20 |
echo "This is free software with ABSOLUTELY NO WARRANTY. For details, please" |
| 21 |
echo "see the file COPYING included with the Playmidi distribution." |
| 22 |
echo "" |
| 23 |
echo "What type of device do you want to make the default?" |
| 24 |
echo "1. External midi synth, Ensoniq Soundscape, TB Maui, waveblaster cards" |
| 25 |
echo "2. Yamaha 2-op FM" |
| 26 |
echo "3. Yamaha 4-op FM" |
| 27 |
echo "4. Gravis Ultrasound" |
| 28 |
echo "5. SB AWE32 Synth" |
| 29 |
echo -n "(default = 1) --> " |
| 30 |
read ans1 |
| 31 |
if [ "$ans1" = "1" ] || [ -z "$ans1" ] |
| 32 |
then |
| 33 |
echo "" |
| 34 |
echo "Playmidi External MIDI synth configuration:" |
| •35 |
test -e "$SNDSTAT" && (grep -A 10 Midi\ devices: "$SNDSTAT" | grep -B 10 Timers: | grep -v Timers:) |
| 36 |
echo "If you want to force one of the midi devices above, enter the number" |
| 37 |
echo "here, otherwise, to default to the last detected, hit enter." |
| 38 |
echo -n "(at runtime, option -D# will override this) --> " |
| 39 |
read ans2 |
| 40 |
if [ -n "$ans2" ] |
| 41 |
then |
| 42 |
mididevno=$ans2 |
| 43 |
fi |
| 44 |
fi |
| 45 |
if [ "$ans1" = "2" ] |
| 46 |
then |
| 47 |
play=PLAY_FM |
| 48 |
fi |
| 49 |
if [ "$ans1" = "3" ] |
| 50 |
then |
| 51 |
play=PLAY_FM |
| 52 |
fmmode=1 |
| 53 |
fi |
| 54 |
if [ "$ans1" = "4" ] |
| 55 |
then |
| 56 |
play=PLAY_GUS |
| 57 |
echo "" |
| 58 |
echo "Where do you keep your Gravis Ultrasound patch files?" |
| 59 |
echo -n "(default = $gus1) --> " |
| 60 |
read ans3 |
| 61 |
if [ -z "$ans3" ] |
| 62 |
then |
| 63 |
ans3=$gus1 |
| 64 |
fi |
| 65 |
gus1=$ans3 |
| 66 |
echo "" |
| 67 |
echo "Where else should playmidi look for GUS patch files?" |
| 68 |
echo -n "(default = $gus2) --> " |
| 69 |
read ans4 |
| 70 |
if [ -z "$ans4" ] |
| 71 |
then |
| 72 |
ans4=$gus2 |
| 73 |
fi |
| 74 |
gus2=$ans4 |
| 75 |
fi |
| 76 |
if [ "$ans1" = "5" ] |
| 77 |
then |
| 78 |
play=PLAY_AWE32 |
| 79 |
fi |
| 80 |
echo "" |
| 81 |
echo -n "Now creating playmidi.h with your defaults..." |
| 82 |
gus1=`echo $gus1 | sed -f pathname.sed` |
| 83 |
gus2=`echo $gus2 | sed -f pathname.sed` |
| 84 |
echo " s/DEFAULT_PLAYBACK_MODE/$play/ |
| 85 |
s/DEFAULT_FM_MODE/$fmmode/ |
| 86 |
s/MIDI_DEFAULT_DEV/$mididevno/ |
| 87 |
s/PRIMARY_GUS_PATCH_LOCATION/$gus1/ |
| 88 |
s/SECONDARY_GUS_PATCH_LOCATION/$gus2/" >config.sed |
| 89 |
sed -f config.sed playmidi.h-dist >playmidi.h |
| 90 |
echo "Done." |
| 91 |
exit 0 |