Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
opl3.h File Reference
#include <sound/core.h>
#include <sound/hwdep.h>
#include <sound/timer.h>
#include <sound/seq_midi_emul.h>
#include <sound/seq_device.h>
#include <sound/asound_fm.h>

Go to the source code of this file.

Data Structures

struct  fm_operator
 
struct  fm_instrument
 
struct  fm_patch
 
struct  snd_opl3_voice
 
struct  snd_opl3
 

Macros

#define OPL3_REG_TEST   0x01
 
#define OPL3_ENABLE_WAVE_SELECT   0x20
 
#define OPL3_REG_TIMER1   0x02
 
#define OPL3_REG_TIMER2   0x03
 
#define OPL3_REG_TIMER_CONTROL   0x04 /* Left side */
 
#define OPL3_IRQ_RESET   0x80
 
#define OPL3_TIMER1_MASK   0x40
 
#define OPL3_TIMER2_MASK   0x20
 
#define OPL3_TIMER1_START   0x01
 
#define OPL3_TIMER2_START   0x02
 
#define OPL3_REG_CONNECTION_SELECT   0x04 /* Right side */
 
#define OPL3_LEFT_4OP_0   0x01
 
#define OPL3_LEFT_4OP_1   0x02
 
#define OPL3_LEFT_4OP_2   0x04
 
#define OPL3_RIGHT_4OP_0   0x08
 
#define OPL3_RIGHT_4OP_1   0x10
 
#define OPL3_RIGHT_4OP_2   0x20
 
#define OPL3_REG_MODE   0x05 /* Right side */
 
#define OPL3_OPL3_ENABLE   0x01 /* OPL3 mode */
 
#define OPL3_OPL4_ENABLE   0x02 /* OPL4 mode */
 
#define OPL3_REG_KBD_SPLIT   0x08 /* Left side */
 
#define OPL3_COMPOSITE_SINE_WAVE_MODE   0x80 /* Don't use with OPL-3? */
 
#define OPL3_KEYBOARD_SPLIT   0x40
 
#define OPL3_REG_PERCUSSION   0xbd /* Left side only */
 
#define OPL3_TREMOLO_DEPTH   0x80
 
#define OPL3_VIBRATO_DEPTH   0x40
 
#define OPL3_PERCUSSION_ENABLE   0x20
 
#define OPL3_BASSDRUM_ON   0x10
 
#define OPL3_SNAREDRUM_ON   0x08
 
#define OPL3_TOMTOM_ON   0x04
 
#define OPL3_CYMBAL_ON   0x02
 
#define OPL3_HIHAT_ON   0x01
 
#define OPL3_REG_AM_VIB   0x20
 
#define OPL3_TREMOLO_ON   0x80
 
#define OPL3_VIBRATO_ON   0x40
 
#define OPL3_SUSTAIN_ON   0x20
 
#define OPL3_KSR   0x10 /* Key scaling rate */
 
#define OPL3_MULTIPLE_MASK   0x0f /* Frequency multiplier */
 
#define OPL3_REG_KSL_LEVEL   0x40
 
#define OPL3_KSL_MASK   0xc0 /* Envelope scaling bits */
 
#define OPL3_TOTAL_LEVEL_MASK   0x3f /* Strength (volume) of OP */
 
#define OPL3_REG_ATTACK_DECAY   0x60
 
#define OPL3_ATTACK_MASK   0xf0
 
#define OPL3_DECAY_MASK   0x0f
 
#define OPL3_REG_SUSTAIN_RELEASE   0x80
 
#define OPL3_SUSTAIN_MASK   0xf0
 
#define OPL3_RELEASE_MASK   0x0f
 
#define OPL3_REG_WAVE_SELECT   0xe0
 
#define OPL3_WAVE_SELECT_MASK   0x07
 
#define OPL3_REG_FNUM_LOW   0xa0
 
#define OPL3_REG_KEYON_BLOCK   0xb0
 
#define OPL3_KEYON_BIT   0x20
 
#define OPL3_BLOCKNUM_MASK   0x1c
 
#define OPL3_FNUM_HIGH_MASK   0x03
 
#define OPL3_REG_FEEDBACK_CONNECTION   0xc0
 
#define OPL3_FEEDBACK_MASK   0x0e /* Valid just for 1st OP of a voice */
 
#define OPL3_CONNECTION_BIT   0x01
 
#define OPL3_STEREO_BITS   0x30 /* OPL-3 only */
 
#define OPL3_VOICE_TO_LEFT   0x10
 
#define OPL3_VOICE_TO_RIGHT   0x20
 
#define OPL3_LEFT   0x0000
 
#define OPL3_RIGHT   0x0100
 
