2 * softoss.h - Definitions for Software MIDI Synthesizer.
5 * Copyright (C) by Hannu Savolainen 1993-1997
7 * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
8 * Version 2 (June 1991). See the "COPYING" file distributed with this software
14 * Sequencer mode1 timer calls made by sequencer.c
16 extern int (*softsynthp
) (int cmd
, int parm1
, int parm2
, unsigned long parm3
);
19 #define SSYN_REQUEST 2 /* parm1 = time */
21 #define SSYN_GETTIME 4 /* Returns number of ticks since reset */
24 #define MAX_SAMPLE 512
26 #define DEFAULT_VOICES 16
28 typedef struct voice_info
31 * Don't change anything in the beginning of this struct. These fields are used
32 * by the resampling loop which may have been written in assembly for some
33 * architectures. Any change may make the resampling code incompatible
37 struct patch_info
*sample
;
39 unsigned int ptr
; int step
; /* Pointer to the wave data and pointer increment */
42 int startloop
, startbackloop
, endloop
, looplen
;
44 unsigned int leftvol
, rightvol
;
45 /***** Don't change anything above this */
47 volatile unsigned long orig_freq
, current_freq
;
48 volatile int bender
, bender_range
, panning
;
49 volatile int main_vol
, expression_vol
, patch_vol
, velocity
;
51 /* Envelope parameters */
54 volatile int envelope_vol
;
55 volatile int envelope_volstep
;
56 int envelope_time
; /* Number of remaining envelope steps */
57 unsigned int envelope_target
;
59 int sustain_mode
; /* 0=off, 1=sustain on, 2=sustain on+key released */
76 extern voice_info softoss_voices
[MAX_VOICE
]; /* Voice spesific info */
78 typedef struct softsyn_devc
81 * Don't change anything in the beginning of this struct. These fields are used
82 * by the resampling loop which may have been written in assembly for some
83 * architectures. Any change may make the resampling code incompatible
85 int maxvoice
; /* # of voices to be processed */
88 int control_rate
, control_counter
;
89 /***** Don't change anything above this */
106 int default_max_voices
;
110 int samples_per_fragment
;
116 struct patch_info
*samples
[MAX_SAMPLE
];
117 short *wave
[MAX_SAMPLE
];
122 int programs
[MAX_PATCH
];
127 volatile unsigned long usecs
;
128 volatile unsigned long usecs_per_frag
;
129 volatile unsigned long next_event_usecs
;
135 volatile int engine_state
;
139 /* Voice spesific bitmaps */
140 volatile int tremolomap
;
141 volatile int vibratomap
;
145 void softsynth_resample_loop(short *buf
, int loops
);
146 extern void softsyn_control_loop(void);
148 #define DELAY_SIZE 4096
151 short voice_active
[MAX_VOICE
] = {0};
152 voice_info softoss_voices
[MAX_VOICE
] = {{0}}; /* Voice spesific info */
153 int left_delay
[DELAY_SIZE
]={0}, right_delay
[DELAY_SIZE
]={0};
156 extern softsyn_devc
*devc
;
158 extern int left_delay
[DELAY_SIZE
], right_delay
[DELAY_SIZE
];
160 extern short voice_active
[MAX_VOICE
];