⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 slapback.asm

📁 电子元件资料-170M-pdf版.zip
💻 ASM
字号:
/* *********************************************************************************************
  SLAPBACK.ASM

  Slapback ('Doubling') Effect
  One popular use of the digital delay is to quickly repeat the input signal with a 
  single reflection at unity gain. By making the delay an input signal around 15-40 milliseconds, 
  the resulting output produces a "slapback/doubling " effect.  The slight differences in the delay 
  create the effect of the two parts being played in unison.  This technique adds the delayed signal 
  together with the original, were either the left or right channel is mixed with the delay, and 
  the result is sent to both output channels.  With short delays, slapback can thicken the sound 
  of an instrument or voice when mixed for a mono result, although cancellations can occur from 
  comb filtering side effects when the delay is under 10 ms, which will result in a hollow, resonant 
  sound.

  Automatic Double Tracking (Stereo Doubling) - "Simulation of a Concert Announcer"
  Automatic Double Tracking, which is used by audio engineers in the music industry to create a sense 
  of spaciousness in stereophonic systems .   This effect is set up to playback the original "dry" signal 
  in one stereo channel and the delayed signal in the other channel.  This creates the impression of 
  a stereo effect using a single mono source. By making the delay an input signal around 15-40 
  milliseconds, the resulting output produces a "stereo doubling" effect.


  These effects are great for 'spicing' up an instrument or vocal track.  Though some recording engineers
  overuse these effects to try to cover up a singer's out-of-key voice.


  John Tomarakos 
  ADI DSP Applications
  Revision 1.0
  10/1/98

********************************************************************************************* */

/* ADSP-21060 System Register bit definitions */
#include 	"def21065l.h"
#include 	"new65Ldefs.h"

.GLOBAL		Init_Delay_Buffer;
.GLOBAL		Auto_Double_Tracking;
.GLOBAL		Slapback_Echo;
.EXTERN 	Left_ChannelA_In;
.EXTERN 	Right_ChannelA_In;
.EXTERN 	Left_ChannelA_Out;
.EXTERN 	Right_ChannelA_Out;

/* ------------- DATA MEMORY FILTER BUFFERS ---------------------------------*/
.segment /dm	dm_delay;

#define DelayLine  	3264			/* Depth, or TD = D/fs = 1680/96000 = 35 msec   */
#define DelayLine2  6000 			/* Depth, or TD = D/fs = 3000/96000 = 62.5 msec */
#define DelayLine3	12000			/* Depth, or TD = D/fs = 3000/96000 = 125 msec  */
#define DelayLine4	24000			/* Depth, or TD = D/fs = 3000/96000 = .25 sec   */
#define DelayLine5	48000			/* Depth, or TD = D/fs = 3000/96000 = .50 sec   */
#define DelayLine6	96000			/* Depth, or TD = D/fs = 3000/96000 = 1.0 sec   */
			
.var	w[DelayLine2 + 1];			/* delay-line buffer, max delay = D */

.endseg;

/* ---------------------------------- PROGRAM MEMORY CODE ------------------------------------- */

.segment /pm pm_code;

Init_Delay_Buffer:

		B6 = w;  	L6 = @w;     		/* delay-line buffer pointer and length for ADT Effect */
		M6 = 1;

		LCNTR = L6; 					/* clear delay line buffer 2 to zero */
    	DO clrDline UNTIL LCE;
clrDline:         dm(I6, M6) = 0;

		rts;


/* -----------------------------------------------------------------------------------------*/
/* 	Slapback Echo - ADT Audio Effect using a digital delay-line 	     		     		*/
/* 	Digital Delay Effect to create a mono echo effect				     					*/
/* 											     											*/
/* 	This routines scales & mixes both input channels into 1 audio stream		     		*/
/* -----------------------------------------------------------------------------------------*/
	
Slapback_Echo:  						/* process both channel inputs */
	   	
   		/* get input samples from data holders */
   		r0 = dm(Left_ChannelA_In);          /* left input sample */
   		r1 = dm(Right_ChannelA_In);         /* right input sample */

		r1 = ashift r1 by -1;				/* scale signal by 1/2 for equal mix */
		r2 = ashift r2 by -1;				/* scale signal by 1/2 for equal mix */
		r1 = r2 + r1;						/* 1/2xL(n) + 1/2 xR(n) */


   		/* tap output of circular delay line */
   		r3 = dm(i6, 0);    					/* point to d-th tap and put in data register */
											/* fetch address with no update */

		/* add delayed signal together with original signal */
    	r1 = ashift r1 by -1;				/* scale input signal by 1/2 for equal mix */
		r3 = ashift r3 by -1;				/* scale delayed signal by 1/2 for equal mix */
		r4 = r3 + r1;						/* 1/2xL(n) + 1/2 xR(n) */

   		/* write output samples to AD1819 Master Codec channels */
   		dm(Left_ChannelA_Out)  = r4;       	/* left output sample */
   		dm(Right_ChannelA_Out) = r4;	    /* right output sample */

   		/* put input sample into tap-0 of delay line, post-modify address after storage of input */
   		dm(i6, -1) = r1;  					/* put value from register r1 into delay line */
											/* and decrement address by -1 */

   		rts;								/* Return from Subroutine */
	          	
	
	
/* -----------------------------------------------------------------------------------------*/
/* 	Automatic Double Tracking - ADT Audio Effect using a digital delay-line 	     		*/
/* 	Digital Delay Effect to create a stereo field effect				     				*/
/* 											     											*/
/* -----------------------------------------------------------------------------------------*/

Auto_Double_Tracking:  						/* process right channel input only */	
   		/* get input samples from data holders */
   		r0 = dm(Left_ChannelA_In);          /* left input sample */
   		r1 = dm(Right_ChannelA_In);         /* right input sample */

   		/* tap output of circular delay line */
   		r3 = dm(i6, 0);    					/* point to d-th tap and put in data register */
											/* fetch address with no update */

   		/* write output samples to AKM DAC A channels */
   		dm(Left_ChannelA_Out)  = r0;       	/* left output sample */
   		dm(Right_ChannelA_Out) = r3;	    /* right output sample */

   		/* put input sample into tap-0 of delay line, post-modify address after storage of input */
   		dm(i6, -1) = r1;  					/* put value from register r1 into delay line */
											/* and decrement address by -1 */

   		rts;								/* Return from Subroutine */
	          
.endseg;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -