Page 1 of 2
any interest in "bitcrusher" ics?
Posted: Fri Oct 21, 2011 2:14 pm
by multi_s
I made a program compatible with an 8 pin dip PIC that is a simple bitcrusher. It gives 3 controls: resolution, sampling rate and a mute/gate. You can feed the inputs with a pot or a voltage (ie LFO, expression pedal etc). At the minimum you need a dual opamp to condition the audio input/output signals and a 5 volt regulator to condition the power for the PIC. However you could easily do something much more elaborate with LFOs and such on the parameters. The advantage is that the bitcrusher function is black boxed in the pic, and all other signals can be analog so its easy to make designs with it.
I was thinking to make a document of application circuits etc but i wanted to gauge interest in such a thing before wasting a bunch of time. I will be selling the chips programmed for ~ 5 bucks. Demo within the next week.
Re: any interest in "bitcrusher" ics?
Posted: Fri Oct 21, 2011 2:17 pm
by Schlatte
how do you dac the signal after the pic? pwm?
what pic are you using?
I've made something similar as a project in school... pretty neat

Re: any interest in "bitcrusher" ics?
Posted: Fri Oct 21, 2011 2:34 pm
by culturejam
Need more details. But interested.
Re: any interest in "bitcrusher" ics?
Posted: Fri Oct 21, 2011 3:03 pm
by eatyourguitar
its a analog in / crushed analog out. Multi_S started talking about it in another thread a few weeks ago. there is no way on earth anyone could make a simpler bitcrusher with fewer parts. he also brought up the idea of a pic/relay thing for true bypass soft switching. all good ideas. we should support him and buy his shit.
Re: any interest in "bitcrusher" ics?
Posted: Fri Oct 21, 2011 3:16 pm
by Schlatte
^that guy... has a point.
Even if I had the whole project at home I would buy two or three. Support you guyz!!!
Re: any interest in "bitcrusher" ics?
Posted: Fri Oct 21, 2011 4:20 pm
by multi_s
ok i will try to post results by the end of the weekend. but yes its just pwm out. since it is only an 8 pin package it would be hard to do it any other way. I had actually thought of doing this a long time ago but the pwm frequency on the pic12's is really slow so you need a lot of filtering on the output, you might as well just use a better/larger pic. the newer ones are orders of magnitude faster so not only is the switching out of the audio band but its something like 125 kHz for 8 bit res. A second order salen key filter on the output basically eliminates it from the signal and can be implemented in a single op amp.
the solution is aimed at simplicity and flexibility.
re the relay thing: i did implement this as well but i am not sure how to 'bypass' a fundamental problem with relays.You have 2 types, make before break, and break before make. Almost all relays are break before make so there is a very short time when nothing is connected to the signal path (spec sheet says ~ 3ms max but measurements show it is typically much less). I did some tests switching between 2 identical signals, and you can hear a slight artifact. I am not sure if this is overcome on the Jack Deville design because there are almost no audio demos of such and really i don't know if i care enough to buy one and check, but he claims it is super quiet so i would give him the benefit of the doubt since it is something he is selling commercially and his products have a great rep. Either way, when there is no signal the switch is dead quiet.
Alternatively you can go with make before break which means that momentarily the bypass and the effect are connected. technically this creates a feedback looper momentarily but according to spec sheets its typically a period of about 10 microseconds. This does not seem to create an issue on what i tested with, although the test was far from exhaustive.
In a test switching between 2 identical signals the relay was completely transparent. The cons of the make before break relay is that i have not found one available in a latching configuration which means you are consuming current whenever the relay is engaged. (typically 20-40mA depending on the specific relay) This is obviously a drawback, so both designs present a pro and con .
I know you are thinking, why the hell would you switch between 2 identical signals. well because i wanted to see how much noise is actually induced by the switch. In real life the signals will not be identical and you will hear some artifact anyway since its unlikely they will have the exact same amplitude. Also my test of relays was not exhaustive so there may be better suited ones that give better results, however a review of several spec sheets shows that the timing characteristics across most manufacturers is more or less similar. It is also possible i am incorrect about what's causing the artifacts but i have done quite a bit of testing to come to that conclusion.
I have moved on to other things and have midterms now so that is more or less the conclusion of that. I have PIC programs for implementing either style of momentary/non momentary discussed in the previous thread if anyone is actually that interested. They work on any of the PIC12f50x series which are among the cheapest pics available (~75 cents). It is rather trivial so I am willing to give out the hex files freely so you can program your own.
Re: any interest in "bitcrusher" ics?
Posted: Fri Oct 21, 2011 4:27 pm
by Schlatte
multi_s wrote:It is rather trivial so I am willing to give out the hex files freely so you can program your own.
What about the C-Code
No but srsly, I always thought "yeah bitcrushing is easy... you just "&" the ADC value with some random digits"... so my first try was to take two adc channels and just use channel 0 (with a little gain stage, of course) to read in the guitar signal and channel 1 to read in a pot-value (0-5V ya'know) and just "&" them... turns out it's not that easy

but I used a R-2R network as an easy diy DAC (used the 18F4550 for prototyping).
Re: any interest in "bitcrusher" ics?
Posted: Fri Oct 21, 2011 4:40 pm
by multi_s
i dont program pic12s in C. it is a total waste. since thy are slow and have very limited ram i just use assembly. you should not use them to do complex things so using assembly is not that daunting. there are only about 20-40 instructions you need to learn to do low level pics in assembly.
also why & with random? you should & with the resolution. Typically I implement an array of masks, and then & with the masks. For example if we had a 4 bit system the array for standard crushing (resolution reduction) might be (assuming some sort of psuedo c style coding since i guess you know it).
int myArray = {b'1000', b'1100', b'1110', b'1111'};
and your processing function might look like
processedAudio myProcessing(inputSample, Resolution)
{
return (inputSample & myArray[Resolution]);
}
also sorry i missed your other Q earlier:
for the bit crusher i am currently prototyping on a pic12f1822. if it turns out something lower end can be used then i will step down but for now im going with the deluxe 8 pin. I think it is one of the only ones with a fast enough clock.
for the switching, 500 series as mentioned.
Re: any interest in "bitcrusher" ics?
Posted: Fri Oct 21, 2011 4:47 pm
by Schlatte
Ohh.. ok. I don't really program ASM but I should have like a year ago (yeah... totally skipped that class

)
yeah, that's what I meant by "random"... but instead of using the array I just use the 2nd adc value (varies from 0x1 to 0xff) and & it... so I don't have like 4 or 8 masks but all values from let's just say 1 to 1023... But I'll give the masks a try...
BTW: Thanks for the Code/explanation

