Help me get groove~ to play without making clicking noises! (patch included)

Mar 25, 2010 at 3:22pm

Help me get groove~ to play without making clicking noises! (patch included)

What to me seemed a simple matter has turned out to take days of failed attempts!

I’ve made a simple monophonic sampler (through modifying an example one, the lovely “script driven sampler)”, in which when a new note event is received during playback, the eventual ongoing playback should be immediately interrupted, and the new note started.

Although my patch works, it makes horrible clicking noises when switching between notes.

Could you have a look at my patch and help me on the way to getting it right?

The groove~ object lies in the abs_polysampler2.maxpat patch.

All you need to do to get it playing is to run “Sampler Example 5″, enable audio and increase the volume, then use the on-screen keyboard to trigger notes.

I have left it without any of my botched attempts to get it right active.

Sorry if the file is a bit large (0.5MB), it’s because I’ve also included a few samples to play.

Thank you!

EDIT: I know my Max/MSP audio playback works well in general, so it definitely has nothing to do with my audio settings.

Attachments:
  1. Debug_sampler.zip
#47689
Mar 25, 2010 at 3:41pm

Formatting is key:

– Pasted Max Patch, click to expand. –
#171494
Mar 25, 2010 at 3:44pm

/ug typos!

#171495
Mar 25, 2010 at 4:07pm

Fair enough, the example above is WAAAAY bigger than necessary. Tiny patch coming up :)

#171496
Mar 25, 2010 at 4:37pm

Here it is!

It’s still a zip file, as I included two audio samples to play. The patch in the zip is the following:

– Pasted Max Patch, click to expand. –
#171497
Mar 25, 2010 at 5:08pm

Cutting between two pieces of audio in an arbitrary place will *almost* always make this noise. The reason it makes cracking noises is that when it switches from a to b, A could be at value 1, and the fist sample could be at value 0. See Fig A

How to fix this?

Envelopes are your friend. See Fig B

Fig A

– Pasted Max Patch, click to expand. –
– Pasted Max Patch, click to expand. –
#171498
Mar 25, 2010 at 5:15pm

I did this quick fix, but without seeing the whole patch and its context, i don’t know if this is exactly what you need, so i’ve just added note off/on envelopes…

– Pasted Max Patch, click to expand. –
#171499
Mar 25, 2010 at 5:19pm

AudioMatt:

It never crossed my mind to use two groove~ objects and switch between them like in your example!

I thought, since it’s monophonic, I need only one playback object, and I never questioned this preconception.

Thank you very much for your solution, seems to work a treat!

Now all I need to do is build it into my original SpaghettiSampler :P

#171500
Mar 25, 2010 at 5:25pm

Brendan:

Thank you for your suggestion! It is exactly the same idea that I had for a solution.

However, your patch, and all of my similar attempts, produce some clicking noise still.

Sometimes less audible, and not consistently, but it is there.

It seems that could vary between computers and/or audio driver buffer settings perhaps, as I assume on your computer your patch didn’t make clicking noises or clearly you wouldn’t have posted it… But it does so when I run it. Interesting…!

#171501
Mar 25, 2010 at 5:33pm

For the time being assume clicks are due to something in the audio path changing instantly. It could be a hard cut between samples, a sudden change in an envelope or even an instant change in oscillator frequency. Glad to be of help

#171502

You must be logged in to reply to this topic.