SynthMaker

SMv2.0.2:Crash when copy code staged whit cos1 sin1 tan1

Archive · 2011 7 old posts

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

DigitalWhiteByte ·

SMv2.0.2 Try con this code

streamin x; streamout out;streamout old; stage(0){ old=0; } stage(3){ out=cos1(x); } stage(2){ old=out; }

It crash whit functions cos1, sin1, tan1 when you try to copy and paste the code component.

Edit: also is not possible to add to the toolbox.

infuzion ·

Seems to paste fine, with the Code unconnected with anything else. SM2.02 does seem crash-happy though.

rl ·

weird! could this be an option?:

streamin x; streamout out; streamout old; stage(0){ old=0; } out=cos1(x); old=out;

DigitalWhiteByte ·

rl wrote: weird! could this be an option?:

Yes, but my code forces the old output to be delayed by one sample.or does not do this? however the code was only to reproduce the problem.

trogluddite ·

Yes, this is very odd. I can reproduce the crashes - not every time, but at least 50% of the time. Even weirder, I saved the .osm - when reloaded, the code refused to output anything except '#.IND' no matter what input I enter; sometimes a recompile sorts it out, sometimes not. Put both assignments in stage(2), and everything is fine. I tried just swapping the stage(2) and (3) parts, in case the compiler didn't like having them declared in the wrong order - but that makes no difference.

So, I looked at the assembly from the code text output - looks fine at first glance. Pasted it into an ASM primitive, and it still crashes. I noticed that it uses a lot of register eax, just like array accesses do, and I remembered that array accesses usually push eax to the stack so that the code can't alter the register value, then pop it out at the end. Sure enough, I added 'push eax' at the start of the stage3 part, and 'pop eax' at the end - and it now seems to work as expected. Would also explain why infuzion can paste when it's not connected - a register 'error' would only happen with the code running.

Can anyone else comfirm this ASM behaviour? - my machine can be a bit funny with small code blocks in isolation (soundcard driver only likes BIG code 😕 ), would be nice just to check before mailing Malc.

trogluddite ·

Nope - I can still make it crash! So I guess it must be a problem with the stages somehow.

trogluddite ·

Just had a mail from Malc - he has a fix for this working for the next update; the trig functions' table pointers were only correct for the default stage(2).

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.