Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/linux
File: soundcard.h
/*
[0] Fix | Delete
* Copyright by Hannu Savolainen 1993-1997
[1] Fix | Delete
*
[2] Fix | Delete
* Redistribution and use in source and binary forms, with or without
[3] Fix | Delete
* modification, are permitted provided that the following conditions are
[4] Fix | Delete
* met: 1. Redistributions of source code must retain the above copyright
[5] Fix | Delete
* notice, this list of conditions and the following disclaimer. 2.
[6] Fix | Delete
* Redistributions in binary form must reproduce the above copyright notice,
[7] Fix | Delete
* this list of conditions and the following disclaimer in the documentation
[8] Fix | Delete
* and/or other materials provided with the distribution.
[9] Fix | Delete
*
[10] Fix | Delete
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
[11] Fix | Delete
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
[12] Fix | Delete
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
[13] Fix | Delete
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
[14] Fix | Delete
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
[15] Fix | Delete
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
[16] Fix | Delete
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
[17] Fix | Delete
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
[18] Fix | Delete
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
[19] Fix | Delete
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
[20] Fix | Delete
* SUCH DAMAGE.
[21] Fix | Delete
*/
[22] Fix | Delete
#ifndef SOUNDCARD_H
[23] Fix | Delete
#define SOUNDCARD_H
[24] Fix | Delete
[25] Fix | Delete
[26] Fix | Delete
/*
[27] Fix | Delete
* OSS interface version. With versions earlier than 3.6 this value is
[28] Fix | Delete
* an integer with value less than 361. In versions 3.6 and later
[29] Fix | Delete
* it's a six digit hexadecimal value. For example value
[30] Fix | Delete
* of 0x030600 represents OSS version 3.6.0.
[31] Fix | Delete
* Use ioctl(fd, OSS_GETVERSION, &int) to get the version number of
[32] Fix | Delete
* the currently active driver.
[33] Fix | Delete
*/
[34] Fix | Delete
#define SOUND_VERSION 0x030802
[35] Fix | Delete
#define OPEN_SOUND_SYSTEM
[36] Fix | Delete
[37] Fix | Delete
/* In Linux we need to be prepared for cross compiling */
[38] Fix | Delete
#include <linux/ioctl.h>
[39] Fix | Delete
[40] Fix | Delete
/* Endian macros. */
[41] Fix | Delete
# include <endian.h>
[42] Fix | Delete
[43] Fix | Delete
/*
[44] Fix | Delete
* Supported card ID numbers (Should be somewhere else?)
[45] Fix | Delete
*/
[46] Fix | Delete
[47] Fix | Delete
#define SNDCARD_ADLIB 1
[48] Fix | Delete
#define SNDCARD_SB 2
[49] Fix | Delete
#define SNDCARD_PAS 3
[50] Fix | Delete
#define SNDCARD_GUS 4
[51] Fix | Delete
#define SNDCARD_MPU401 5
[52] Fix | Delete
#define SNDCARD_SB16 6
[53] Fix | Delete
#define SNDCARD_SB16MIDI 7
[54] Fix | Delete
#define SNDCARD_UART6850 8
[55] Fix | Delete
#define SNDCARD_GUS16 9
[56] Fix | Delete
#define SNDCARD_MSS 10
[57] Fix | Delete
#define SNDCARD_PSS 11
[58] Fix | Delete
#define SNDCARD_SSCAPE 12
[59] Fix | Delete
#define SNDCARD_PSS_MPU 13
[60] Fix | Delete
#define SNDCARD_PSS_MSS 14
[61] Fix | Delete
#define SNDCARD_SSCAPE_MSS 15
[62] Fix | Delete
#define SNDCARD_TRXPRO 16
[63] Fix | Delete
#define SNDCARD_TRXPRO_SB 17
[64] Fix | Delete
#define SNDCARD_TRXPRO_MPU 18
[65] Fix | Delete
#define SNDCARD_MAD16 19
[66] Fix | Delete
#define SNDCARD_MAD16_MPU 20
[67] Fix | Delete
#define SNDCARD_CS4232 21
[68] Fix | Delete
#define SNDCARD_CS4232_MPU 22
[69] Fix | Delete
#define SNDCARD_MAUI 23
[70] Fix | Delete
#define SNDCARD_PSEUDO_MSS 24
[71] Fix | Delete
#define SNDCARD_GUSPNP 25
[72] Fix | Delete
#define SNDCARD_UART401 26
[73] Fix | Delete
/* Sound card numbers 27 to N are reserved. Don't add more numbers here. */
[74] Fix | Delete
[75] Fix | Delete
/***********************************
[76] Fix | Delete
* IOCTL Commands for /dev/sequencer
[77] Fix | Delete
*/
[78] Fix | Delete
[79] Fix | Delete
#ifndef _SIOWR
[80] Fix | Delete
#if defined(_IOWR) && (defined(_AIX) || (!defined(sun) && !defined(sparc) && !defined(__sparc__) && !defined(__INCioctlh) && !defined(__Lynx__)))
[81] Fix | Delete
/* Use already defined ioctl defines if they exist (except with Sun or Sparc) */
[82] Fix | Delete
#define SIOCPARM_MASK IOCPARM_MASK
[83] Fix | Delete
#define SIOC_VOID IOC_VOID
[84] Fix | Delete
#define SIOC_OUT IOC_OUT
[85] Fix | Delete
#define SIOC_IN IOC_IN
[86] Fix | Delete
#define SIOC_INOUT IOC_INOUT
[87] Fix | Delete
#define _SIOC_SIZE _IOC_SIZE
[88] Fix | Delete
#define _SIOC_DIR _IOC_DIR
[89] Fix | Delete
#define _SIOC_NONE _IOC_NONE
[90] Fix | Delete
#define _SIOC_READ _IOC_READ
[91] Fix | Delete
#define _SIOC_WRITE _IOC_WRITE
[92] Fix | Delete
#define _SIO _IO
[93] Fix | Delete
#define _SIOR _IOR
[94] Fix | Delete
#define _SIOW _IOW
[95] Fix | Delete
#define _SIOWR _IOWR
[96] Fix | Delete
#else
[97] Fix | Delete
[98] Fix | Delete
/* Ioctl's have the command encoded in the lower word,
[99] Fix | Delete
* and the size of any in or out parameters in the upper
[100] Fix | Delete
* word. The high 2 bits of the upper word are used
[101] Fix | Delete
* to encode the in/out status of the parameter; for now
[102] Fix | Delete
* we restrict parameters to at most 8191 bytes.
[103] Fix | Delete
*/
[104] Fix | Delete
/* #define SIOCTYPE (0xff<<8) */
[105] Fix | Delete
#define SIOCPARM_MASK 0x1fff /* parameters must be < 8192 bytes */
[106] Fix | Delete
#define SIOC_VOID 0x00000000 /* no parameters */
[107] Fix | Delete
#define SIOC_OUT 0x20000000 /* copy out parameters */
[108] Fix | Delete
#define SIOC_IN 0x40000000 /* copy in parameters */
[109] Fix | Delete
#define SIOC_INOUT (SIOC_IN|SIOC_OUT)
[110] Fix | Delete
/* the 0x20000000 is so we can distinguish new ioctl's from old */
[111] Fix | Delete
#define _SIO(x,y) ((int)(SIOC_VOID|(x<<8)|y))
[112] Fix | Delete
#define _SIOR(x,y,t) ((int)(SIOC_OUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
[113] Fix | Delete
#define _SIOW(x,y,t) ((int)(SIOC_IN|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
[114] Fix | Delete
/* this should be _SIORW, but stdio got there first */
[115] Fix | Delete
#define _SIOWR(x,y,t) ((int)(SIOC_INOUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
[116] Fix | Delete
#define _SIOC_SIZE(x) ((x>>16)&SIOCPARM_MASK)
[117] Fix | Delete
#define _SIOC_DIR(x) (x & 0xf0000000)
[118] Fix | Delete
#define _SIOC_NONE SIOC_VOID
[119] Fix | Delete
#define _SIOC_READ SIOC_OUT
[120] Fix | Delete
#define _SIOC_WRITE SIOC_IN
[121] Fix | Delete
# endif /* _IOWR */
[122] Fix | Delete
#endif /* !_SIOWR */
[123] Fix | Delete
[124] Fix | Delete
#define SNDCTL_SEQ_RESET _SIO ('Q', 0)
[125] Fix | Delete
#define SNDCTL_SEQ_SYNC _SIO ('Q', 1)
[126] Fix | Delete
#define SNDCTL_SYNTH_INFO _SIOWR('Q', 2, struct synth_info)
[127] Fix | Delete
#define SNDCTL_SEQ_CTRLRATE _SIOWR('Q', 3, int) /* Set/get timer resolution (HZ) */
[128] Fix | Delete
#define SNDCTL_SEQ_GETOUTCOUNT _SIOR ('Q', 4, int)
[129] Fix | Delete
#define SNDCTL_SEQ_GETINCOUNT _SIOR ('Q', 5, int)
[130] Fix | Delete
#define SNDCTL_SEQ_PERCMODE _SIOW ('Q', 6, int)
[131] Fix | Delete
#define SNDCTL_FM_LOAD_INSTR _SIOW ('Q', 7, struct sbi_instrument) /* Obsolete. Don't use!!!!!! */
[132] Fix | Delete
#define SNDCTL_SEQ_TESTMIDI _SIOW ('Q', 8, int)
[133] Fix | Delete
#define SNDCTL_SEQ_RESETSAMPLES _SIOW ('Q', 9, int)
[134] Fix | Delete
#define SNDCTL_SEQ_NRSYNTHS _SIOR ('Q',10, int)
[135] Fix | Delete
#define SNDCTL_SEQ_NRMIDIS _SIOR ('Q',11, int)
[136] Fix | Delete
#define SNDCTL_MIDI_INFO _SIOWR('Q',12, struct midi_info)
[137] Fix | Delete
#define SNDCTL_SEQ_THRESHOLD _SIOW ('Q',13, int)
[138] Fix | Delete
#define SNDCTL_SYNTH_MEMAVL _SIOWR('Q',14, int) /* in=dev#, out=memsize */
[139] Fix | Delete
#define SNDCTL_FM_4OP_ENABLE _SIOW ('Q',15, int) /* in=dev# */
[140] Fix | Delete
#define SNDCTL_SEQ_PANIC _SIO ('Q',17)
[141] Fix | Delete
#define SNDCTL_SEQ_OUTOFBAND _SIOW ('Q',18, struct seq_event_rec)
[142] Fix | Delete
#define SNDCTL_SEQ_GETTIME _SIOR ('Q',19, int)
[143] Fix | Delete
#define SNDCTL_SYNTH_ID _SIOWR('Q',20, struct synth_info)
[144] Fix | Delete
#define SNDCTL_SYNTH_CONTROL _SIOWR('Q',21, struct synth_control)
[145] Fix | Delete
#define SNDCTL_SYNTH_REMOVESAMPLE _SIOWR('Q',22, struct remove_sample)
[146] Fix | Delete
[147] Fix | Delete
typedef struct synth_control
[148] Fix | Delete
{
[149] Fix | Delete
int devno; /* Synthesizer # */
[150] Fix | Delete
char data[4000]; /* Device spesific command/data record */
[151] Fix | Delete
}synth_control;
[152] Fix | Delete
[153] Fix | Delete
typedef struct remove_sample
[154] Fix | Delete
{
[155] Fix | Delete
int devno; /* Synthesizer # */
[156] Fix | Delete
int bankno; /* MIDI bank # (0=General MIDI) */
[157] Fix | Delete
int instrno; /* MIDI instrument number */
[158] Fix | Delete
} remove_sample;
[159] Fix | Delete
[160] Fix | Delete
typedef struct seq_event_rec {
[161] Fix | Delete
unsigned char arr[8];
[162] Fix | Delete
} seq_event_rec;
[163] Fix | Delete
[164] Fix | Delete
#define SNDCTL_TMR_TIMEBASE _SIOWR('T', 1, int)
[165] Fix | Delete
#define SNDCTL_TMR_START _SIO ('T', 2)
[166] Fix | Delete
#define SNDCTL_TMR_STOP _SIO ('T', 3)
[167] Fix | Delete
#define SNDCTL_TMR_CONTINUE _SIO ('T', 4)
[168] Fix | Delete
#define SNDCTL_TMR_TEMPO _SIOWR('T', 5, int)
[169] Fix | Delete
#define SNDCTL_TMR_SOURCE _SIOWR('T', 6, int)
[170] Fix | Delete
# define TMR_INTERNAL 0x00000001
[171] Fix | Delete
# define TMR_EXTERNAL 0x00000002
[172] Fix | Delete
# define TMR_MODE_MIDI 0x00000010
[173] Fix | Delete
# define TMR_MODE_FSK 0x00000020
[174] Fix | Delete
# define TMR_MODE_CLS 0x00000040
[175] Fix | Delete
# define TMR_MODE_SMPTE 0x00000080
[176] Fix | Delete
#define SNDCTL_TMR_METRONOME _SIOW ('T', 7, int)
[177] Fix | Delete
#define SNDCTL_TMR_SELECT _SIOW ('T', 8, int)
[178] Fix | Delete
[179] Fix | Delete
/*
[180] Fix | Delete
* Some big endian/little endian handling macros
[181] Fix | Delete
*/
[182] Fix | Delete
[183] Fix | Delete
#define _LINUX_PATCHKEY_H_INDIRECT
[184] Fix | Delete
#include <linux/patchkey.h>
[185] Fix | Delete
#undef _LINUX_PATCHKEY_H_INDIRECT
[186] Fix | Delete
[187] Fix | Delete
# if defined(__BYTE_ORDER)
[188] Fix | Delete
# if __BYTE_ORDER == __BIG_ENDIAN
[189] Fix | Delete
# define AFMT_S16_NE AFMT_S16_BE
[190] Fix | Delete
# elif __BYTE_ORDER == __LITTLE_ENDIAN
[191] Fix | Delete
# define AFMT_S16_NE AFMT_S16_LE
[192] Fix | Delete
# else
[193] Fix | Delete
# error "could not determine byte order"
[194] Fix | Delete
# endif
[195] Fix | Delete
# endif
[196] Fix | Delete
[197] Fix | Delete
/*
[198] Fix | Delete
* Sample loading mechanism for internal synthesizers (/dev/sequencer)
[199] Fix | Delete
* The following patch_info structure has been designed to support
[200] Fix | Delete
* Gravis UltraSound. It tries to be universal format for uploading
[201] Fix | Delete
* sample based patches but is probably too limited.
[202] Fix | Delete
*
[203] Fix | Delete
* (PBD) As Hannu guessed, the GUS structure is too limited for
[204] Fix | Delete
* the WaveFront, but this is the right place for a constant definition.
[205] Fix | Delete
*/
[206] Fix | Delete
[207] Fix | Delete
struct patch_info {
[208] Fix | Delete
unsigned short key; /* Use WAVE_PATCH here */
[209] Fix | Delete
#define WAVE_PATCH _PATCHKEY(0x04)
[210] Fix | Delete
#define GUS_PATCH WAVE_PATCH
[211] Fix | Delete
#define WAVEFRONT_PATCH _PATCHKEY(0x06)
[212] Fix | Delete
[213] Fix | Delete
short device_no; /* Synthesizer number */
[214] Fix | Delete
short instr_no; /* Midi pgm# */
[215] Fix | Delete
[216] Fix | Delete
unsigned int mode;
[217] Fix | Delete
/*
[218] Fix | Delete
* The least significant byte has the same format than the GUS .PAT
[219] Fix | Delete
* files
[220] Fix | Delete
*/
[221] Fix | Delete
#define WAVE_16_BITS 0x01 /* bit 0 = 8 or 16 bit wave data. */
[222] Fix | Delete
#define WAVE_UNSIGNED 0x02 /* bit 1 = Signed - Unsigned data. */
[223] Fix | Delete
#define WAVE_LOOPING 0x04 /* bit 2 = looping enabled-1. */
[224] Fix | Delete
#define WAVE_BIDIR_LOOP 0x08 /* bit 3 = Set is bidirectional looping. */
[225] Fix | Delete
#define WAVE_LOOP_BACK 0x10 /* bit 4 = Set is looping backward. */
[226] Fix | Delete
#define WAVE_SUSTAIN_ON 0x20 /* bit 5 = Turn sustaining on. (Env. pts. 3)*/
[227] Fix | Delete
#define WAVE_ENVELOPES 0x40 /* bit 6 = Enable envelopes - 1 */
[228] Fix | Delete
#define WAVE_FAST_RELEASE 0x80 /* bit 7 = Shut off immediately after note off */
[229] Fix | Delete
/* (use the env_rate/env_offs fields). */
[230] Fix | Delete
/* Linux specific bits */
[231] Fix | Delete
#define WAVE_VIBRATO 0x00010000 /* The vibrato info is valid */
[232] Fix | Delete
#define WAVE_TREMOLO 0x00020000 /* The tremolo info is valid */
[233] Fix | Delete
#define WAVE_SCALE 0x00040000 /* The scaling info is valid */
[234] Fix | Delete
#define WAVE_FRACTIONS 0x00080000 /* Fraction information is valid */
[235] Fix | Delete
/* Reserved bits */
[236] Fix | Delete
#define WAVE_ROM 0x40000000 /* For future use */
[237] Fix | Delete
#define WAVE_MULAW 0x20000000 /* For future use */
[238] Fix | Delete
/* Other bits must be zeroed */
[239] Fix | Delete
[240] Fix | Delete
int len; /* Size of the wave data in bytes */
[241] Fix | Delete
int loop_start, loop_end; /* Byte offsets from the beginning */
[242] Fix | Delete
[243] Fix | Delete
/*
[244] Fix | Delete
* The base_freq and base_note fields are used when computing the
[245] Fix | Delete
* playback speed for a note. The base_note defines the tone frequency
[246] Fix | Delete
* which is heard if the sample is played using the base_freq as the
[247] Fix | Delete
* playback speed.
[248] Fix | Delete
*
[249] Fix | Delete
* The low_note and high_note fields define the minimum and maximum note
[250] Fix | Delete
* frequencies for which this sample is valid. It is possible to define
[251] Fix | Delete
* more than one samples for an instrument number at the same time. The
[252] Fix | Delete
* low_note and high_note fields are used to select the most suitable one.
[253] Fix | Delete
*
[254] Fix | Delete
* The fields base_note, high_note and low_note should contain
[255] Fix | Delete
* the note frequency multiplied by 1000. For example value for the
[256] Fix | Delete
* middle A is 440*1000.
[257] Fix | Delete
*/
[258] Fix | Delete
[259] Fix | Delete
unsigned int base_freq;
[260] Fix | Delete
unsigned int base_note;
[261] Fix | Delete
unsigned int high_note;
[262] Fix | Delete
unsigned int low_note;
[263] Fix | Delete
int panning; /* -128=left, 127=right */
[264] Fix | Delete
int detuning;
[265] Fix | Delete
[266] Fix | Delete
/* New fields introduced in version 1.99.5 */
[267] Fix | Delete
[268] Fix | Delete
/* Envelope. Enabled by mode bit WAVE_ENVELOPES */
[269] Fix | Delete
unsigned char env_rate[ 6 ]; /* GUS HW ramping rate */
[270] Fix | Delete
unsigned char env_offset[ 6 ]; /* 255 == 100% */
[271] Fix | Delete
[272] Fix | Delete
/*
[273] Fix | Delete
* The tremolo, vibrato and scale info are not supported yet.
[274] Fix | Delete
* Enable by setting the mode bits WAVE_TREMOLO, WAVE_VIBRATO or
[275] Fix | Delete
* WAVE_SCALE
[276] Fix | Delete
*/
[277] Fix | Delete
[278] Fix | Delete
unsigned char tremolo_sweep;
[279] Fix | Delete
unsigned char tremolo_rate;
[280] Fix | Delete
unsigned char tremolo_depth;
[281] Fix | Delete
[282] Fix | Delete
unsigned char vibrato_sweep;
[283] Fix | Delete
unsigned char vibrato_rate;
[284] Fix | Delete
unsigned char vibrato_depth;
[285] Fix | Delete
[286] Fix | Delete
int scale_frequency;
[287] Fix | Delete
unsigned int scale_factor; /* from 0 to 2048 or 0 to 2 */
[288] Fix | Delete
[289] Fix | Delete
int volume;
[290] Fix | Delete
int fractions;
[291] Fix | Delete
int reserved1;
[292] Fix | Delete
int spare[2];
[293] Fix | Delete
char data[1]; /* The waveform data starts here */
[294] Fix | Delete
};
[295] Fix | Delete
[296] Fix | Delete
struct sysex_info {
[297] Fix | Delete
short key; /* Use SYSEX_PATCH or MAUI_PATCH here */
[298] Fix | Delete
#define SYSEX_PATCH _PATCHKEY(0x05)
[299] Fix | Delete
#define MAUI_PATCH _PATCHKEY(0x06)
[300] Fix | Delete
short device_no; /* Synthesizer number */
[301] Fix | Delete
int len; /* Size of the sysex data in bytes */
[302] Fix | Delete
unsigned char data[1]; /* Sysex data starts here */
[303] Fix | Delete
};
[304] Fix | Delete
[305] Fix | Delete
/*
[306] Fix | Delete
* /dev/sequencer input events.
[307] Fix | Delete
*
[308] Fix | Delete
* The data written to the /dev/sequencer is a stream of events. Events
[309] Fix | Delete
* are records of 4 or 8 bytes. The first byte defines the size.
[310] Fix | Delete
* Any number of events can be written with a write call. There
[311] Fix | Delete
* is a set of macros for sending these events. Use these macros if you
[312] Fix | Delete
* want to maximize portability of your program.
[313] Fix | Delete
*
[314] Fix | Delete
* Events SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO. Are also input events.
[315] Fix | Delete
* (All input events are currently 4 bytes long. Be prepared to support
[316] Fix | Delete
* 8 byte events also. If you receive any event having first byte >= 128,
[317] Fix | Delete
* it's a 8 byte event.
[318] Fix | Delete
*
[319] Fix | Delete
* The events are documented at the end of this file.
[320] Fix | Delete
*
[321] Fix | Delete
* Normal events (4 bytes)
[322] Fix | Delete
* There is also a 8 byte version of most of the 4 byte events. The
[323] Fix | Delete
* 8 byte one is recommended.
[324] Fix | Delete
*/
[325] Fix | Delete
#define SEQ_NOTEOFF 0
[326] Fix | Delete
#define SEQ_FMNOTEOFF SEQ_NOTEOFF /* Just old name */
[327] Fix | Delete
#define SEQ_NOTEON 1
[328] Fix | Delete
#define SEQ_FMNOTEON SEQ_NOTEON
[329] Fix | Delete
#define SEQ_WAIT TMR_WAIT_ABS
[330] Fix | Delete
#define SEQ_PGMCHANGE 3
[331] Fix | Delete
#define SEQ_FMPGMCHANGE SEQ_PGMCHANGE
[332] Fix | Delete
#define SEQ_SYNCTIMER TMR_START
[333] Fix | Delete
#define SEQ_MIDIPUTC 5
[334] Fix | Delete
#define SEQ_DRUMON 6 /*** OBSOLETE ***/
[335] Fix | Delete
#define SEQ_DRUMOFF 7 /*** OBSOLETE ***/
[336] Fix | Delete
#define SEQ_ECHO TMR_ECHO /* For synching programs with output */
[337] Fix | Delete
#define SEQ_AFTERTOUCH 9
[338] Fix | Delete
#define SEQ_CONTROLLER 10
[339] Fix | Delete
[340] Fix | Delete
/*******************************************
[341] Fix | Delete
* Midi controller numbers
[342] Fix | Delete
*******************************************
[343] Fix | Delete
* Controllers 0 to 31 (0x00 to 0x1f) and
[344] Fix | Delete
* 32 to 63 (0x20 to 0x3f) are continuous
[345] Fix | Delete
* controllers.
[346] Fix | Delete
* In the MIDI 1.0 these controllers are sent using
[347] Fix | Delete
* two messages. Controller numbers 0 to 31 are used
[348] Fix | Delete
* to send the MSB and the controller numbers 32 to 63
[349] Fix | Delete
* are for the LSB. Note that just 7 bits are used in MIDI bytes.
[350] Fix | Delete
*/
[351] Fix | Delete
[352] Fix | Delete
#define CTL_BANK_SELECT 0x00
[353] Fix | Delete
#define CTL_MODWHEEL 0x01
[354] Fix | Delete
#define CTL_BREATH 0x02
[355] Fix | Delete
/* undefined 0x03 */
[356] Fix | Delete
#define CTL_FOOT 0x04
[357] Fix | Delete
#define CTL_PORTAMENTO_TIME 0x05
[358] Fix | Delete
#define CTL_DATA_ENTRY 0x06
[359] Fix | Delete
#define CTL_MAIN_VOLUME 0x07
[360] Fix | Delete
#define CTL_BALANCE 0x08
[361] Fix | Delete
/* undefined 0x09 */
[362] Fix | Delete
#define CTL_PAN 0x0a
[363] Fix | Delete
#define CTL_EXPRESSION 0x0b
[364] Fix | Delete
/* undefined 0x0c */
[365] Fix | Delete
/* undefined 0x0d */
[366] Fix | Delete
/* undefined 0x0e */
[367] Fix | Delete
/* undefined 0x0f */
[368] Fix | Delete
#define CTL_GENERAL_PURPOSE1 0x10
[369] Fix | Delete
#define CTL_GENERAL_PURPOSE2 0x11
[370] Fix | Delete
#define CTL_GENERAL_PURPOSE3 0x12
[371] Fix | Delete
#define CTL_GENERAL_PURPOSE4 0x13
[372] Fix | Delete
/* undefined 0x14 - 0x1f */
[373] Fix | Delete
[374] Fix | Delete
/* undefined 0x20 */
[375] Fix | Delete
/* The controller numbers 0x21 to 0x3f are reserved for the */
[376] Fix | Delete
/* least significant bytes of the controllers 0x00 to 0x1f. */
[377] Fix | Delete
/* These controllers are not recognised by the driver. */
[378] Fix | Delete
[379] Fix | Delete
/* Controllers 64 to 69 (0x40 to 0x45) are on/off switches. */
[380] Fix | Delete
/* 0=OFF and 127=ON (intermediate values are possible) */
[381] Fix | Delete
#define CTL_DAMPER_PEDAL 0x40
[382] Fix | Delete
#define CTL_SUSTAIN 0x40 /* Alias */
[383] Fix | Delete
#define CTL_HOLD 0x40 /* Alias */
[384] Fix | Delete
#define CTL_PORTAMENTO 0x41
[385] Fix | Delete
#define CTL_SOSTENUTO 0x42
[386] Fix | Delete
#define CTL_SOFT_PEDAL 0x43
[387] Fix | Delete
/* undefined 0x44 */
[388] Fix | Delete
#define CTL_HOLD2 0x45
[389] Fix | Delete
/* undefined 0x46 - 0x4f */
[390] Fix | Delete
[391] Fix | Delete
#define CTL_GENERAL_PURPOSE5 0x50
[392] Fix | Delete
#define CTL_GENERAL_PURPOSE6 0x51
[393] Fix | Delete
#define CTL_GENERAL_PURPOSE7 0x52
[394] Fix | Delete
#define CTL_GENERAL_PURPOSE8 0x53
[395] Fix | Delete
/* undefined 0x54 - 0x5a */
[396] Fix | Delete
#define CTL_EXT_EFF_DEPTH 0x5b
[397] Fix | Delete
#define CTL_TREMOLO_DEPTH 0x5c
[398] Fix | Delete
#define CTL_CHORUS_DEPTH 0x5d
[399] Fix | Delete
#define CTL_DETUNE_DEPTH 0x5e
[400] Fix | Delete
#define CTL_CELESTE_DEPTH 0x5e /* Alias for the above one */
[401] Fix | Delete
#define CTL_PHASER_DEPTH 0x5f
[402] Fix | Delete
#define CTL_DATA_INCREMENT 0x60
[403] Fix | Delete
#define CTL_DATA_DECREMENT 0x61
[404] Fix | Delete
#define CTL_NONREG_PARM_NUM_LSB 0x62
[405] Fix | Delete
#define CTL_NONREG_PARM_NUM_MSB 0x63
[406] Fix | Delete
#define CTL_REGIST_PARM_NUM_LSB 0x64
[407] Fix | Delete
#define CTL_REGIST_PARM_NUM_MSB 0x65
[408] Fix | Delete
/* undefined 0x66 - 0x78 */
[409] Fix | Delete
/* reserved 0x79 - 0x7f */
[410] Fix | Delete
[411] Fix | Delete
/* Pseudo controllers (not midi compatible) */
[412] Fix | Delete
#define CTRL_PITCH_BENDER 255
[413] Fix | Delete
#define CTRL_PITCH_BENDER_RANGE 254
[414] Fix | Delete
#define CTRL_EXPRESSION 253 /* Obsolete */
[415] Fix | Delete
#define CTRL_MAIN_VOLUME 252 /* Obsolete */
[416] Fix | Delete
#define SEQ_BALANCE 11
[417] Fix | Delete
#define SEQ_VOLMODE 12
[418] Fix | Delete
[419] Fix | Delete
/*
[420] Fix | Delete
* Volume mode decides how volumes are used
[421] Fix | Delete
*/
[422] Fix | Delete
[423] Fix | Delete
#define VOL_METHOD_ADAGIO 1
[424] Fix | Delete
#define VOL_METHOD_LINEAR 2
[425] Fix | Delete
[426] Fix | Delete
/*
[427] Fix | Delete
* Note! SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO are used also as
[428] Fix | Delete
* input events.
[429] Fix | Delete
*/
[430] Fix | Delete
[431] Fix | Delete
/*
[432] Fix | Delete
* Event codes 0xf0 to 0xfc are reserved for future extensions.
[433] Fix | Delete
*/
[434] Fix | Delete
[435] Fix | Delete
#define SEQ_FULLSIZE 0xfd /* Long events */
[436] Fix | Delete
/*
[437] Fix | Delete
* SEQ_FULLSIZE events are used for loading patches/samples to the
[438] Fix | Delete
* synthesizer devices. These events are passed directly to the driver
[439] Fix | Delete
* of the associated synthesizer device. There is no limit to the size
[440] Fix | Delete
* of the extended events. These events are not queued but executed
[441] Fix | Delete
* immediately when the write() is called (execution can take several
[442] Fix | Delete
* seconds of time).
[443] Fix | Delete
*
[444] Fix | Delete
* When a SEQ_FULLSIZE message is written to the device, it must
[445] Fix | Delete
* be written using exactly one write() call. Other events cannot
[446] Fix | Delete
* be mixed to the same write.
[447] Fix | Delete
*
[448] Fix | Delete
* For FM synths (YM3812/OPL3) use struct sbi_instrument and write it to the
[449] Fix | Delete
* /dev/sequencer. Don't write other data together with the instrument structure
[450] Fix | Delete
* Set the key field of the structure to FM_PATCH. The device field is used to
[451] Fix | Delete
* route the patch to the corresponding device.
[452] Fix | Delete
*
[453] Fix | Delete
* For wave table use struct patch_info. Initialize the key field
[454] Fix | Delete
* to WAVE_PATCH.
[455] Fix | Delete
*/
[456] Fix | Delete
#define SEQ_PRIVATE 0xfe /* Low level HW dependent events (8 bytes) */
[457] Fix | Delete
#define SEQ_EXTENDED 0xff /* Extended events (8 bytes) OBSOLETE */
[458] Fix | Delete
[459] Fix | Delete
/*
[460] Fix | Delete
* Record for FM patches
[461] Fix | Delete
*/
[462] Fix | Delete
[463] Fix | Delete
typedef unsigned char sbi_instr_data[32];
[464] Fix | Delete
[465] Fix | Delete
struct sbi_instrument {
[466] Fix | Delete
unsigned short key; /* FM_PATCH or OPL3_PATCH */
[467] Fix | Delete
#define FM_PATCH _PATCHKEY(0x01)
[468] Fix | Delete
#define OPL3_PATCH _PATCHKEY(0x03)
[469] Fix | Delete
short device; /* Synth# (0-4) */
[470] Fix | Delete
int channel; /* Program# to be initialized */
[471] Fix | Delete
sbi_instr_data operators; /* Register settings for operator cells (.SBI format) */
[472] Fix | Delete
};
[473] Fix | Delete
[474] Fix | Delete
struct synth_info { /* Read only */
[475] Fix | Delete
char name[30];
[476] Fix | Delete
int device; /* 0-N. INITIALIZE BEFORE CALLING */
[477] Fix | Delete
int synth_type;
[478] Fix | Delete
#define SYNTH_TYPE_FM 0
[479] Fix | Delete
#define SYNTH_TYPE_SAMPLE 1
[480] Fix | Delete
#define SYNTH_TYPE_MIDI 2 /* Midi interface */
[481] Fix | Delete
[482] Fix | Delete
int synth_subtype;
[483] Fix | Delete
#define FM_TYPE_ADLIB 0x00
[484] Fix | Delete
#define FM_TYPE_OPL3 0x01
[485] Fix | Delete
#define MIDI_TYPE_MPU401 0x401
[486] Fix | Delete
[487] Fix | Delete
#define SAMPLE_TYPE_BASIC 0x10
[488] Fix | Delete
#define SAMPLE_TYPE_GUS SAMPLE_TYPE_BASIC
[489] Fix | Delete
#define SAMPLE_TYPE_WAVEFRONT 0x11
[490] Fix | Delete
[491] Fix | Delete
int perc_mode; /* No longer supported */
[492] Fix | Delete
int nr_voices;
[493] Fix | Delete
int nr_drums; /* Obsolete field */
[494] Fix | Delete
int instr_bank_size;
[495] Fix | Delete
unsigned int capabilities;
[496] Fix | Delete
#define SYNTH_CAP_PERCMODE 0x00000001 /* No longer used */
[497] Fix | Delete
#define SYNTH_CAP_OPL3 0x00000002 /* Set if OPL3 supported */
[498] Fix | Delete
#define SYNTH_CAP_INPUT 0x00000004 /* Input (MIDI) device */
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function