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);
102 #endif // HAVE_OSS_SUPPORT
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;