Page 1 of 1

playback of Audio Clips

Posted: Wed Dec 20, 2006 7:15 am
by kradsith
Hello All,

I received my Dev board 2 days ago and it has surpassed my expectations already.

New to DSP programming and having some ASM programming experience. I am wondering if it

Posted: Wed Dec 20, 2006 11:07 am
by frank
You could have the FV-1 record a short clip then play it back. Here is a small example program that records the left and right channels and will play them back. Record/play is controlled by the position of POT0.

Code: Select all

; Define delays
delL	mem	16383
delR	mem	16383
;
; If POT0 is 0 to 0.5 we are in record mode
; If 0.5 to 0.999 we are in playback mode
;
ldax	pot0	; Read in POT0
sof	1.0,-0.5	; Add -0.5 to the POT0 value so it ranges -0.5 to +0.5
skp	gez,play	; If ACC is >=0 we are in playback mode so jump to play
ldax	adcl	; Read in ADC left
wra	delL,1.0	; Write to left delay line
wrax	dacl,0	; and to DAC left
ldax	adcr	; Read in ADC right
wra	delR,1.0	; Write to right delay line
wrax	dacr,0	; and to DAC right
skp	zro, end	; Jump to end
;
; Play back mode
play:
clr		; Clear ACC
rda	delL#,1.0; Read tail of left delay
wrax	dacl,0	; Write it to DAC left
rda	delR#,1.0; Read tail of right delay
wrax	dacr,0	; Write it to DAC right
;
end:

Posted: Thu Dec 21, 2006 8:08 am
by kradsith
Frank,

You replied way to quick and made it look way to easy.

Thanks!

Kradsith

Posted: Sun Sep 06, 2015 8:21 pm
by Mcfly
Hi Frank, in playback mode, is there any way to soften the transition between the end and the start of the audio clip. Something like a fade in and fade out.

Posted: Mon Sep 07, 2015 11:51 am
by frank
Not that I can think of, the start and end are always moving so you would need to track where you are in playback then do a cross fade as you get to the end. There really isn't a way I can think of to do this in the code.

Posted: Mon Sep 14, 2015 9:09 pm
by Sandrine
Maybe he means removing a DC click. That's easy to do using a "zero crossing" state delay. I've done it with my sampler project and it seems to work.
Set the loop points at only zero crossing moments (also direction can improve it) and that gets rid of the click sound.
With low level signals it's not as noticeable because there isn't such a difference.

Of course for the granulizer section (not FV-1) I used an actual quick fade for the slower rates, then the above for the higher rates (>50 loops/second)

Posted: Tue Sep 15, 2015 3:21 pm
by Mcfly
Sandrine wrote:Maybe he means removing a DC click. That's easy to do using a "zero crossing" state delay. I've done it with my sampler project and it seems to work.
Set the loop points at only zero crossing moments (also direction can improve it) and that gets rid of the click sound.
With low level signals it's not as noticeable because there isn't such a difference.

Of course for the granulizer section (not FV-1) I used an actual quick fade for the slower rates, then the above for the higher rates (>50 loops/second)
Yes, that's what im talking about. Any advice for coding a zero crossing detection? Thank you.

Posted: Sun Jun 19, 2016 3:07 pm
by MacroMachines
there is a skip instruction specifically for zero cross
SKP ZRC

Re:

Posted: Mon Jun 25, 2018 7:42 am
by alpignolo
frank wrote: Wed Dec 20, 2006 11:07 am You could have the FV-1 record a short clip then play it back. Here is a small example program that records the left and right channels and will play them back. Record/play is controlled by the position of POT0.

Code: Select all

; Define delays
delL	mem	16383
delR	mem	16383
;
; If POT0 is 0 to 0.5 we are in record mode
; If 0.5 to 0.999 we are in playback mode
;
ldax	pot0	; Read in POT0
sof	1.0,-0.5	; Add -0.5 to the POT0 value so it ranges -0.5 to +0.5
skp	gez,play	; If ACC is >=0 we are in playback mode so jump to play
ldax	adcl	; Read in ADC left
wra	delL,1.0	; Write to left delay line
wrax	dacl,0	; and to DAC left
ldax	adcr	; Read in ADC right
wra	delR,1.0	; Write to right delay line
wrax	dacr,0	; and to DAC right
skp	zro, end	; Jump to end
;
; Play back mode
play:
clr		; Clear ACC
rda	delL#,1.0; Read tail of left delay
wrax	dacl,0	; Write it to DAC left
rda	delR#,1.0; Read tail of right delay
wrax	dacr,0	; Write it to DAC right
;
end:
Hi Frank,
there's a way to remove the "click"/"glitch"?
Thanks

Re: playback of Audio Clips

Posted: Mon Jun 25, 2018 9:20 am
by frank
Not really, you could try but you need to track the head/tail write address and cross fade between the head and tail. I have not done this on the FV-1 and it is not simple since the user can record/play at any point in time and as a result any address could be the head/tail point.

Re: playback of Audio Clips

Posted: Sun May 09, 2021 5:18 am
by ZibiSound
Hello frank,
forgive me little off-topic, but I got a question. How can I change lenght of recorded sample? Eg, I record full sample (all delay memory), goes into playback mode and now, if pot is 1, processor plays all sample lenght (0 -> 32767), when pot is 0.9 processor plays only 0 -> 29490, etc.

Re: playback of Audio Clips

Posted: Sat May 15, 2021 4:26 am
by ZibiSound
@frank colud you give me some idea, please?

Re: playback of Audio Clips

Posted: Sat May 15, 2021 9:19 am
by frank
Not easy to do on FV-1, would not even try.

Re: playback of Audio Clips

Posted: Mon May 17, 2021 7:47 am
by ZibiSound
Ok, so maybe at least can I change sample lenght while recording?