SynthMaker

(serious?) code component bug(s?)

Archive · 2005 9 old posts

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

NothanUmber ·

some things in the code component don't work as expected with more complex expressions. Load for example this file:

http://home.in.tum.de/~strixner/CodeModuleBug.osm

and try to add something to the second line

(e.g. change it to: *(1+(in/in)+(in/in)*(in/in)*1.0) + 17;)

nothing happens (or the input number is directly copied to the output one if you change the input. I had both cases but couldn't reproduce the latter one).

Now delete the entire second line and add a semicolon to the upper one: out =( 2 + (in - in) / 1 * 1 * 1 * 1);

add something to it

(e.g. out =( 2 + (in - in) / 1 * 1 * 1 * 1)+27;)

now everything is calculated as expected. Another case that could be related to that is the following one: Load

http://home.in.tum.de/~strixner/SpiralSynthesis4.osm

and go inside the Spiral Oscillator. Now rename the variable "float caPlusCmv;" to "float caPlusCmvDiv2Pi;". Now comment out the following three lines:

caPlusCmv = carrierAngle + currentCarrierModulatorVal; tapWeightCos = rpdPlusCmv * cos1(caPlusCmv / PIMULT2); tapWeightSin = rpdPlusCmv * sin1(caPlusCmv / PIMULT2);

and replace them with:

caPlusCmvDiv2Pi = (carrierAngle + currentCarrierModulatorVal) / PIMULT2; tapWeightCos = rpdPlusCmv * cos1(caPlusCmvDiv2Pi); tapWeightSin = rpdPlusCmv * sin1(caPlusCmvDiv2Pi);

Now after I play some notes all I can do is to kill the SynthMaker process and restart it (although the program should do nearly the same as before just with one division less).

The list could be continued (I had problems with the taylor expansion of 5^x if the order was greater 3 etc.), essentially it mostly goes amok if I do some more complex calculations.

Perhaps it has to do with some precision issues but I can't imagine that that's all... (another possibility would be that it has to do with my computer, then the problem shouldn't be reproducable by other people.).

NothanUmber

malc ·

Hi NothanUmber,

There is a known issue in the code component relating to the use of complex expressions. I remember it came up in a conversation I had with Jorge the other day. Unfortunately I can't remember what it is.

Jorge isn't around at the moment. I'll try and grab him tomorrow and we can shed some more light on this issue.

Obviously it isn't working but I don't think it's a major issue to sort it out.

Malc.

rl ·

Jorges explanation in this thread could be helpful: Early adopter blues (bugs in code component)

NothanUmber ·

Thanks rl for the hint, sorry haven't seen your thread. That explains the errors of the CodeModulBug.osm and my Taylor-Series problem. But the strange behaviour of the SpiralSynthesis4.osm example seems to have another reason - no xmm999 register used there, from my rather limited assembler point of view everything looks alright on first sight (don't understand what these "mulps xmm0,F65536P00000; etc. " lines are doing after the "movaps caPlusCmvDiv2Pi,xmm1;" though...

NothanUmber

jorge ·

NothanUmber, I think I have the SpiralSynthesis bugs fixed. There were actually two bugs, the one you mentioned and also the cos1 function was only calculating one of the 4 channels causing your schematic to work only for the first note played. You'll most probably have the fix tomorrow with the next incremental release.

mulps xmm0,F65536P00000; just means to load the float constant 65536.00000 into the SSE register xmm0. Constants are stored in memory and they have a unique name that identifies them so that they only need to be created once even if you use the same constant in many places. The name of the constant is generated automatically replacing the "." with "P" and with "F" meaning float.

unkargherth ·

jorge wrote: mulps xmm0,F65536P00000; just means to load the float constant 65536.00000 into the SSE register xmm0.

I always tought that for loading a constant i shoudl use movaps and mulps for multiplication

It's a typo or i'm wrong?

jorge ·

unkargherth wrote: jorge wrote: mulps xmm0,F65536P00000; just means to load the float constant 65536.00000 into the SSE register xmm0.

I always tought that for loading a constant i shoudl use movaps and mulps for multiplication

It's a typo or i'm wrong?

Sorry, you're right, my mistake, but you know what I mean, I was refering to the second part of the line and typed load instead of mult. The code I described would have been: movaps xmm0,F65536P0000;.

unkargherth ·

jorge wrote: ... the cos1 function was only calculating one of the 4 channels

Seems same is happening with the tan1 function

Code 1 wrote: polyin i; polyout o; o=cos1(i);

ASM 1 wrote: polyin i; polyout o; float temp=0.0; float F65536P000000=65536.000000; float F16384P000000=16384.000000; movaps xmm0,i; mulps xmm0,F65536P000000; addps xmm0,F16384P000000; movaps temp,xmm0; fld temp[0]; fistp temp[0]; mov eax,temp[0]; and eax,65535; shl eax,2; add eax,sine; fld [eax]; fstp temp[0]; fld temp[1]; fistp temp[1]; mov eax,temp[1]; and eax,65535; shl eax,2; add eax,sine; fld [eax]; fstp temp[1]; fld temp[2]; fistp temp[2]; mov eax,temp[2]; and eax,65535; shl eax,2; add eax,sine; fld [eax]; fstp temp[2]; fld temp[3]; fistp temp[3]; mov eax,temp[3]; and eax,65535; shl eax,2; add eax,sine; fld [eax]; fstp temp[3]; movaps xmm0,temp; movaps o,xmm0;

Code 2 wrote: polyin i; polyout o; o=tan1(i);

ASM 2 wrote: polyin i; polyout o; float temp=0.0; float F65536P000000=65536.000000; float F16384P000000=16384.000000; movaps xmm0,i; mulps xmm0,F65536P000000; addps xmm0,F16384P000000; movaps temp,xmm0; fld temp[0]; fistp temp[0]; mov eax,temp[0]; and eax,65535; shl eax,2; add eax,sine; fld [eax]; fstp temp[0]; movaps xmm0,temp; movaps xmm1,i; mulps xmm1,F65536P000000; movaps temp,xmm1; fld temp[0]; fistp temp[0]; mov eax,temp[0]; and eax,65535; shl eax,2; add eax,sine; fld [eax]; fstp temp[0]; movaps xmm1,temp; divps xmm1,xmm0; movaps o,xmm1;

Using SM 0.93g

(Sorry for the long post)

jorge ·

unkargherth wrote: Seems same is happening with the tan1 function

You're right, I didnt fix the tan1, the way around it for now is to use sin1/cos1.

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.