Bitcrusher

Hardware questions and issues with the FV-1

Moderator: frank

Post Reply
accumulator
Posts: 8
Joined: Wed Jun 25, 2008 10:50 am

Bitcrusher

Post by accumulator »

Can anyone provide a snippet of working code for a Bitcrusher effect?


Thank you!
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

Here's a simple example, simply ANDing off the lower bits:

Code: Select all

crush equ 0xfc0000 ;define the bit mask - 6 bits here
clr
rdax adcl,0.5
rdax adcr,0.5
skp neg,invit; working with 2's comp numbers, if negative skip down
and crush
skp gez,outter
invit:
sof -1.0,0 ; for negative samples, invert them,
and crush ; mask the data
sof -1.0,0 ; invert it back
outter:
wrax dacl,1.0
wrax dacr,1.0
You could get fancier (use a POT input to determine mask, etc.)
Frank Thomson
Experimental Noize
frank
Posts: 1244
Joined: Wed Oct 19, 2005 12:26 pm
Contact:

Post by frank »

A simple aliaser:

Code: Select all

flopper equ reg0
lastval equ reg1
ratio equ 0.95 ; 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,0
Frank Thomson
Experimental Noize
Post Reply