SynthMaker

Trying to write some code to do this...

Archive · 2005 22 old posts

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

Acolmiztli ·

Hey. I'm trying to write some code that will take a poly input (int or floats mainly though) and send it out the output when the module recieves a TRUE in its trigger input.

Any tips? Are there any dicussions on the syntax of the code module?

stefan ·

this sends out the input WHILE sendOut is set to something above zero

polyin in; polyin sendOut; polyout out;

out = (sendOut > 0) & in;

and this sends out the input only as a trigger if sendOut goes from zero to something above zero

polyin in; polyin sendOut; polyout out; float lastOut;

out = (sendOut > 0) & in - lastOut; out = max(0.0, out); lastOut = out;

I hope it works, just wrote it from the top of my head.

Thanks for spotting the error unk 🙂

skOre ·

have a conditional statement, which doesn't work directly atm, go to: outsim.com >Support>Docs>Writing code (at the very bottom)

Just by the way - is code actually more efficient in this case?

unkargherth ·

stefancrs wrote: and this sends out the input only as a trigger if sendOut goes from zero to something above zero

polyin in; polyin sendOut; polyout out; float lastOut;

out = (sendOut > 0) & in - lastOut; out = max(0.0, out);

I hope it works, just wrote it from the top of my head.

i think last one should be

polyin in; polyin sendOut; polyout out; float lastOut;

out = (sendOut > 0) & in - lastOut; lastout=out; out = max(0.0, out);

does it make sense?

stefan ·

unkargherth wrote: stefancrs wrote: and this sends out the input only as a trigger if sendOut goes from zero to something above zero

polyin in; polyin sendOut; polyout out; float lastOut;

out = (sendOut > 0) & in - lastOut; out = max(0.0, out);

I hope it works, just wrote it from the top of my head.

i think last one should be

polyin in; polyin sendOut; polyout out; float lastOut;

out = (sendOut > 0) & in - lastOut; lastout=out; out = max(0.0, out);

does it make sense?

Make "lastOut = out" the last line 🙂 I'll edit my post.

Acolmiztli ·

polyin in; polyin sendOut; polyout out;

out = (sendOut > 0) & in;

I have the code module. I have an integer plugged into the in and sendout. When sendout is zero, no data goes through. When sendout is above zero.. no data goes through.

I don't get it 😕

Acolmiztli ·

skOre wrote: Just by the way - is code actually more efficient in this case?

I can't work out how to do it with standard objects. I figured it wasn't possible yet. Let me be clear, I want it to take a value, and output the same value when it is triggered by a number above zero.

jorge ·

Acolmiztli wrote: Hey. I'm trying to write some code that will take a poly input (int or floats mainly though) and send it out the output when the module recieves a TRUE in its trigger input.

Any tips? Are there any dicussions on the syntax of the code module?

Is this what you're trying to achieve: before trigger

after trigger

This is probably the best way, if you still want it with code let me know.

Acolmiztli ·

jorge wrote: Acolmiztli wrote: Hey. I'm trying to write some code that will take a poly input (int or floats mainly though) and send it out the output when the module recieves a TRUE in its trigger input.

Any tips? Are there any dicussions on the syntax of the code module?

Is this what you're trying to achieve: before trigger

after trigger

This is probably the best way, if you still want it with code let me know.

Yes that's it!

Man.. I'm really struggling to comprehend this program aren't I? Did it take everyone else as long as me to realise how to do things?

stefan ·

Acolmiztli wrote: skOre wrote: Just by the way - is code actually more efficient in this case?

I can't work out how to do it with standard objects. I figured it wasn't possible yet. Let me be clear, I want it to take a value, and output the same value when it is triggered by a number above zero.

Heh. First of all, don't use my method, use jorge's 🙂

Second of all, one cannot directly convert polys to integers, one can convert monos to floats. But nevertheless, jorge's method is so much better 🙂

Acolmiztli ·

Well with Jorge's method I cannot trigger the trigger.... or can I?

jorge ·

[old link]

jorge ·

Acolmiztli wrote: Man.. I'm really struggling to comprehend this program aren't I? Did it take everyone else as long as me to realise how to do things?

🙂 it took me a couple of years.

Dont worry, just dont be afraid to ask whatever you dont understand.

Acolmiztli ·

jorge wrote: Acolmiztli wrote: Man.. I'm really struggling to comprehend this program aren't I? Did it take everyone else as long as me to realise how to do things?

🙂 it took me a couple of years.

Dont worry, just dont be afraid to ask whatever you dont understand.

I know but I don't wanna be a pain in the ass, I feel like I'm asking questions that literally every other SM user except me knows the answer to!!

jorge ·

Acolmiztli wrote: I know but I don't wanna be a pain in the ass, I feel like I'm asking questions that literally every other SM user except me knows the answer to!!

Just dont be afraid of learning, you'll eventually get it. But you'll get there a lot quicker if you let us keep helping you. Also whatever I explain here to you can be used by all other people that come to the forum, it will most probably be useful to most of them. If I had just arrived here I know it would take me some time to learn it.

The basics are very important and you'd be surprised how quickly you can move on to complex stuff after you know the basics.

Tom7777 ·

-

stefan ·

Tom7777 wrote: Just wondering with that code posted could you replace the 0 value with a float and then define an input -

polyin in; polyin value; polyin sendOut; polyout out; float v;

v = value;

out = (sendOut > v) & in;

as you know im still learning so this might be wrong and i have not tested this yet.

Yeah, but I'd rename some things then 🙂

polyin in; polyin x; polyin xMustBeBiggerThan; polyout out; float v;

v = value;

out = (x > xMustBeBiggerThan) & in;

Tom7777 ·

-

Shifrin ·

Acolmiztli wrote: I know but I don't wanna be a pain in the ass, I feel like I'm asking questions that literally every other SM user except me knows the answer to!!

Seriously man, you're asking questions that are helping me out 🙂 So keep asking away!!!!

Shif.

Acolmiztli ·

Ok cool 🙂

stefan ·

Tom7777 wrote: Ok, thanks stefancrs 🙂 I might be wrong but in that new code you said it does not say the V value -

polyin in; polyin value; polyin HigherThan; polyout out; float v; float h;

v = value; h = HigherThan;

out = (x > h) & in;

Like this?

Not needed. Might just as well do it like this:

polyin in; polyin x; polyin xMustBeBiggerThan; polyout out;

out = (x > xMustBeBiggerThan) & in;

Tom7777 ·

-

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.