33 #include <sys/ioctl.h>
36 #include <sys/param.h>
49 devicetype=KMID_SYNTH;
65 printfdebug(
"ERROR: Could not open /dev/sequencer\n");
68 #ifdef HAVE_OSS_SUPPORT
75 printfdebug(
"Number of synth devices : %d\n",ndevs);
76 printfdebug(
"Number of midi ports : %d\n",nmidiports);
77 printfdebug(
"Rate : %d\n",m_rate);
82 struct synth_info info;
88 if (ioctl (seqfd, SNDCTL_SYNTH_INFO, &info) == -1)
89 printfdebug(
" ioctl SNDCTL_SYNTH_INFO FAILED \n");
91 if (info.synth_type == SYNTH_TYPE_SAMPLE
92 && info.synth_subtype == SAMPLE_TYPE_AWE32)
96 AWE_SET_CHANNEL_MODE(device,1);
98 printfdebug(
" Found AWE32 dev=%d \n",device);
115 #ifdef HAVE_OSS_SUPPORT
118 uchar gm_reset[5]={0x7e, 0x7f, 0x09, 0x01, 0xf7};
119 sysex(gm_reset,
sizeof(gm_reset));
120 for (chn=0;chn<16;chn++)
142 SEQ_START_NOTE(device, map->
channel(chn),
143 map->
key(chn,chnpatch[chn],note),
147 printfdebug(
"Note ON >\t chn : %d\tnote : %d\tvel: %d\n",chn,note,vel);
153 SEQ_STOP_NOTE(device, map->
channel(chn),
154 map->
key(chn,chnpatch[chn],note), 0);
156 printfdebug(
"Note OFF >\t chn : %d\tnote : %d\tvel: %d\n",chn,note,vel);
162 SEQ_KEY_PRESSURE(device, map->
channel(chn), map->
key(chn,chnpatch[chn],note),vel);
167 SEQ_SET_PATCH(device,map->
channel(chn),map->
patch(chn,patch));
173 SEQ_CHN_PRESSURE(device, map->
channel(chn) , vel);
174 chnpressure[chn]=vel;
179 chnbender[chn]=((int)msb<<7) | (lsb & 0x7F);
180 SEQ_BENDER(device, map->
channel(chn), chnbender[chn]);
185 if ((ctl==11)||(ctl==7))
187 v=(v*volumepercentage)/100;
191 SEQ_CONTROL(device, map->
channel(chn), ctl, v);
192 chncontroller[chn][ctl]=v;
uchar channel(uchar chn)
Returns the channel which chn should be mapped to.
uchar patch(uchar chn, uchar pgm)
Returns the patch which pgm used on channel chn should be mapped to.
uchar key(uchar chn, uchar pgm, uchar note)
Returns the key that key note playing a pgm patch on channel chn should be mapped to.
int ok(void)
Returns true if everything's ok and false if there has been any problem.
void openDev(int sqfd)
See MidiOut::openDev()
void chnPitchBender(uchar chn, uchar lsb, uchar msb)
See MidiOut::chnPitchBender()
void noteOn(uchar chn, uchar note, uchar vel)
See MidiOut::noteOn()
void chnPressure(uchar chn, uchar vel)
See MidiOut::chnPressure()
void closeDev(void)
See MidiOut::closeDev()
void keyPressure(uchar chn, uchar note, uchar vel)
See MidiOut::keyPressure()
void chnPatchChange(uchar chn, uchar patch)
See MidiOut::chnPatchChange()
SynthOut(int d=0)
Constructor.
void initDev(void)
See MidiOut::initDev()
void sysex(uchar *data, ulong size)
It's an empty function, as AWE devices don't support System Exclusive messages.
void chnController(uchar chn, uchar ctl, uchar v)
See MidiOut::chnController()
void noteOff(uchar chn, uchar note, uchar vel)
See MidiOut::noteOff()