SynthMaker

A little help with the code module, please...

Archive · 2006 5 old posts

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

tormodulator ·

I'm trying to write code. I get how I can take an incoming audio stream and output an altered version of the audio.

What I'm trying to do now is to make the code run when it receives input from a control, but I can't seem to get my head around it.

So how do I trigger the code to run if I don't stick audio in it? I'm thinking of using a drop down list or a selector of some sort, and the code generates a complex output based on the values on a bunch of input nodes when it's triggered by change in any of the data or a trigger of some sort.

Am I not supposed to think like this? 🙂

edit: additional or supplemental questions: -Can someone please explain how to make a conditional? I only know Delphi, and I'm used to IF and CASE and stuff. The mask is confusing me. -no variables in loops?

autodafe ·

there's a nice tutorial/reference about code module in the Wiki (I'm still studying it 😊), in case you haven't seen it...

tormodulator ·

Yeah, well, I'm sorry - I don't find it that simple to follow...

Can I make code run by using some sort of trigger?

rl ·

it depends:

- for simplicity let's assume your code uses only streamin's and streamout's. - if your streamout is connected to an analyzer you can specify for how many samples your code module will run. The analyzer's trigger starts the processing. - if your streamout is within a processing stream midi2poly -> ... -> your code -> ... -> poly2mono (white (~) connector) for every new note-on a new sound process is created and assigned to the next free "sound processing slot". 4 slots fit into a single SSE channel. - if there is no poly stuff and you have mono connectors (the blue (*) ones) connected to DSout or ASIOout the code runs always till the end of time() or the end of your studio session (whichever comes first)

BTW using analyzer streams and poly/mono streams intermixed is a definite way to watch your system creating a crash report.

NothanUmber ·

Here a short example how to react on changing green input data (Shif gave a more detailed example at another thread, didn't find it on first sight though). The biggest disadvantage of the code module for such applications is that one needs an audio in/out somewhere in the schematic, otherwise it won't work. So if you plan to build e.g. midi-only effects that route is not optimal.

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.