📄 adt&slapback.asm
字号:
rts; /* Return from Subroutine */
/* ///////////////////////////////////////////////////////////////////////////////////////// */
/* Stereo Automatic Double Tracking - ADT Audio Effect using a digital delay-line */
/* Digital Delay Effect to create a stereo field effect */
/* Also called 'Stereo Doubling' */
/* ///////////////////////////////////////////////////////////////////////////////////////// */
Stereo_Double_Tracking: /* process right channel input only */
/* get input samples from data holders */
r0 = dm(Left_Channel_In); /* left input sample */
r1 = dm(Right_Channel_In); /* right input sample */
L6 = dm(delay_time);
/* 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 SPORT0 I2S channel A transmitter */
dm(Left_Channel) = r0; /* left output sample */
dm(Right_Channel) = 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 */
r4 = 0;
dm(RX_left_flag) = r4; /* clear RX_left_flag since we have processed incoming data */
rts; /* Return from Subroutine */
/* ------------------------------------------------------------------------------------ */
/* */
/* IRQ2 Pushbutton Interrupt Service Routine */
/* */
/* This routine determines which audio effect routine to execute. */
/* Pressing the IRQ2 pushbutton will toggle between each effect. The default */
/* effect slapback. */
/* */
/* ------------------------------------------------------------------------------------ */
change_audio_effect:
bit set mode1 SRRFH; /* enable background register file */
NOP; /* 1 CYCLE LATENCY FOR WRITING TO MODE1 REGISER!! */
r11 = 2;
r10 = DM(effects_counter); /* get last count from memory */
r10 = r10 + 1; /* increment preset */
comp (r10, r11); /* compare current count to max count */
if ge r10 = r10 - r10; /* if count equals max, reset to zero and start over */
DM(effects_counter) = r10; /* save updated count */
exit:
rti(db);
bit clr mode1 SRRFH; /* switch back to primary register set */
nop;
/* ------------------------------------------------------------------------------------ */
/* */
/* IRQ1 Pushbutton Interrupt Service Routine */
/* */
/* This routine allows the user to modify reverb presets on-the-fly to allow for */
/* emulation of either large 'valley' echo, medium hallway echo, or small echo. */
/* */
/* Default before 1st IRQ push: Delay = 20.83 msec */
/* 1st Pushbutton Press: Delay Setting #1 - 35 msec */
/* 2nd Pushbutton Press: Delay Setting #2 - 62.5 msec */
/* 3rd Pushbutton Press: Delay Setting #3 - 125 msec */
/* 4th Pushbutton Press: Delay Setting #4 - 0.25 sec */
/* 5th Pushbutton Press: Delay Setting #4 - 0.50 sec */
/* 6th Pushbutton Press: Delay Setting #4 - 1.0 sec */
/* 7th Pushbutton Press: Reverts back to 1st Pushbutton Press */
/* ------------------------------------------------------------------------------------ */
change_delay_settings:
bit set mode1 SRRFH; /* enable background register file */
NOP; /* 1 CYCLE LATENCY FOR WRITING TO MODE1 REGISER!! */
/* if flag2_in jump change_parameter; */
r13 = 6; /* number of presets */
r15 = DM(IRQ1_counter); /* get preset count */
r15 = r15 + 1; /* increment preset */
comp (r15, r13);
if ge r15 = r15 - r15; /* reset to zero */
DM(IRQ1_counter) = r15; /* save preset count */
r10 = pass r15; /* get preset mode */
if eq jump delay_settings_2; /* check for count == 0 */
r10 = r10 - 1;
if eq jump delay_settings_3; /* check for count == 1 */
r10 = r10 - 1;
if eq jump delay_settings_4; /* check for count == 3 */
r10 = r10 - 1;
if eq jump delay_settings_5; /* check for count == 4 */
r10 = r10 - 1;
if eq jump delay_settings_6; /* check for count == 4 */
delay_settings_1: /* count therefore, is == 5 if you are here */
/* Depth, or TD = D/fs = 1680/48000 = 35 msec */
r14 = 1632;
DM(delay_time) = r14;
bit set ustat1 0x3E; /* turn on Flag4 LED */
bit clr ustat1 0x01;
dm(IOSTAT)=ustat1;
jump done;
delay_settings_2:
/* Depth, or TD = D/fs = 3000/48000 = 62.5 msec */
r14 = 3000;
DM(delay_time) = r14;
bit set ustat1 0x3D; /* turn on Flag5 LED */
bit clr ustat1 0x02;
dm(IOSTAT)=ustat1;
jump done;
delay_settings_3:
/* Depth, or TD = D/fs = 6000/48000 = 125 msec */
r14 = 6000;
DM(delay_time) = r14;
bit set ustat1 0x3B; /* turn on Flag6 LED */
bit clr ustat1 0x04;
dm(IOSTAT)=ustat1;
jump done;
delay_settings_4:
/* Depth, or TD = D/fs = 12000/48000 = .25 sec */
r14 = 12000;
DM(delay_time) = r14;
bit set ustat1 0x37; /* turn on Flag7 LED */
bit clr ustat1 0x08;
dm(IOSTAT)=ustat1;
jump done;
delay_settings_5:
/* Depth, or TD = D/fs = 24000/48000 = .50 sec */
r14 = 24000;
DM(delay_time) = r14;
bit set ustat1 0x2F; /* turn on Flag8 LED */
bit clr ustat1 0x10;
dm(IOSTAT)=ustat1;
jump done;
delay_settings_6:
/* Depth, or TD = D/fs = 48000/48000 = 1.0 sec */
r14 = 48000;
DM(delay_time) = r14;
bit set ustat1 0x1F; /* turn on Flag9 LED */
bit clr ustat1 0x20;
dm(IOSTAT)=ustat1;
done:
rti(db);
bit clr mode1 SRRFH; /* switch back to primary register set */
nop;
.endseg;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -