Page 1 of 1

BitCrusher again

Posted: Fri Sep 06, 2013 10:04 am
by ZibiSound
Hi.
I found nice bit crusher effect. Here's the code:

Code: Select all

flopper equ reg0 
lastval equ reg1 
ratio equ 0.2 ; Set between 0 and 0.975 in 0.025 steps to change alias ratio, 0 is no alias 
clr 
rdax flopper,1.0 ;read counter 
sof 1.0,-0.025 ; subtract 1 
skp gez, outter ; if > 0 jump to output 
rdax adcl,0.5 ; else get input 
rdax adcr,0.5 
wrax lastval,0 ; write to out reg 
sof 0,ratio ; reload counter 
outter: 
wrax flopper,0 ; save counter 
clr 
rdax lastval,1.0 
wrax dacl,1.0 
wrax dacr,1.0
This effect works nice, but level of generated effect is set by 3 line of code (ratio equ "value"). The interval of it is 0-0,975. I want to do this by using pot (for example POT1) but I don't know how to do this. Could someone show me ?

Thanks.

Posted: Fri Sep 06, 2013 1:14 pm
by frank
This is not a bit-crusher it is an aliaser.

Read the docs and try to mod the code yourself first.

Here is a hint, you want to load the pot value into flopper so find the place where the counter is reloaded and mod it to load the pot value rather than the fixed value.

Posted: Mon Sep 09, 2013 12:55 pm
by ZibiSound
It isn't that am lazy, I really have no idea how to do this. I don't know assembler :( And this effect is the last missing, that I would like to have in my effector.

I see that you're good at writing these effects (previous works for others members), so I think it's not a big problem for you to add a few lines to this code. It could really help me.

--
Sorry for my english, man.

Posted: Mon Sep 09, 2013 2:31 pm
by frank
I do help people with code but they try to understand it and make the changes themselves. We do not have the time to customize programs for people, if we do it for one person we must do it for all people and we do not have the resources to do that.

Posted: Mon Sep 09, 2013 8:06 pm
by ZibiSound
If it's a such big problem for you, what have I to say ? I think that other people will benefit from this too, if you help me with this code. This effect is quite popular. Or maybe is somewhere a complete code ?

I think it would be faster if you do it for me than trying to explain it to me, because I just don't understand.

Posted: Wed Sep 11, 2013 6:00 am
by ZibiSound
I have read your advice few times and I was able to properly modify the code at first try. Now it's works like I wanted at the beginning :D

I put the modified code below. I use POT1 (center) to control a crushing, and position 0 is bypass.

Code: Select all

flopper equ reg0 
lastval equ reg1
clr 
rdax flopper,1.0 ;read counter 
sof 1.0,-0.025 ; subtract 1 
skp gez, outter ; if > 0 jump to output 
rdax adcl,0.5 ; else get input 
rdax adcr,0.5 
wrax lastval,0 ; write to out reg
rdax POT1,1.0
sof 1,0 ; reload counter 
outter: 
wrax flopper,0 ; save counter 
clr 
rdax lastval,1.0 
wrax dacl,1.0 
wrax dacr,1.0
Thanks again man :)