Kyma Forum
  Tips & Techniques
  trigger/gate click problem

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   trigger/gate click problem
phillipm
Member
posted 01 July 2011 22:53         Edit/Delete Message   Reply w/Quote
I am mostly happy with time-stretching delay patch I'm working on. Given the amount of processing going on, I'm OK with minor glitches in the pitch-tracking/time stretching process, but I have one annoying problem that has me stumped.

The basic structure of the patch is ...


MemRec -> TimeScaling -> delay
audio input / \ mixer
\ threshold ----> trigger ---- /


The delays are stretched to twice the original length, which means that sometimes it's still playing at a strong volume when a new trigger is activated by the live input. When that happens, of course, there is an obnoxious click.

I can think of 4 basic approaches that would eliminate the clicks, but I'm not sure which would be the most expeditious, nor how to implement it. For future reference, I wouldn't mind know how to do all of them... so here they are.

1) Have the sound ignore new triggers if the amplitude of the stretched sound is non-zero (or above a given threshold). (Probably the least desirable solution, but maybe useful in some settings.)

2) Have the stretched playback portion of the sound respond to all triggers by very quickly "ducking" to zero and ramping up to track newly triggered input.

3) Have the new triggered be delayed until the stretched playback has stopped playing. The worry with this one is that delays might begin to compound and pile up, so the stretched playback would get further and further behind the original input. (But again, it might be useful in some future situation.)

4) Trigger a new polyphonic voice if the first voice is busy. This one seems like it would produce the most natural and organic output in this situation. I think it might only require 2 voices (maybe 3) to ensure that there was always a free voice available. I know how to handle polyphony when MIDI is involved, but not in a situation like this.

=m.p.=


IP: Logged

SSC
Administrator
posted 02 July 2011 15:12         Edit/Delete Message   Reply w/Quote
If you choose the MIDI polyphony solution, you can name unique write/read pairs of memory locations with the variable ?VoiceNumber to ensure that each voices uses its own chunk of memory. For example, the name of the shared wavetable memory could be:

{'recording' & ?VoiceNumber}

Another tip is to put an amplitude envelope on the Sound you are recording into the MemoryWriter so it is at zero amplitude at the beginning and end of the recording. Otherwise, there is a danger of hearing discontinuities (clicks) at the beginning or end of the recording or when it loops.

IP: Logged

phillipm
Member
posted 03 July 2011 11:36         Edit/Delete Message   Reply w/Quote
RE: {'recording' & ?VoiceNumber}

Thanks for this syntax. (I wonder when/if usage of curly brackets will become 2nd nature for me.) I'm still not sure how use it to generate polyphonic output, since the Sound as no MIDI component (nor will there even be a MIDI interface used in the performance. I'm assuming I'll need to use a MIDIVoice, click on the "script" option, and then (glup!) write a smalltalk script that includes {'recording' & ?VoiceNumber}, yes?

[This message has been edited by phillipm (edited 03 July 2011).]

IP: Logged

SSC
Administrator
posted 03 July 2011 12:32         Edit/Delete Message   Reply w/Quote
If you gate your recording with !KeyDown, you could use MIDIVoice to specify the polyphony and send the KeyDowns from a Wacom tablet or an iPad running Kyma Control without need of a MIDI interface.

If you want to control everything from the VCS, you could use a Replicator to get multiple copies (see the Prototype named "Replicator creates polyphony" for an example). In that case, you could use something like the following expression to gate the recordings:

(!Gate countTriggersMod: ?NumberVoices) eq: (?VoiceNumber - 1)

IP: Logged

pete
Member
posted 03 July 2011 13:33         Edit/Delete Message   Reply w/Quote
Hi =m.p.=

re your 4 basic aproches

1) Zero crossing will not stop the click. If a signal jumps in level even if there is a perfect join at zero it will still click.

2) This will give you holes which may sound click like.

3) As you say, you may loose control and build up un-handleable data.

4) Is the closest, but the best solution to clicks is normally cross fade. To achieve a good cross fade you must have the outgoing and incoming signals playing at the same time (during the crossover) so you need two copies you your algo and you have to alternate between them. The trigger will start the new sound and start that sound fading in while making the old sound start fading out at the same rate.

So the trigger needs to make a 0,1 toggle, (change state on each trigger) type square wave. This squarish wave needs to be smoothed (trapezium shaped) and feed into a VCA on the output of one algo. The inverse (centered about 0.5) of the same smoothed square wave feeds a VCA of the other algo. The triggers can also be gated by the same squareish wave form (and the inverted version) by using multiplication, to generate the two alternating streams of triggers.

If you can get the new signals zero to line up with the old signals zero as well, you should have an even cleaner sound but the cross fader will probably give you the greatest improvement.

I hope I've understood what you are trying to do.

Thanks

Pete


IP: Logged

phillipm
Member
posted 03 July 2011 21:48         Edit/Delete Message   Reply w/Quote

ForumEx.kym

 
I'm sure that a sequentially triggered polyphonic Sound will be the best solution. Actually the "polyphonic" part was easy using Replicator ... however the important "sequential" element of the solution has escaped me. All the newly created polyphonic voices are triggered in unison ... more or less.

In addition to the Trigger window of the MemoryWriter, I tried pasting your suggested expression:

(!Gate countTriggersMod: ?NumberVoices) eq: (?VoiceNumber - 1)

into every conceivable combination of parameter windows, but to no avail.

