SynthMaker

How do I set up a buffer in code and detect a gate?

Archive · 2005 7 old posts

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

esden9 ·

I'm trying to make a simple delay line with a trigger to clear it's buffer.

How do I:

1) Set up a buffer in code? I tried

float inputBuffer[1024];

but it doesn't look like that is recognized by the code component, at least the syntax highlighting didn't...

2) Get a note on trigger?

Thanks in advance.

stefan ·

1) There is currently no way to use arrays in the code component. There is a delay component you might be able to use though.

2) The midi2poly component has a gate output that is set to 1 when the note is triggered and back to 0 when the note is released. I'm not completely sure if this is included in the current release or just in an internal version, but I'm atleast _quite_ sure that it is there in the official version as well 🙂

malc ·

Hi esden9,

Welcome to the forum!

Stefan is right, you can't use buffers in the code component just yet. This is definitely something we're planning though (oh, so many things do 🙂).

The gate is in the 1a release but there's not alot you can do with it.

I should add that when buffers are possible they will automatically get cleared when you play a note.

Until we have the buffers there is a Mono delay component in the Effect group that may give you some joy. If you need it to work on Poly signals then let us know and we can create the component pretty quickly for you.

esden9 ·

Thanks for the quick responses! Here's what I was trying to do:

I'm trying to use delays with feedback as a per voice effect. I tried this in SynthEdit a while back but with long feedback, notes would bleed into each other as the delay buffer doesn't reset on each new note. So if I played a cluster up high on the keyboard, then did a large cluster on the low notes, the delay feedback from the higher notes would be present on each new low note.

It was just an experiment, but I liked the sounds I was getting, and thus wanted to build a refined version in SynthMaker, as I think it's gonna be way better for me than Synthedit in the end.

jorge ·

Hi esden9, welcome to our forum

So if the delay buffer from the high notes affects the low notes I'm assuming it is shared between all the notes that play. If that's the case, I guess each voice just adds itself to the buffer rather than replacing. The PolyDelay we had in mind would use a separate delay buffer for each voice, but I guess that would be no good for what you're trying to do. Also if it was possible to declare an array inside the code component, it would be declared per voice rather than shared. Your example ( if I understood it right ) is good to have in mind when we implement the declaration of arrays, I guess arrays should be flexible to allow sharing/not sharing of memory between voices depending on the case. Also I'm wondering which trigger would clear the buffer, if its the trigger corresponding to NoteOn, wouldnt that clear the buffer too often? After you'd play the high notes, the low ones would cause the buffer to clear.

esden9 ·

Hmmm, let me explain this better as I'm not sure I chose the right words in my previous description: what I wanted was for each note to have it's own unique delay, that is cleared if the same note is triggered.

If I hit C5, then hit C5 again, the previous delay would end and a new one would begin.

Now if I hit C5, then E5, then G5, we'd have 3 unique delays, one for each note. If G5 is then hit, only that note's delay would reset. C5's and E5's would continue on, unless those notes were hit again or we hit the limit of polyphony, in which case the first note (or however voice stealing is set up) would shut off and the new note would start with it's own, fresh delay.

In SynthEdit, the delay module was instanced for each voice of polyphony. If 6 voices were active with long delays, then hitting a 7th key would cause the new note to sound with the delay from whatever note that instanced delay module had been previously outputing, causing a mix of possibly dissonant tones. Not what I want at all!

Maybe I'll try replicating what I had in Synthedit in Synthmaker and see if the results are the same, but I hope that made it clearer? Thanks again!

jorge ·

esden9 wrote: Not what I want at all!

I get it now, I misunderstood it, I thought what you were describing was what you were trying to achieve. If you want each voice to work with a separate delay and for the delay buffer to be cleared each time you start a new voice, that's very easy to do, it's nearly the same as the current MonoDelay component.

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.