Blame ld10k1/contrib/emu10k1MIDIEffects/fv-basstreble.inc

Packit Service b98cfc
;;     fv-basstreble.m4 - fv10k1 package
Packit Service b98cfc
;;     Defines macros for bass/treble filters
Packit Service b98cfc
;; 
Packit Service b98cfc
;;     This is wholly derived from Daniel Bertrand's tone.asm in the emu10k1 
Packit Service b98cfc
;;     driver (see emu10k1/utils/as10k1/effects/tone.asm).
Packit Service b98cfc
;;    
Packit Service b98cfc
;;     This program is free software; you can redistribute it and/or modify
Packit Service b98cfc
;;     it under the terms of the GNU General Public License as published by
Packit Service b98cfc
;;     the Free Software Foundation; either version 2 of the License, or
Packit Service b98cfc
;;     (at your option) any later version.
Packit Service b98cfc
;; 
Packit Service b98cfc
;;     This program is distributed in the hope that it will be useful,
Packit Service b98cfc
;;     but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service b98cfc
;;     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service b98cfc
;;     GNU General Public License for more details.
Packit Service b98cfc
;; 
Packit Service b98cfc
;;     You should have received a copy of the GNU General Public License
Packit Service b98cfc
;;     along with this program; if not, write to the Free Software
Packit Service b98cfc
;;     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
Packit Service b98cfc
;; 
Packit Service b98cfc
;; $Id: fv-basstreble.inc,v 1.1 2001/09/28 01:56:20 dbertrand Exp $
Packit Service b98cfc
Packit Service b98cfc
;;; a and b coefs for bass:	
Packit Service b98cfc
Packit Service b98cfc
Packit Service b98cfc
b_b	con   2.736129417e-01    5.240710533e-01    2.620355267e-01
Packit Service b98cfc
a_b	con   9.560258858e-01    -4.576868881e-01
Packit Service b98cfc
	
Packit Service b98cfc
;;; a and b coef for treble:	
Packit Service b98cfc
b_t con		-4.982305773e-01   9.964611547e-01    -4.982305773e-01
Packit Service b98cfc
a_t con 	 9.317583774e-01    -4.356836381e-01
Packit Service b98cfc
	
Packit Service b98cfc
scalein  con 2.449e-05, 1.157407407e-04
Packit Service b98cfc
scaleout con 128, 16192
Packit Service b98cfc
Packit Service b98cfc
dly_b1	sta 0,0
Packit Service b98cfc
dly_t1	sta 0,0
Packit Service b98cfc
Packit Service b98cfc
tmp dyn 1     ; miscellaneous temp storage
Packit Service b98cfc
tmpout dyn 1
Packit Service b98cfc
Packit Service b98cfc
;;; end of bass/treble definitions
Packit Service b98cfc
Packit Service b98cfc
;;;
Packit Service b98cfc
;;; This macro applies the bass/treble controls (based on eq2.asm)
Packit Service b98cfc
;;;
Packit Service b98cfc
basstreble MACRO dest,source,tone_bass,tone_treble,dly_b,dly_t
Packit Service b98cfc
	;;; tone_bass filter(iir):
Packit Service b98cfc
	macw	tmp, C_0,  dly_b+1,  a_b+1
Packit Service b98cfc
	macw	tmp, tmp,  dly_b  ,  a_b
Packit Service b98cfc
	macw	tmp,tmp,source,scalein
Packit Service b98cfc
	macints	tmp, C_0, tmp, C_2
Packit Service b98cfc
  
Packit Service b98cfc
	macs	C_0,C_0,C_0,C_0
Packit Service b98cfc
	macmv	dly_b+1,dly_b,	dly_b+1, b_b+2
Packit Service b98cfc
	macmv	dly_b,tmp,	dly_b,   b_b+1
Packit Service b98cfc
	macw	tmp,ACCUM,	tmp,     b_b	
