SynthMaker

Early adopter blues (bugs in code component)

Archive · 2005 4 old posts

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

rl ·

(detected in 0.9.2)

- the code component does not like variable names containing underline chars (e.g. 'exp_out').

- the parser seems to have problems with complex expressions, e.g. when summing up more than four or five operands. e.g. I had to split the expression:

expOut = 1 + x + (x*x)/2 + (x*x*x)/6 + (x*x*x*x)/24 + (x*x*x*x*x)/120 + (x*x*x*x*x*x)/720;

into

expOut = 1 + x + x*x/2 + x*x*x/6 + x*x*x*x/24; expOut = expOut + x*x*x*x*x/120; expOut = expOut + x*x*x*x*x*x/720;

in both cases there is no visible indication (syntax couloring is not broken). There is just no output.

It took me a couple of hours (and rewriting my code as a standalone C program and debugging it) to find out, that it's not my code that is wrong.

-> Hint to find unresolvable expressions: create a new polyout dbg; attach a analyzer/wave display to it feed some input (e.g. impulse) to your input create a line: dbg = input; now: as long as your wave display looks as expected move the statement down line by line until the wave display shows a line of zero values.

- the code is not always repainted when doing copy and paste

Shifrin ·

rl wrote: -> Hint to find unresolvable expressions: create a new polyout dbg; attach a analyzer/wave display to it feed some input (e.g. impulse) to your input create a line: dbg = input; now: as long as your wave display looks as expected move the statement down line by line until the wave display shows a line of zero values.

Good tip there cheers, and thanks for the filter code too 🙂

Shif.

jorge ·

Hi rl

rl wrote: the parser seems to have problems with complex expressions, e.g. when summing up more than four or five operands.

You're right, it needs fixing, I'm sorry it caused problems for you and that it took some of your time finding the bug.

Might be useful if you understand a little more about the code component so you can find bugs more easily.

The code component translates the high-level language to asm code before compiling it.

Here is an example taken from your code:

and here you can see a zoomed in section of assembler code:

The code component uses the SSE registers from xmm0 to xmm7. At the moment it cant cope with situations where it needs more registers and anything above xmm7 is shown as xmm999. One way to find out if there is a problem is to look at the asm code coming out of the code component and look for xmm999. For asm/compiler experts, the asm code might also be useful to find other possible bugs.

The way to fix it is to get the code component to use memory locations whenever it runs out of SSE registers but the performance will be similar to splitting the expressions like you suggest. For now, before we fix it, I recommend you just split the expressions, its something we'll have to explain in the documentation.

Supporting variable names containing underline chars should be no problem at all. Wont take long to implement it.

rl ·

thanks, jorge for the explanation, maybe an error marker or an error message line at the bottom would be helpful to indicate such situations

cheers, rudolf

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.