SynthMaker

Degrade samplerate(11025) fx, how?

Archive · 2011 22 old posts

From the original SynthMaker forum (2004–2014), with its members’ names and dates.

nix ·

G'day, I have just added another instrument to my producing rig by making a bit crusher. I will come back with .osm. Anyway, for higher low fidelity fidelity(!) I want to change samplerate with my VSTfx , down to 11025hz. Is this possible? Cheers chaps It's cool 4 chiptunes, the crusher Here 'tis-

Also I'm not sure that it's quite correct if u want take a look. If u mess with the settings u can get the iconic 8-bit though

infuzion ·

There are "upsampling" modules around the forum, swap them around?

nix ·

It seems overly complex, involving filters and such. Can we just have hold for 4 values in stream? I am a terrible coder, but can try to get my hands dirty if it occurs to anyone how to do that? But thanks Tom! I'll try it

martinvicanek ·

hop(4) maybe?

nix ·

ty Tom & Martin, Here is the .osm->

Now it has samplerate. I multiplied the signal by 1 for one sample, and 0 for 3, then used delays by sample to sort the interstice, ie. delay by 1,2&3 It has from 1378 to 44100. Cheers

trogluddite ·

For fixed 11025 Hz, this would be the simplest code...

streamin input; streamout output;

hop(4) { output=input; }

A LP filter at 10kHz or so may be handy too, to keep the aliasing to more reasonable levels. The old gear wasn't designed to alias like hell (as many decimator plugins do) - the aliasing of old was mainly due to the anti-aliasing filters not being sharp enough in those days, so a regular SM biquad filter should be good enough to 'vintage-ise' the sound while still leaving a bit of 'crunch'.

nix ·

Cool trog&Martin, I will switch it as mine sucks the CPU juice a bit . Can I just use hop(8) to get 5512.5 etc? I can make a variable on the code box for hop #. Thanks guys I will add the filter too, I will make it an option.

infuzion ·

Should not one average the samples you are skipping?

nix ·

Nice idea. I'll think about how to do it. It prolly OK though, it's gonna decimate the sound anyway, it's an imperfect type of noise. p.s- can you hop any number of samples? Hopefully this project will help me with pitch shifters

nix ·

OK, How do I make the hop variable by the user? The help is much appreciated 8D I can use multiple instances of the code, but changing 1 by user would be neater?

rl ·

Hi Nix, here is a little sketch for a crusher using a freely adjustable samplerate:

streamin in; streamin ratio; // fs/f

streamout out;

float smpl; // sample counter float buf; // bufferd input float this, next; // boolean masks

this = (smpl<ratio); next = (smpl>=ratio);

out = this&buf + next&in; buf = out;

smpl = smpl+1; smpl = smpl - (next)&ratio;

The ratio input is to be fed by a division of the "real" samplerate by the faked samplerate. e.g. on a 44100 Hz soundcard with reduced samplerate 11025 the ratio is 44100/11024 == 4. Note that ratio is a float and is not limited to int values.

Aliasing can be a bit reduced (no pun intended) by putting a lowpass smoothing filter behind and adjusting the cutoff frequency:

streamin in; streamin cf;

streamout out;

out = out * cf + in*(1-cf);

nix ·

Wow,thanks a bundle rl, I'll try and understand, since I have some idea of what bit depth and samplerate reduction are, I may be able to a little. I'll get back to you with a few questions. I think as it stands this turns a regular VA synth into something like LSDJ or nanoloop for GameBoy.

TomC ·

infuzion wrote: Should not one average the samples you are skipping?

That would result in a low-pass filter, something most probably not wanted here.

Tom

trogluddite ·

nix wrote: p.s- can you hop any number of samples?

nix wrote: How do I make the hop variable by the user?

Using something like rl's code is the way to go if you need variable decimation. The hop() can only use powers of two, and there is no easy way to make it variable (only possible with some sneaky assembly tricks).

TomC ·

nix wrote: OK, How do I make the hop variable by the user?

If you understand ASM, [old link] will help you.

Tom

trogluddite ·

There's an assembly optimised decimator/bitcrusher here that I posted a few months back.

RE: the variable hop Wiki link...

There's no need to use a temp variable to pass the value of index- you can just look up its frst SSE channel directly...

push eax; // save old eax mov eax,index[0]; //Use index directly cmp eax,0; // index!=0 => do hop jnz end0;

nix ·

http://www.sendspace.com/pro/dl/x42xpv Here it is with rl's downsampler. Cheers 8D It's samplerate independant now. There are VSTfx & .osm in the .rar . edit-fixed link, it wasn't stereo

rl ·

cool 8-)

(but why don't you just pack both monostreams into a single stream? (saves ~50% CPU)

nix ·

Thanks RL, I will go through all my projects and implement pack. Cheers for reminding me. I will make a nice guitar stomp GUI for this one like this->

All success!

sunsynth ·

Hi nick,

nice GUI 😍

Greetings! Walter

nix ·

Hey Walter 8D, How u doing? Have to bell over to ur site again soon. Thanks for the comment, I used those LEDs we made years ago. Take care, Nick

sunsynth ·

Hi Nick,

now i know why i like it so much 😮

Wait with my site... Have to make it better (Update and new design) 😊

Cheers, Walter

Wrote something here? To have a post removed or your name hidden, write to [email protected].

Before your first post

A few rules keep this a friendly place. You agree to them once.

Shown next to what you post, here and in the app. It doesn’t have to be your real name: 3–24 lower-case letters, digits or _ (capitals become lower case, spaces become _).

    Then your post goes up straight away.

    Delete this reply?

    Open it in SynthMaker?

    It goes on the track you’re editing there, in place of that track’s sound, and into My sounds. Your other tracks stay as they are.

    Want to keep that track’s sound? Start a new song in SynthMaker first (Song › New song), then open this.

    Report this reply?

    Only the developer reads reports. The person isn’t told who reported them.

    What’s wrong with it?

    Block this person?

    You won’t see their posts and replies here any more. They aren’t told, and you can unblock them at any time.

    People you’ve blocked

    Their posts and replies are hidden from you. Unblock someone to see them again.

    The community rules

    A few rules keep this a friendly place. Everyone agrees to them once, before their first post.