SynthMaker

Retrigger stage(0)? (Karplus Strong and voice management)

Archive · 2007 16 old posts

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

oddson ·

I'm trying to add voice management to a Karplus Strong based project but I cannot figure how to retrigger stage(0).

I know there's a WIKI entry on this (retrigger workaround ) but I don't understand how I would use it to set a voice back to stage(0). 😕

[url=[old link] Karplus Plus thread:

Malc wrote: We will be implementing a built in retrigger mechanism at some point. This is pretty much essential for things like this and others like custom made envelopes. Sorry I can't be any more specific on timings.

[/url] Any chance this will be soon?

oddson ·

Sept. 1, 2006 -- v 0.9.6a release notes:

– New retrigger counter output on the MIDI to Poly component allows you to handle voice management retriggers in custom envelopes

Was this it? I still don't think it will allow retriggering stage(0).

stefan ·

oddson wrote: Sept. 1, 2006 -- v 0.9.6a release notes:

– New retrigger counter output on the MIDI to Poly component allows you to handle voice management retriggers in custom envelopes

Was this it? I still don't think it will allow retriggering stage(0).

Retriggering of stage(0) is not possible and is only executed when the process is created. This means that it is executed for all four channels in the SSE stream. Making it retrigger upon note on is not possible since the same code has to run for all channels in the stream.

If you need things to be able to happen on any channel and whenever in the stream, it has to be happening outside of stage(0).

I don't fully remember the karplus issue, is it the noise burst that needs to fire again? If so, can't you just have noise running all the time (either a poly one or a mono one that is fed to the poly section) and use an envelope to control the burst?

oddson ·

Yes... I could adapt it with retriggered envelopes.

oddson ·

oddson wrote: Yes... I could adapt it with retriggered envelopes.

Actually... turns out I can't.

I don't know how to efficiently initialize an array with random values without access to: float arrayName[1000]=rand(-1,1);

Can you show me how to do this? 😕

stefan ·

Why do you need to initialize it upon voice triggering? Can't you just have a noise osc that you gate and feed into the karplus stuff? I'm not familiar with the specifics of your schematic, so maybe what I suggest isn't doable in your case. But I would think it should be 🙂

oddson ·

Right... I guess I was hoping to retain more of the method of generating the initial pluck from the old synth (Karplus Plus). I'll give it another try.

oddson ·

So I went back to basics just to make sure I understand them before I try anything fancy...

Here's what I get:

vmKarplusStrong.osm

The alternate burst generator works but is prone to problems when used with a single voice and firing new notes at a rapid pace (hold down one key and rapid fire another and sooner or later you'll see what I mean).

... just thought I'd share my progress.

stefan ·

Doesn't seem to be related to the retriggering. There's a DC build-up, most likely because only a "snippet" of noise is used, so that the average value of the noise isn't 0.

I would probably just add a highpass to the damping section.

oddson ·

It's related to re-triggering in as much as it only happens with re-triggered voices.

It seems what's different is that the feedback path is not empty when the noise burst gets to the KS loop -- as it would be if it's a new voice.

So a DC buildup can occur, but also the noise from the previous note on that retriggered voice can still be present (if it has not had sufficient time to decay down) and then the retriggered note will not be starting from the same place as a brand new note. Even if it has settled down to a near sinusoid there will be a different harmonic content (and values outside [-1,1]) compared to a 'fresh' note.

So... a HP filter will kill the DC buildup but not solve the other issues. It seems I need to block the feedback path during the initial phase of the KS delay loop (2/f samples). 🙁

stefan ·

I'm not entirely sure that is needed from a "how it sounds" point of view, but I haven't tested it so I'm not sure. Real stringed instruments reacts differently when "retriggered" too, but probably in a different (and quite complex) manner.

What might actually be doable is do a "stream switch" that basically either feeds the feedback into the delay OR the pluck. It would switch to the "pluck" input (the noise that is) during the first cycle, which basically is what you suggested, but in a quite elegant manner.

oddson ·

stefan wrote: ...basically is what you suggested...

It sounds exactly like what I suggested. 😉

Are you talking about doing it in code or using the selector switch (which does seem to work with sample-rate accuracy)?

BTW - a highpass to kill the DC component didn't really fix the problem even from a 'sounds like' perspective. With repeated 'hammer-on' notes it starts to build up and change timbre.

oddson ·

vmKarplusStrong2.osm

🙂

stefan ·

That's exactly how I (and you 🙂) meant!

Btw, it could in some cases maybe make sense to make the dampening filter follow pitch (or, preferably, have adjustable pitch tracking), so that you could get the same amount of damping independently of the pitch.

oddson ·

Btw, it could in some cases maybe make sense to make the dampening filter follow pitch (or, preferably, have adjustable pitch tracking), so that you could get the same amount of damping independently of the pitch.

That's one of the things my Karplus Plus does... I'm working on the upgrade now.

sambean ·

Perhaps it would be possible to have the option in the voices->poly to always call stage(0) on every voice on, you could protect the voices that are currently executing with bitmasks..

eg

... polyboolin voiceRetrigger; float arrayinit[10] = rand(-0.9,0.9); float array[10]; float parameter; float i; stage(0){ parameter = parameter - voiceRetrigger&(parameter - initValue); i=0; loop(10){ array[i] = array[i] - voiceRetrigger&(array[i] - arrayinit[10]; i = i+1; } }

...

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.