Nu Audio Science ·
How do i gain acces to bit ranges and stuff in the code component so i can mess with bitcrushing ? I know Nildon has some stuff in it but it crash's before i get a chance to look 🙁
From the original SynthMaker forum (2004–2014), with its members’ names and dates.
Nu Audio Science ·
How do i gain acces to bit ranges and stuff in the code component so i can mess with bitcrushing ? I know Nildon has some stuff in it but it crash's before i get a chance to look 🙁
Shifrin ·
Nu Audio Science wrote: How do i gain acces to bit ranges and stuff in the code component so i can mess with bitcrushing ?
I've not tried it myself but I'd guess you need to quantise the floats to the bit range by doing something like :-
monoin in; monoin bits; monoout out;
float tmp;
tmp = in * 2^bits; tmp = rndint(tmp); out = tmp / 2^bits;
Now there isn't a 'pow(x,y)' or '^' function to raise 2 to the power of the number of bits so you can do that outside of the code component, if you wanted 4bit output you'd get :-
tmp = in * 16; tmp = rndint(tmp); out = tmp / 16;
16 coming from 2^4. There could well be an easier way to do it though I just got up 😉
Shif.
Shifrin ·
The 2^bits might need to be (2^bits - 1) so the 4bit example would be (2^4 - 1) i.e. 15. Not sure, my brain hasn't kicked in gear yet! I'm sure Unk will put me right if I got it wrong 😉
Shif.
Nu Audio Science ·
Cheers Shif i will mess around and see what comes out 😉
Nu Audio Science ·
Can anyone point me to a page explaining what this math is actually doing ?
Shifrin ·
I'm not sure my explanation will be any good, but here goes :-
Lets say we have some numbers in the range 0.0 to 1.0, and we want to bit-crunch down to 4bit. With 4bits we have 2^4 i.e. 16 possible numbers we can represent, 0 to 15.
So the first step is to multiply our number, e.g. 0.3456 by 15, this gives 5.184. Then we round this to the nearest integer, which would be 5. Finally dividing through again by 15, to get 0.3333. This process forces the output to be one of only 16 values, i.e. 0/15, 1/15, 2/15, 3/15 etc... to 15/15 i.e. 0.0 to 1.0. Does that makes sense?!
Oh yeah, I think the code I wrote above is actually incorrect, I'll have a look at it and check it out!
Shif.
Nu Audio Science ·
Shifrin wrote: Lets say we have some numbers in the range 0.0 to 1.0, and we want to bit-crunch down to 4bit. With 4bits we have 2^4 i.e. 16 possible numbers we can represent, 0 to 15.
Shif.
Thats the bit im losing it at, If its 4 bits why 2^4 ?
Shifrin ·
Nu Audio Science wrote: Thats the bit im losing it at, If its 4 bits why 2^4 ?
A 4-bit number is as it's name suggests made up of 4 bits. Each of these bits is either on or off, a 1 or a 0. Some examples would be :-
0000 0100 0011 1010
Etc, if you look at all the permutations of the above examples you'll find there are 16 in of them in total! You know in maths at school how you had units, tens, hundres, thousands etc. Well in binary you have 1s, 2s, 4s, 8s, 16s etc.
For example the 4-bit binary number 1010 means :-
8s 4s 2s 1s 1 0 1 0
Which gives 8x1 + 4x0 + 2x1 + 1x0 = 8 + 0 + 2 + 0 = 10 🙂
Any clearer now 🙂
Shif.
Nu Audio Science ·
Give me a little while to mull it over 🙂
skOre ·
Ah, the in-your-face beauty of binary 😀
GaryG ·
nicked from thinkgeek.com:
"there are only 10 types of people in the world, those who understand binary and those who don't..."
🙂
skOre ·
Yeah, thinkgeek rocks, as this sentence does 🙂
Sk ·
Isn't the effect you're describing a simple quantizer?
Nu Audio Science ·
If it is quantizing that isn't what i'm after anyway ?
I could do quantizing in SE and it sounds shite, I'm after the sound my Amiga used to add to samples 8 Bit Octamed style 🙂
platinumears ·
what sample rate did the amiga use?
Nu Audio Science ·
Nu Audio Science wrote: If it is quantizing that isn't what i'm after anyway ?
I could do quantizing in SE and it sounds shite, I'm after the sound my Amiga used to add to samples 8 Bit Octamed style 🙂
😀 😀 😀 😀 😀 😀 😀
EDIT* Hmmmmmmm and the joke is on me you said samplerate, I think it was 20.5 khz tops but i doubt i was using that, I was loading a lot of samples into 1 meg so i'm guessing probably a lot lower.
It has a certain sound that was used on a lot of classic anthems years ago by Force Mass Motion among others.
Shifrin ·
From memory, I think the sound chip (Paula) supported 4 channels of 8-bit samples at a rate of 20Hz up to 29kHz. (And a 6-bit volume register 😉 )
Shif.
Nu Audio Science ·
Cheers Shif now how do i replicate it 😀 😀 😀 😉
Shifrin ·
Nu Audio Science wrote: Cheers Shif now how do i replicate it 😀 😀 😀 😉
Export you audio and load it into a wave editor then resample it to 22050Hz 8-bit 😉
Oh, you wanted a way to do it in SM?! Erm... doesn't Nildon have a resampler/bitcrusher in it? You could play with that - then again you may have already done so!
Shif.
Nu Audio Science ·
Oi you ignoring me 😀
I said in the first post that Nildon wont load anymore 🙂
Nu Audio Science ·
Shifrin wrote: Export you audio and load it into a wave editor then resample it to 22050Hz 8-bit 😉
Shif.
😀 😀
Shifrin ·
My bad, didn't realise Nildon no longer loaded!
Shif.
unkargherth ·
mmmm 8 bits.....try this
polyin i; polyout o; float t1;
t1=0.5*(i+1); // make it polar t1=t1*256; t1=rndint(t1); // quantize it to one of 256 posible values t1=t1/256; o=2*t1-1; // make it bipolar again;
jorge ·
Shifrin wrote: My bad, didn't realise Nildon no longer loaded!
Which version of Nildon would that be? I didnt realise it didnt load anymore.
Nu Audio Science ·
.41 the one you modified and reposted 🙂
It hasn't worked since the arrays, I wouldn't worry about it too much at the mo though cause Steph is away 🙂
(I haven't even had chance to try Unks method yet - My Centrinos GPU blew up so i'm awaiting the return of that from Acer 🙁 )
Wrote something here? To have a post removed or your name hidden, write to [email protected].