#define OPL3_HW_AUTO   0x0000
 
#define OPL3_HW_OPL2   0x0200
 
#define OPL3_HW_OPL3   0x0300
 
#define OPL3_HW_OPL3_SV   0x0301 /* S3 SonicVibes */
 
#define OPL3_HW_OPL3_CS   0x0302 /* CS4232/CS4236+ */
 
#define OPL3_HW_OPL3_FM801   0x0303 /* FM801 */
 
#define OPL3_HW_OPL3_CS4281   0x0304 /* CS4281 */
 
#define OPL3_HW_OPL4   0x0400 /* YMF278B/YMF295 */
 
#define OPL3_HW_OPL4_ML   0x0401 /* YMF704/YMF721 */
 
#define OPL3_HW_MASK   0xff00
 
#define MAX_OPL2_VOICES   9
 
#define MAX_OPL3_VOICES   18
 
#define FM_PATCH_OPL2   0x01 /* OPL2 2 operators FM instrument */
 
#define FM_PATCH_OPL3   0x02 /* OPL3 4 operators FM instrument */
 
#define SNDRV_OPL3_ST_OFF   0 /* Not playing */
 
#define SNDRV_OPL3_ST_ON_2OP   1 /* 2op voice is allocated */
 
#define SNDRV_OPL3_ST_ON_4OP   2 /* 4op voice is allocated */
 
#define SNDRV_OPL3_ST_NOT_AVAIL   -1 /* voice is not available */
 
#define snd_opl3_write   NULL
 

Functions

struct fm_operator __attribute__ ((packed))
 
void snd_opl3_interrupt (struct snd_hwdep *hw)
 
int snd_opl3_new (struct snd_card *card, unsigned short hardware, struct snd_opl3 **ropl3)
 
int snd_opl3_init (struct snd_opl3 *opl3)
 
int snd_opl3_create (struct snd_card *card, unsigned long l_port, unsigned long r_port, unsigned short hardware, int integrated, struct snd_opl3 **opl3)
 
int snd_opl3_timer_new (struct snd_opl3 *opl3, int timer1_dev, int timer2_dev)
 
int snd_opl3_hwdep_new (struct snd_opl3 *opl3, int device, int seq_device, struct snd_hwdep **rhwdep)
 
int snd_opl3_open (struct snd_hwdep *hw, struct file *file)
 
int snd_opl3_ioctl (struct snd_hwdep *hw, struct file *file, unsigned int cmd, unsigned long arg)
 
int snd_opl3_release (struct snd_hwdep *hw, struct file *file)
 
void snd_opl3_reset (struct snd_opl3 *opl3)
 

Variables

unsigned char am_vib
 
unsigned char ksl_level
 
unsigned char attack_decay
 
unsigned char sustain_release
 
unsigned char wave_select
 
struct fm_instrument __attribute__
 

Macro Definition Documentation

#define FM_PATCH_OPL2   0x01 /* OPL2 2 operators FM instrument */

Definition at line 266 of file opl3.h.

#define FM_PATCH_OPL3   0x02 /* OPL3 4 operators FM instrument */

Definition at line 267 of file opl3.h.

#define MAX_OPL2_VOICES   9

Definition at line 234 of file opl3.h.

#define MAX_OPL3_VOICES   18

Definition at line 235 of file opl3.h.

#define OPL3_ATTACK_MASK   0xf0

Definition at line 131 of file opl3.h.

#define OPL3_BASSDRUM_ON   0x10

Definition at line 101 of file opl3.h.

#define OPL3_BLOCKNUM_MASK   0x1c

Definition at line 160 of file opl3.h.

#define OPL3_COMPOSITE_SINE_WAVE_MODE   0x80 /* Don't use with OPL-3? */

Definition at line 94 of file opl3.h.

#define OPL3_CONNECTION_BIT   0x01

Definition at line 177 of file opl3.h.

#define OPL3_CYMBAL_ON   0x02

Definition at line 104 of file opl3.h.

#define OPL3_DECAY_MASK   0x0f

Definition at line 132 of file opl3.h.

#define OPL3_ENABLE_WAVE_SELECT   0x20

Definition at line 70 of file opl3.h.

#define OPL3_FEEDBACK_MASK   0x0e /* Valid just for 1st OP of a voice */

Definition at line 176 of file opl3.h.

#define OPL3_FNUM_HIGH_MASK   0x03

Definition at line 161 of file opl3.h.

#define OPL3_HIHAT_ON   0x01

Definition at line 105 of file opl3.h.

#define OPL3_HW_AUTO   0x0000

Definition at line 223 of file opl3.h.

