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
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 -
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 -