Forums > MaxMSP

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

Mar 25 2010 | 3:22 pm

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.

Mar 25 2010 | 3:41 pm

Formatting is key:

-- Pasted Max Patch, click to expand. --

Mar 25 2010 | 3:44 pm

/ug typos!

Mar 25 2010 | 4:07 pm

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

Mar 25 2010 | 4:37 pm

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. —
Mar 25 2010 | 5:08 pm

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. --

Mar 25 2010 | 5:15 pm

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. --

Mar 25 2010 | 5:19 pm


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

Mar 25 2010 | 5:25 pm


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…!

Mar 25 2010 | 5:33 pm

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

Viewing 10 posts - 1 through 10 (of 10 total)

Forums > MaxMSP