SynthMaker

I somehow messed it up again

Archive · 2011 4 old posts

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

Neptune ·

Hi,

again i got stuck in solving an issue:

The osc i am using is more or less the wiki saw (up/down) with phase. I have modified it just a little bit. Now the result is (kind of funny) that when i reduce the volume to 0 it becomes a unipolar square... 😮

I cant find the problem.

Can a guru please have a look.

Thank you Neptune

trogluddite ·

I think the problem is in the output lines, e.g...

out1 = (volume*p1) - (p1 > 1) & 2;

The brackets around (volume * p1) stop the volume from changing the 'anded' part. re-arranging the brackets like this should do the trick...

out1 = volume * ( p1 - (p1 > 1) & 2 );

You can think of brackets as as being like the way you use modules and sub-modules in SM - the bit in brackets is like a 'sub-equation' that only sends out one number to the rest of the line.

cyto ·

It took me awhile to figure out what you were doing, but I finally got it (and it is very clever BTW 😉 ). Trog is exactly correct. That'll fix your problem. One thing that I did notice though while I was looking over your code was the following line(s):

a1 = a1 + (frequency*SR/2)*f1;

I'm not quite sure why you divide the "SR" value (which is precalculated at 2/sampleRate) by 2. I would think it should instead be...

a1 = a1 + (frequency*SR)*f1;

Or am I missing something? in either case, you could just put one line at the beginning of the code...

frequency = frequency*SR //or frequency = frequency*SR/2

and then for each wave have...

a1 = a1 + (frequency)*f1;

That'll save a couple of cycles at least.

-cyto

Neptune ·

Thank you very much trog & cyto!!

Learned again a lot!

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.