summaryrefslogtreecommitdiffstats
path: root/arm-hybrid-22k/lib_src/ARM_synth_constants_gnu.inc
blob: b4cd29a36a7094af06fb61b19fb6f2f749bbe667 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
@***********************************************************
@ File:			ARM_synth_constants.inc
@ Processor:	ARM
@ Description:	Contains constants and defines, most of which
@			  	are mirrored in synth.h
@
@ Copyright Sonic Network Inc. 2004
@****************************************************************
@ Revision Control:
@   $Revision: 741 $
@   $Date: 2007-06-22 16:39:21 -0700 (Fri, 22 Jun 2007) $
@****************************************************************


	.ifdef	SAMPLE_RATE_8000
	.equ	SYNTH_UPDATE_PERIOD_IN_BITS, 5
	.equ	BUFFER_SIZE_IN_MONO_SAMPLES, 32
	.endif

	.ifdef	SAMPLE_RATE_16000
	.equ	SYNTH_UPDATE_PERIOD_IN_BITS, 6
	.equ	BUFFER_SIZE_IN_MONO_SAMPLES, 64
	.endif

	.ifdef	SAMPLE_RATE_20000
	.equ	SYNTH_UPDATE_PERIOD_IN_BITS, 7
	.equ	BUFFER_SIZE_IN_MONO_SAMPLES, 128
	.endif

	.ifdef	SAMPLE_RATE_22050
	.equ	SYNTH_UPDATE_PERIOD_IN_BITS, 7
	.equ	BUFFER_SIZE_IN_MONO_SAMPLES, 128
	.endif

	.ifdef	SAMPLE_RATE_24000
	.equ	SYNTH_UPDATE_PERIOD_IN_BITS, 7
	.equ	BUFFER_SIZE_IN_MONO_SAMPLES, 128
	.endif

	.ifdef	SAMPLE_RATE_32000
	.equ	SYNTH_UPDATE_PERIOD_IN_BITS, 7
	.equ	BUFFER_SIZE_IN_MONO_SAMPLES, 128
	.endif

	.ifdef	SAMPLE_RATE_44100
	.equ	SYNTH_UPDATE_PERIOD_IN_BITS, 8
	.equ	BUFFER_SIZE_IN_MONO_SAMPLES, 256
	.endif

	.ifdef	SAMPLE_RATE_48000
	.equ	SYNTH_UPDATE_PERIOD_IN_BITS, 8
	.equ	BUFFER_SIZE_IN_MONO_SAMPLES, 256
	.endif


@ if the OUTPUT PCM sample is 16-bits, then when using indexed addressing,
@ the next sample is this many bytes away
	.equ	NEXT_OUTPUT_PCM, 2

@****************************************************************************
@/* macros for fractional phase accumulator */
	.equ	NUM_PHASE_FRAC_BITS, 15

	.equ	PHASE_FRAC_MASK, 0x7FFF

@ shift for phase accumulator when fraction carries over
	.ifdef	SAMPLES_8_BIT
	.equ	NEXT_INPUT_PCM_SHIFT, 0
	.endif

	.ifdef	SAMPLES_16_BIT
	.equ	NEXT_INPUT_PCM_SHIFT, 1
	.endif

@****************************************************************************
	.equ	NUM_MIXER_GUARD_BITS, 4

@****************************************************************************
@/* Envelope 1 (EG1) calculation macros */
	.equ	NUM_EG1_FRAC_BITS, 15

@****************************************************************************

	.equ	NUM_ENHANCER_FILTER_COEF_FRAC_BITS, 5

@****************************************************************************

@
@ I've temporarily given up on the idea of getting ADS/RV and gcc to
@ handle a struct in a compatible fashion. Switching to old fashion EQU
@

	.if	FILTER_ENABLED
@**************************************
@ typedef struct s_filter_tag
	.equ	m_z1, 0
	.equ	m_z2, 2
	.endif

@**************************************
@ typedef struct s_wt_frame_tag
	.equ	m_gainTarget, 0
	.equ	m_phaseIncrement, 4

	.if	FILTER_ENABLED
	.equ	m_k, 8
	.equ	m_b1, 12
	.equ	m_b2, 16
	.equ	m_pAudioBuffer, 20
	.equ	m_pMixBuffer, 24
	.equ	m_numSamples, 28
	.equ	m_prevGain, 32
	.else
	.equ	m_pAudioBuffer, 8
	.equ	m_pMixBuffer, 12
	.equ	m_numSamples, 16
	.equ	m_prevGain, 20
	.endif


@**************************************
@ typedef struct s_wt_voice_tag
	.equ	m_pLoopEnd, 0	@ /* points to last PCM sample (not 1 beyond last) */
	.equ	m_pLoopStart, 4	@ /* points to first sample at start of loop */
	.equ	m_pPhaseAccum, 8	@ /* points to first sample at start of loop */
	.equ	m_phaseFrac, 12	@ /* points to first sample at start of loop */

	.if	STEREO_OUTPUT
	.equ	m_gainLeft, 16 	@ /* current gain, left ch  */
	.equ	m_gainRight, 18	@ /* current gain, right ch */
	.endif


@****************************************************************************
@ enhancer
	.equ	m_nEnhancerFeedForward1, 0
	.equ	m_nEnhancerFeedback1, 1
	.equ	m_nDriveCoef, 2
	.equ	m_nEnhancerFeedback2, 3
	.equ	m_nWet, 4
	.equ	m_nDry, 5

	.equ	m_zF0L, 6	@ filter 1 zero state var, left
	.equ	m_zF1L, 8	@ filter 1 pole state var, left
	.equ	m_zF2L, 10	@ filter 2 zero state var, left
	.equ	m_zF0R, 12	@ filter 1 zero state var, right
	.equ	m_zF1R, 14	@ filter 1 pole state var, right
	.equ	m_zF2R, 16	@ filter 2 zero state var, right

@****************************************************************************