Kick Drum Synthesis, click problem

Aris Schoute's icon

So I'm working on some drum synthesis recently, and I made I nice kick drum synth. However, there is still a random click in the attack when it's triggered. I've already tried to smooth out the attack a little bit by adding a 2 ms attack on the line envelope, but I think this also kills some of the impact of my kick drum. Is there a way to make sure my sine wave starts at same wave position everytime it is triggered, so that it won't have that random click? Or is there maybe another solution?

Max Patch
Copy patch and select New From Clipboard in Max.

Christopher Dobrian's icon

Here's an answer to your specific question, "Is there a way to make sure my sine wave starts at same wave position every time it is triggered...?"

Use a cycle~ with a frequency of 0 (the default) and change its phase offset with a phasor~. In that way, the phasor~ will cycle repeatedly through the waveform of the cycle~. You can send a float message to the right inlet of phasor~ to set its own phase position at the same instant as you turn up the volume of (open a window onto) the output of your cycle~. Since the default phase of a cycle~ is cosine, starting with a phase offset of 0.75 will start 3/4 of the way through the cycle of a cosine waveform, which is to say will start in sine phase.

Max Patch
Copy patch and select New From Clipboard in Max.

Aris Schoute's icon

Thanks for the help Christopher! It works fine for the cycle~ now, but I've also got a tri~ which has the same problem as with the random phase on the cycle~ before. The tri~ object doesn't have a phase inlet like the cycle~ object does. I've tried the help file, but I couldn't find a solution. So how can I do the same for the tri~ object?

Christopher Dobrian's icon

You can treat tri~ the same way. The right inlet is referred to in the documentation as the "sync" inlet, but it serves a similar purpose.

Note that the tri~ object produces a non-aliasing pseudo-triangle waveform useful for playing tones without aliasing artifacts, but it doesn't actually look like a triangle. If you want an ideal triangle waveform as a control signal, use triangle~ (with phasor~).

Max Patch
Copy patch and select New From Clipboard in Max.