Packit Service b98cfc
	macs	tmp,C_0,tone_bass,tmp
Packit Service b98cfc
	macints	tmpout,C_0,tmp,scaleout
Packit Service b98cfc
Packit Service b98cfc
  ;;; tone_treble
Packit Service b98cfc
	macw	tmp, C_0,  dly_t+1,  a_t+1 	
Packit Service b98cfc
	macw	tmp, tmp,  dly_t  ,  a_t
Packit Service b98cfc
	macw	tmp, tmp, source,scalein+1
Packit Service b98cfc
	macints	tmp,C_0,tmp,C_2
Packit Service b98cfc
	
Packit Service b98cfc
	macs	C_0,C_0,C_0,C_0
Packit Service b98cfc
	macmv	dly_t+1,dly_t,	dly_t+1, b_t+2
Packit Service b98cfc
	macmv	dly_t,tmp,	dly_t,   b_t+1
Packit Service b98cfc
	macw	tmp,ACCUM,	tmp,     b_t	
Packit Service b98cfc
	macs	tmp,C_0,tone_treble,tmp
Packit Service b98cfc
  
Packit Service b98cfc
	macints	dest,tmpout,tmp,scaleout+1
Packit Service b98cfc
  
Packit Service b98cfc
  ENDM
Packit Service b98cfc
Packit Service b98cfc
;;;
Packit Service b98cfc
;;; This macro applies the bass/treble controls (based on eq2.asm)
Packit Service b98cfc
;;; and stores results into two separate GPRs
Packit Service b98cfc
;;;
Packit Service b98cfc
basstreblesep MACRO dest_b,dest_t,source,tone_bass,tone_treble,dly_b,dly_t
Packit Service b98cfc
	;;; tone_bass filter(iir):
Packit Service b98cfc
	macw	tmp, C_0,  dly_b+1,  a_b+1
Packit Service b98cfc
	macw	tmp, tmp,  dly_b  ,  a_b
Packit Service b98cfc
	macw	tmp,tmp,source,scalein
Packit Service b98cfc
	macints	tmp, C_0, tmp, C_2
Packit Service b98cfc
  
Packit Service b98cfc
	macs	C_0,C_0,C_0,C_0
Packit Service b98cfc
	macmv	dly_b+1,dly_b,	dly_b+1, b_b+2
Packit Service b98cfc
	macmv	dly_b,tmp,	dly_b,   b_b+1
Packit Service b98cfc
	macw	tmp,ACCUM,	tmp,     b_b	
Packit Service b98cfc
	macs	tmp,C_0,tone_bass,tmp
Packit Service b98cfc
	macints	tmpout,C_0,tmp,scaleout
Packit Service b98cfc
Packit Service b98cfc
  ;;; tone_treble
Packit Service b98cfc
	macw	tmp, C_0,  dly_t+1,  a_t+1 	
Packit Service b98cfc
	macw	tmp, tmp,  dly_t  ,  a_t
Packit Service b98cfc
	macw	tmp, tmp, source,scalein+1
Packit Service b98cfc
	macints	tmp,C_0,tmp,C_2
Packit Service b98cfc
	
Packit Service b98cfc
	macs	C_0,C_0,C_0,C_0
Packit Service b98cfc
	macmv	dly_t+1,dly_t,	dly_t+1, b_t+2
Packit Service b98cfc
	macmv	dly_t,tmp,	dly_t,   b_t+1
Packit Service b98cfc
	macw	tmp,ACCUM,	tmp,     b_t	
Packit Service b98cfc
	macs	tmp,C_0,tone_treble,tmp
Packit Service b98cfc
  
Packit Service b98cfc
	macints	dest_t,C_0,tmp,scaleout+1
Packit Service b98cfc
  acc3    dest_b,tmpout,C_0,C_0
Packit Service b98cfc
  
Packit Service b98cfc
  ENDM
Packit Service b98cfc
Packit Service b98cfc
  END