Re: any interest in "bitcrusher" ics?
Posted: Fri Oct 21, 2011 6:12 pm
by multi_s
Hi sorry i made an error in the array above but it is corrected now to work with &.
assembly is very easy to use if you are doing something simple. Most of the 8 bit pic literature from microchip gives examples in assembly as well if you ever want to try. I had to learn some assembly for the motorola 68000 series processors which is what all macs used up to the invention of the powerpc chip. This has literally thousands of directives because there are so many slight variants on every instruction. So going from that to 25 instructions is like a dream come true, although you can be quite as efficient with the former.
i see what you did for the anding its almost the right idea. that would definitely have some effect but not the one you expect from resolution reduction. if you have an 8 bit system you only have 8 resolutions right? (1-8 bits) and that can be represented with just 3 bits (8 = 2^3). so from your ADC value that is 8 bit (256 values) you need to only decide between 8 outcomes (3 bits). since both are powers of two (2^3 and 2^8) you can cheat and just rotate the adc result right 5 times (essentially dividing by 2^5). this way all values up to 32 become 0, all values from 32-63 become 1 , 64 - 95 become 2 etc etc. recall that the first entry in the a c array is index 0 so it works out perfectly to use as your index in an 8 entry mask array.
Re: any interest in "bitcrusher" ics?
Posted: Fri Oct 21, 2011 7:23 pm
by Schlatte
multi_s wrote: i see what you did for the anding its almost the right idea. that would definitely have some effect but not the one you expect from resolution reduction. if you have an 8 bit system you only have 8 resolutions right? (1-8 bits) and that can be represented with just 3 bits (8 = 2^3). so from your ADC value that is 8 bit (256 values) you need to only decide between 8 outcomes (3 bits). since both are powers of two (2^3 and 2^8) you can cheat and just rotate the adc result right 5 times (essentially dividing by 2^5). this way all values up to 32 become 0, all values from 32-63 become 1 , 64 - 95 become 2 etc etc. recall that the first entry in the a c array is index 0 so it works out perfectly to use as your index in an 8 entry mask array.
Yeah, that's what I wanted to do... I just thought that my ADC value
can be all the values in the array... starting from 0000 0001 going up to 1111 1110... Soo
theoretically all the values in the array would be reached at
some point... but it's more convenient your way.
I intended to attach a switchable input circuitry to the "pot" adc-in... like mode 1 is the pot, mode 2 is an exp pedal and mode three some kind of sine/square/triangle source (ICL8038- I'm looking at you

)... we shall see...
Oh! BTW: I thought it would be cool to (like I said, I'm using 18F2550/4550 pics) just "time" the ad-conversion of the guitar signal with let's just say the timer0 (or RTCC or whatever it's called now) and just ADC it in the ISR of the timer... and with an additional pot - on let's just say on AN2 - you can change the preload value of the timer... like from 0 to 50 000 (if it's 16 bit)... so you would kinda change the conversion frequency... you would have to set up the timer (prescaler n' stuff) so that it works... that would require some testing... I think I know what's my next lab-project in school is going to be

Re: any interest in "bitcrusher" ics?
Posted: Fri Oct 21, 2011 7:56 pm
by multi_s
yes if im interpreting you correctly you are talking about what i mean by sampling frequency or sampling rate. this is what promotes the aliasing and ring modyness of bit crushers.
your description sounds like a good way to implement that.
you can do this on the 12's too although they don't all work so easily. in fact some of the 500's and below do not even have interrupt vectors/handlers. it only has a tmr0 and you have to monitor everything yourself. yet another reason to go with the 1822 on this project, which actually has has a comparable core to the enhanced pic 16/18's.
Re: any interest in "bitcrusher" ics?
Posted: Sun Oct 23, 2011 7:43 pm
by willc
This sounds like a great project. I would be in if you are going to do a run of them.
Look forward to seeing a demo of the chip in action.
Most of the tech stuff is a bit out of my realm but I did recently pick up an arduino and have been reading about this stuff and there are some serious possibilities with this technology.
Re: any interest in "bitcrusher" ics?
Posted: Mon Oct 24, 2011 2:07 am
by multi_s
well here is a really primitive video. seems to work ok so i will make some clips with a guitar at a more reasonable hour of the morning. top signal is the clean input. bottom is the effected output. first resolution is swept then sampling f.
The resolution range is 1-8 bit and the sampling frequency range is about 90Hz to 12kHz
[youtube]http://www.youtube.com/watch?v=tPWyEjoSETY[/youtube]
There is also a clip led indicator so that you can size the input signal accordingly to get a good ADC saturation without a scope. It lights up when you are within ~8 percent of the ADC's limit. The other feature is a gate pin to mute the output. Potentially you could drive it with another oscillator to make a tremolo effect, or a momentary stomp etc.
and that's all the features because you only have 6 pins to play with (2 of 8 are power related).
(audio in, audio out, gate, clip led, sampling resolution, sampling rate)
Re: any interest in "bitcrusher" ics?
Posted: Thu Oct 27, 2011 8:10 pm
by ARC Effects
I'd be down