#ifndef __SOUND_ASOUND_FM_H1#define __SOUND_ASOUND_FM_H23/*4* Advanced Linux Sound Architecture - ALSA5*6* Interface file between ALSA driver & user space7* Copyright (c) 1994-98 by Jaroslav Kysela <[email protected]>,8* 4Front Technologies9*10* Direct FM control11*12* This program is free software; you can redistribute it and/or modify13* it under the terms of the GNU General Public License as published by14* the Free Software Foundation; either version 2 of the License, or15* (at your option) any later version.16*17* This program is distributed in the hope that it will be useful,18* but WITHOUT ANY WARRANTY; without even the implied warranty of19* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the20* GNU General Public License for more details.21*22* You should have received a copy of the GNU General Public License23* along with this program; if not, write to the Free Software24* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA25*26*/2728#define SNDRV_DM_FM_MODE_OPL2 0x0029#define SNDRV_DM_FM_MODE_OPL3 0x013031struct snd_dm_fm_info {32unsigned char fm_mode; /* OPL mode, see SNDRV_DM_FM_MODE_XXX */33unsigned char rhythm; /* percussion mode flag */34};3536/*37* Data structure composing an FM "note" or sound event.38*/3940struct snd_dm_fm_voice {41unsigned char op; /* operator cell (0 or 1) */42unsigned char voice; /* FM voice (0 to 17) */4344unsigned char am; /* amplitude modulation */45unsigned char vibrato; /* vibrato effect */46unsigned char do_sustain; /* sustain phase */47unsigned char kbd_scale; /* keyboard scaling */48unsigned char harmonic; /* 4 bits: harmonic and multiplier */49unsigned char scale_level; /* 2 bits: decrease output freq rises */50unsigned char volume; /* 6 bits: volume */5152unsigned char attack; /* 4 bits: attack rate */53unsigned char decay; /* 4 bits: decay rate */54unsigned char sustain; /* 4 bits: sustain level */55unsigned char release; /* 4 bits: release rate */5657unsigned char feedback; /* 3 bits: feedback for op0 */58unsigned char connection; /* 0 for serial, 1 for parallel */59unsigned char left; /* stereo left */60unsigned char right; /* stereo right */61unsigned char waveform; /* 3 bits: waveform shape */62};6364/*65* This describes an FM note by its voice, octave, frequency number (10bit)66* and key on/off.67*/6869struct snd_dm_fm_note {70unsigned char voice; /* 0-17 voice channel */71unsigned char octave; /* 3 bits: what octave to play */72unsigned int fnum; /* 10 bits: frequency number */73unsigned char key_on; /* set for active, clear for silent */74};7576/*77* FM parameters that apply globally to all voices, and thus are not "notes"78*/7980struct snd_dm_fm_params {81unsigned char am_depth; /* amplitude modulation depth (1=hi) */82unsigned char vib_depth; /* vibrato depth (1=hi) */83unsigned char kbd_split; /* keyboard split */84unsigned char rhythm; /* percussion mode select */8586/* This block is the percussion instrument data */87unsigned char bass;88unsigned char snare;89unsigned char tomtom;90unsigned char cymbal;91unsigned char hihat;92};9394/*95* FM mode ioctl settings96*/9798#define SNDRV_DM_FM_IOCTL_INFO _IOR('H', 0x20, struct snd_dm_fm_info)99#define SNDRV_DM_FM_IOCTL_RESET _IO ('H', 0x21)100#define SNDRV_DM_FM_IOCTL_PLAY_NOTE _IOW('H', 0x22, struct snd_dm_fm_note)101#define SNDRV_DM_FM_IOCTL_SET_VOICE _IOW('H', 0x23, struct snd_dm_fm_voice)102#define SNDRV_DM_FM_IOCTL_SET_PARAMS _IOW('H', 0x24, struct snd_dm_fm_params)103#define SNDRV_DM_FM_IOCTL_SET_MODE _IOW('H', 0x25, int)104/* for OPL3 only */105#define SNDRV_DM_FM_IOCTL_SET_CONNECTION _IOW('H', 0x26, int)106/* SBI patch management */107#define SNDRV_DM_FM_IOCTL_CLEAR_PATCHES _IO ('H', 0x40)108109#define SNDRV_DM_FM_OSS_IOCTL_RESET 0x20110#define SNDRV_DM_FM_OSS_IOCTL_PLAY_NOTE 0x21111#define SNDRV_DM_FM_OSS_IOCTL_SET_VOICE 0x22112#define SNDRV_DM_FM_OSS_IOCTL_SET_PARAMS 0x23113#define SNDRV_DM_FM_OSS_IOCTL_SET_MODE 0x24114#define SNDRV_DM_FM_OSS_IOCTL_SET_OPL 0x25115116/*117* Patch Record - fixed size for write118*/119120#define FM_KEY_SBI "SBI\032"121#define FM_KEY_2OP "2OP\032"122#define FM_KEY_4OP "4OP\032"123124struct sbi_patch {125unsigned char prog;126unsigned char bank;127char key[4];128char name[25];129char extension[7];130unsigned char data[32];131};132133#endif /* __SOUND_ASOUND_FM_H */134135136