#define OPL3_HW_MASK   0xff00

Definition at line 232 of file opl3.h.

#define OPL3_HW_OPL2   0x0200

Definition at line 224 of file opl3.h.

#define OPL3_HW_OPL3   0x0300

Definition at line 225 of file opl3.h.

#define OPL3_HW_OPL3_CS   0x0302 /* CS4232/CS4236+ */

Definition at line 227 of file opl3.h.

#define OPL3_HW_OPL3_CS4281   0x0304 /* CS4281 */

Definition at line 229 of file opl3.h.

#define OPL3_HW_OPL3_FM801   0x0303 /* FM801 */

Definition at line 228 of file opl3.h.

#define OPL3_HW_OPL3_SV   0x0301 /* S3 SonicVibes */

Definition at line 226 of file opl3.h.

#define OPL3_HW_OPL4   0x0400 /* YMF278B/YMF295 */

Definition at line 230 of file opl3.h.

#define OPL3_HW_OPL4_ML   0x0401 /* YMF704/YMF721 */

Definition at line 231 of file opl3.h.

#define OPL3_IRQ_RESET   0x80

Definition at line 75 of file opl3.h.

#define OPL3_KEYBOARD_SPLIT   0x40

Definition at line 95 of file opl3.h.

#define OPL3_KEYON_BIT   0x20

Definition at line 159 of file opl3.h.

#define OPL3_KSL_MASK   0xc0 /* Envelope scaling bits */

Definition at line 124 of file opl3.h.

#define OPL3_KSR   0x10 /* Key scaling rate */

Definition at line 117 of file opl3.h.

#define OPL3_LEFT   0x0000

Definition at line 220 of file opl3.h.

#define OPL3_LEFT_4OP_0   0x01

Definition at line 82 of file opl3.h.

#define OPL3_LEFT_4OP_1   0x02

Definition at line 83 of file opl3.h.

#define OPL3_LEFT_4OP_2   0x04

Definition at line 84 of file opl3.h.

#define OPL3_MULTIPLE_MASK   0x0f /* Frequency multiplier */

Definition at line 118 of file opl3.h.

#define OPL3_OPL3_ENABLE   0x01 /* OPL3 mode */

Definition at line 90 of file opl3.h.

#define OPL3_OPL4_ENABLE   0x02 /* OPL4 mode */

Definition at line 91 of file opl3.h.

#define OPL3_PERCUSSION_ENABLE   0x20

Definition at line 100 of file opl3.h.

#define OPL3_REG_AM_VIB   0x20

Definition at line 113 of file opl3.h.

#define OPL3_REG_ATTACK_DECAY   0x60

Definition at line 130 of file opl3.h.

#define OPL3_REG_CONNECTION_SELECT   0x04 /* Right side */

Definition at line 81 of file opl3.h.

#define OPL3_REG_FEEDBACK_CONNECTION   0xc0

Definition at line 175 of file opl3.h.

#define OPL3_REG_FNUM_LOW   0xa0

Definition at line 153 of file opl3.h.

#define OPL3_REG_KBD_SPLIT   0x08 /* Left side */

Definition at line 93 of file opl3.h.

#define OPL3_REG_KEYON_BLOCK   0xb0

Definition at line 158 of file opl3.h.

#define OPL3_REG_KSL_LEVEL   0x40

Definition at line 123 of file opl3.h.

#define OPL3_REG_MODE   0x05 /* Right side */

Definition at line 89 of file opl3.h.

#define OPL3_REG_PERCUSSION   0xbd /* Left side only */

Definition at line 97 of file opl3.h.

#define OPL3_REG_SUSTAIN_RELEASE   0x80

Definition at line 137 of file opl3.h.

#define OPL3_REG_TEST   0x01

Definition at line 69 of file opl3.h.

#define OPL3_REG_TIMER1   0x02

Definition at line 72 of file opl3.h.

#define OPL3_REG_TIMER2   0x03

Definition at line 73 of file opl3.h.

#define OPL3_REG_TIMER_CONTROL   0x04 /* Left side */

Definition at line 74 of file opl3.h.

#define OPL3_REG_WAVE_SELECT   0xe0

Definition at line 144 of file opl3.h.

#define OPL3_RELEASE_MASK   0x0f

Definition at line 139 of file opl3.h.

#define OPL3_RIGHT   0x0100

Definition at line 221 of file opl3.h.

#define OPL3_RIGHT_4OP_0   0x08

Definition at line 85 of file opl3.h.

#define OPL3_RIGHT_4OP_1   0x10

Definition at line 86 of file opl3.h.

#define OPL3_RIGHT_4OP_2   0x20

Definition at line 87 of file opl3.h.