I've uploaded an abstract example that demonstrates the problem. Ignore the audio source (i.e. triggered sample). In the final version I'll use a live open mic as the input to this Sound.

IP: Logged

SSC
Administrator
posted 04 July 2011 11:48         Edit/Delete Message   Reply w/Quote

replicatorpolyphony.kym

 
Hi Mark,

I think your example is working; it's just difficult to notice that it's triggering different copies when all are the same sample. In the attached, I removed !Index from the doNotChange list and added a suffix to the name. That way, you can set each copy to a different index and trigger a different sample, one after another by pressing Gate. You can hear that they overlap (I increased the number of copies to 4 as well).

IP: Logged

phillipm
Member
posted 04 July 2011 12:48         Edit/Delete Message   Reply w/Quote
I think something odd is going on with uploaded files. In my original uploaded file the DoNotChange window was empty (i.e. no !Index). Meanwhile, your uploaded file is identical to the one I uploaded from my computer (though that's probably just an oversight).

Yes, I know Sound is "working" to the extent that I've got polyphony. But the additional voices are more-or-less simultaneous (with just a touch of chorusing). But what I want is for them to trigger and play sequentially: i.e. first trigger activates voice 1, second trigger activates voice 2, 3rd trigger activates voice 3, then continues to recycle voice 1, 2, 3 etc.

In addition to my ears telling me that the polyphonic voices are triggering simultaneously, I can see in my VCS that all of the Replicator-created gates (_1Gate, _2Gate, _3Gate) are all firing each and every time the input crosses the threshold and generates a trigger. I assume that when I get this working, that these numbered gates will respond sequentially, too.

Sorry for not being able to figure this out on my own.

IP: Logged

phillipm
Member
posted 04 July 2011 13:24         Edit/Delete Message   Reply w/Quote

ForumEx2.kym

 
I think I figured out some of the confusion regarding uploaded files. I hadn't bothered to change the name of my file from the prototype "Replicator Creates Polyphony" so I "think" you were looking at it and believing it to be my file?!?! No wonder you thought that it worked! ;-) All your other comments make sense to me if I apply them to that file... whereas none of them do when I look at my Sound. ;-)

I've uploaded a renamed version of my Sound.

[This message has been edited by phillipm (edited 04 July 2011).]

IP: Logged

SSC
Administrator
posted 04 July 2011 14:46         Edit/Delete Message   Reply w/Quote
I think if you add !Gate to the DoNotChange field, it will work as expected. The idea is to create the same event (called !Gate) each time the input exceeds a threshold amplitude. The copies of MemoryWriter and players count how many times the !Gate event is generated and they trigger only when their voice number matches the count.

IP: Logged

phillipm
Member
posted 04 July 2011 17:17         Edit/Delete Message   Reply w/Quote

ForumEx3.kym

 
Honestly I don't hear any significant difference when I add !Gate to the DoNotChange field. I still get a chorus of more-or-less simultaneous playback from the added voices, rather than sequential and *sometimes* slightly overlapping playback.

Also ... now the MemoryRecordings no longer updates with new recordings as the audio source plays new motifs, which is a key feature of my original idea. I've uploaded a new example with all three Sounds for comparison.

Don't worry about responding anymore today ... it's a holiday for pete's sake. I've got to go fire up the grill and get ready for dinner guests. Happy 4th of July! ;-) We can try to tackle this sometime on Tuesday. Cheers!!!


IP: Logged

SSC
Administrator
posted 14 July 2011 19:50         Edit/Delete Message   Reply w/Quote

ForumEx4.kym

 
We think we understand what you want to do now and have changed your Sound. Basically, it now has N gates, where each gate is triggered every N-th time.

IP: Logged

phillipm
Member
posted 15 July 2011 14:26         Edit/Delete Message   Reply w/Quote

ForumEx5.kym

 
YES! This solves the polyphony issue. Replicated voices play sequentially.

Unfortunately, instead of the rare occasional click, I now have "ghost notes" all over the place, which sound like short, false starts. Can't quite figure out why. I've spent the entire morning (and beyond) messing around with TimeConstant (RMSSquared), Threshold settings, AttackTime and ReleaseTime (PeakDector) ...all to no avail. Making these changes does change the playback (different response and different "ghost" notes). But nothing seems like a solution yet. ;-(

You can hear the problem in both of the attached files, if you listen closely. One is a copy of the one you sent posted -- modified to make it easier to hear what I'm talking about. The other is a portion of the actual project I'm working on. I'm using an audio file that will eventually be replaced by a live performer, but it's too large to upload.

[This message has been edited by phillipm (edited 15 July 2011).]

IP: Logged

SSC
Administrator
posted 15 July 2011 15:28         Edit/Delete Message   Reply w/Quote

ForumEx6.kym

 
Mark,

The Gate was staying on until the beginning of the next phrase, so some of the material that preceded the next gate would be captured in this gate.

We multiplied the expression that had been in the gate SoundToGlobalController by the smoothed threshold value so that when the input drops below the threshold, the Gate turns off and the MemoryWriter captures silence instead of the material immediately preceding the next gate.

IP: Logged

phillipm
Member
posted 17 July 2011 12:35         Edit/Delete Message   Reply w/Quote
Yep. That works. Thanks!

Time end this topic/thread and move on to other matters. ;-)

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply

Contact Us | Symbolic Sound Home

This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.


Ultimate Bulletin Board 5.45c