SynthMaker

Assembler abs

Archive · 2011 5 old posts

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

Goldfield ·

how can i integrate the command abs() in the code-Editor?

Swing / SickTheramin

does not work

thx

cyto ·

Goldfield wrote: how can i integrate the command abs() in the code-Editor?

It should work in the Code primitive. If you want to get an absolute value in the assembly primitive, you can "mask" your variable by using an andps operation with the integer 2147483647, which is all bits on except the sign bit. Below shows an example of the two methods...

-cyto

Goldfield ·

different Editor.. ?! ok 🙂

thx

how can i insert asm code and jmp-commands ( in the blue editor )

cyto ·

Goldfield wrote: how can i insert asm code and jmp-commands ( in the blue editor )

The short answer is "you can't."

However, the code primitive (blue) does have a "string" output that shows SM's compiled version of the contents of the code box. You can use this as a transition to full-on assembly programming. What you need to do: write out your code in the blue code box. Then connect the "S" output to a text primitive. Click in the text primitive and hit CTRL-A to select all of the contents. Hit CTRL-C to copy the contents. Open up a green assembler primitive. Click inside and hit CTRL-V to paste the text. See below...

From there you can edit the assembly code to do whatever you want. Be warned, SM only has a limited set of opcodes available. The list is on the WIKI (search "opcodes"). You'll see that you can achieve some jumping within the assembler. To see examples of how this is done, use the above method to view the compiled versions of code with "hop" and "loop" routines. That should give you some clues about how to approach this.

-cyto

trogluddite ·

Goldfield wrote: how can i integrate the command abs() in the code-Editor?

The abs() command (and a few others) were only added to SM quite recently - could be that your version of SM is older (Fruity Loops or Free version maybe?) and does not have those functions. In the mean-time, you can use abs() in code (blue) by substituting the following equation...

abs = x * (1 - 2 & ( x < 0 )); //multiplies by -1 if x < 0

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.