#define OPL3_SNAREDRUM_ON   0x08

Definition at line 102 of file opl3.h.

#define OPL3_STEREO_BITS   0x30 /* OPL-3 only */

Definition at line 212 of file opl3.h.

#define OPL3_SUSTAIN_MASK   0xf0

Definition at line 138 of file opl3.h.

#define OPL3_SUSTAIN_ON   0x20

Definition at line 116 of file opl3.h.

#define OPL3_TIMER1_MASK   0x40

Definition at line 76 of file opl3.h.

#define OPL3_TIMER1_START   0x01

Definition at line 78 of file opl3.h.

#define OPL3_TIMER2_MASK   0x20

Definition at line 77 of file opl3.h.

#define OPL3_TIMER2_START   0x02

Definition at line 79 of file opl3.h.

#define OPL3_TOMTOM_ON   0x04

Definition at line 103 of file opl3.h.

#define OPL3_TOTAL_LEVEL_MASK   0x3f /* Strength (volume) of OP */

Definition at line 125 of file opl3.h.

#define OPL3_TREMOLO_DEPTH   0x80

Definition at line 98 of file opl3.h.

#define OPL3_TREMOLO_ON   0x80

Definition at line 114 of file opl3.h.

#define OPL3_VIBRATO_DEPTH   0x40

Definition at line 99 of file opl3.h.

#define OPL3_VIBRATO_ON   0x40

Definition at line 115 of file opl3.h.

#define OPL3_VOICE_TO_LEFT   0x10

Definition at line 213 of file opl3.h.

#define OPL3_VOICE_TO_RIGHT   0x20

Definition at line 214 of file opl3.h.

#define OPL3_WAVE_SELECT_MASK   0x07

Definition at line 145 of file opl3.h.

#define snd_opl3_write   NULL

Definition at line 389 of file opl3.h.

#define SNDRV_OPL3_ST_NOT_AVAIL   -1 /* voice is not available */

Definition at line 288 of file opl3.h.

#define SNDRV_OPL3_ST_OFF   0 /* Not playing */

Definition at line 285 of file opl3.h.

#define SNDRV_OPL3_ST_ON_2OP   1 /* 2op voice is allocated */

Definition at line 286 of file opl3.h.

#define SNDRV_OPL3_ST_ON_4OP   2 /* 4op voice is allocated */

Definition at line 287 of file opl3.h.

Function Documentation

struct fm_operator __attribute__ ( (packed)  )
read

mcontroller : adapter info structure for old mimd_t apps

: base address : irq number : number of logical drives : pci bus : pci device : pci function : pci id : vendor id : slot number : unique id

Definition at line 171 of file esd_usb2.c.

int snd_opl3_create ( struct snd_card card,
unsigned long  l_port,
unsigned long  r_port,
unsigned short  hardware,
int  integrated,
struct snd_opl3 **  opl3 
)

Definition at line 405 of file opl3_lib.c.

int snd_opl3_hwdep_new ( struct snd_opl3 opl3,
int  device,
int  seq_device,
struct snd_hwdep **  rhwdep 
)

Definition at line 484 of file opl3_lib.c.

int snd_opl3_init ( struct snd_opl3 opl3)

Definition at line 379 of file opl3_lib.c.

void snd_opl3_interrupt ( struct snd_hwdep hw)

Definition at line 294 of file opl3_lib.c.

int snd_opl3_ioctl ( struct snd_hwdep hw,
struct file file,
unsigned int  cmd,
unsigned long  arg 
)

Definition at line 91 of file opl3_synth.c.

int snd_opl3_new ( struct snd_card card,
unsigned short  hardware,
struct snd_opl3 **  ropl3 
)

Definition at line 346 of file opl3_lib.c.

int snd_opl3_open ( struct snd_hwdep hw,
struct file file 
)

Definition at line 83 of file opl3_synth.c.

int snd_opl3_release ( struct snd_hwdep hw,
struct file file 
)

Definition at line 182 of file opl3_synth.c.

void snd_opl3_reset ( struct snd_opl3 opl3)

Definition at line 358 of file opl3_synth.c.

int snd_opl3_timer_new ( struct snd_opl3 opl3,
int  timer1_dev,
int  timer2_dev 
)

Definition at line 465 of file opl3_lib.c.

Variable Documentation

unsigned char am_vib

Definition at line 251 of file opl3.h.

unsigned char attack_decay

Definition at line 253 of file opl3.h.

unsigned char ksl_level

Definition at line 252 of file opl3.h.

unsigned char sustain_release

Definition at line 254 of file opl3.h.

unsigned char wave_select

Definition at line 255 of file opl3.h.