Drum Synth clicking

Status
Not open for further replies.

danixdj

Well-known member
Hi, i have a problem on my teensy audio board.

if I play a note of drum1.noteOn() and i repeat "drum1.noteOn()" before that the length of the first note is finished there is a audio clicking.

If you play a drum2.noteOn() (second drum synth) over the lenght of durm1 there aren't audio clicking but if i want to play more notes it's impossible without clicking....

can you help me?

Thank you.
 
Maybe I can help. But as a general rule, I don't investigate these sorts of issues unless a complete program and other details needed to reproduce the problem are posted.


Thank you Paul :)

------

elapsedMillis tempo;

#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioSynthSimpleDrum drum1; //xy=115,72
AudioOutputI2S i2s2; //xy=1344,44
AudioConnection patchCord1(drum1, 0, i2s2, 0);
AudioControlSGTL5000 sgtl5000_1; //xy=150,124
// GUItool: end automatically generated code

void setup() {
AudioMemory(20);
sgtl5000_1.enable();
AudioNoInterrupts();
drum1.frequency(70);
drum1.length(1500);
drum1.secondMix(0.0);
drum1.pitchMod(1.0);
AudioInterrupts();
}

void loop() { if (tempo > 600) {drum1.noteOn(); tempo = 0;}}

---

the click there is only if the tempo is less then length.

Why? this is a problem for make a drum machine or similar...
 
I tried it some time before - that length doesn't sound like a drum .)
But i can't hear the clicking - (i patched it to use the PT8211, because it was more easy for me to test)
Hm - i don't think that the SGTL5000 is the problem, because we should notice it with other sounds, too.
Any hints how i can reproduce it ?
 

Attachments

  • Schermata 2016-12-05 alle 03.36.13.png
    Schermata 2016-12-05 alle 03.36.13.png
    14.5 KB · Views: 122
That I think the solution will be easy but "noteOff" command do not exist.
When there is a new "noteon" the previous note must to be off.
But "noteOff" command do not exist :(
 
I've not studied this scenario but could you delay the new note until the next (to negative ) zero crossing of the initial signal? (Given the new notes seem to start negative!)

Or wait until the new signal matches the direction and magnitude of the old.

Or you can temporarily engage a low pass on the output until the discontinuity would be reliably gone ... a few milliseconds perhaps.


Is this an open high-hat thing?
 
I've not studied this scenario but could you delay the new note until the next (to negative ) zero crossing of the initial signal? (Given the new notes seem to start negative!)

Or wait until the new signal matches the direction and magnitude of the old.

How?
Or you can temporarily engage a low pass on the output until the discontinuity would be reliably gone ... a few milliseconds perhaps.

How? sorry but i haven't idea.

Is this an open high-hat thing?

i'm making a drum machine but it's impossibile because i can't repeat notes quickly :(
 
Last edited:
Sorry ....I should have read the whole thing before commenting.

I assumed you were trying to bypass the decay phase of the note when retriggered.

I think you should ignore me 😕

The library object could handle this better or have a setting that starts a new note instance and leaves the old note playing.
 
The library object could handle this better or have a setting that starts a new note instance and leaves the old note playing.

Or stop the note when start the new note... it's not a problem, in this case you can listen the length of the last note and all can play fine..
But i don't know how...
 
The click could be mitigated with a low-pass filter after the module. Just make sure the cutoff is WELL above any harmonic content of the synth sound.
 
The click could be mitigated with a low-pass filter after the module. Just make sure the cutoff is WELL above any harmonic content of the synth sound.

Yes but i lose the original sound that it's pretty cool!
This is officially a bug right now? We can hope in a solution for the future?
 
Yes but i lose the original sound that it's pretty cool!
This is officially a bug right now? We can hope in a solution for the future?

Im not sure that is a bug.
You want to year the drum till end normally, and not stop if you trigger an other.
So, the right way to use it is to use two or more drum effects. This way you'll hear each til the end.

Fixing the current behavoir means fixing something that is not broken ... you use it in a way it was not intended for. No real existing drum stops. No need to fix it.
 
Last edited:
Im not sure that is a bug.
You want to year the drum till end normally, and not stop if you trigger an other.
So, the right way to use it is to use two or more drum effects. This way you'll hear each til the end.

Fixing the current behavoir means fixing something that is not broken ... you use it in a way it was not intended for. No real existing drum stops. No need to fix it.

If it's not a bug and we're talking about a drum object, can you give me an example of a drum roll?

29384756 drum objects for a sound without click? I'm sorry for my irony :p
 
If it's not a bug and we're talking about a drum object, can you give me an example of a drum roll?

29384756 drum objects for a sound without click? I'm sorry for my irony :p

LOL. Want a fish?
How does your drum roll sound with stopping the drum? Any idea?
Ok, then "fix" it, and report.

Otherwise, i guess, you don't need more than 3 ..5 objects, (if you don't use 1.5 seconds!! as length)...

Sorry, EOD (End Of Discussion) for me.
 
Last edited:
1.5 seconds it's not a drum roll, it's a sleeping musician :)
sorry, it's impossible and it is very unfortunate...

the sound is very very good but it's impossible use this for a drum machine with this limit, i must search a new idea for this scope...
 
Not to participate in a discussion - but wondering what your ideal/expected behavior would be? Stop the not yet complete note or play a second copy over the first?

To stop: Is there a drum1.noteOff() you could use to stop it without clicking as you restart it
 
Not to participate in a discussion - but wondering what your ideal/expected behavior would be? Stop the not yet complete note or play a second copy over the first?

To stop: Is there a drum1.noteOff() you could use to stop it without clicking as you restart it

Correct but unfortunately "drum1.notOff()" command not exist..
 
[if I filter] ...i lose the original sound that it's pretty cool!...
have you tried? You should be able to find a cut off that does not effect the synth output too much if the waveforms look like the image from above.

My suggestion above -- to delay the new note until the old is at an appropriate zero crossing (or is idle) --- might be something that can be done to the module source. But it will be well outside my abilities for the foreseeable future. Still, I've done similar before with desktop audio software so I know these kinds of solutions work.

While formally it would not preclude aliasing it would not be apparent to a human ear if there is no significant jump in the signal and the slope change isn't too pronounced at the join.

Idea:
What about having two (or more) objects and cycling through incoming note-on messages so they take turns?
Edit -- oh yeah... you want voice off.. sorry again.
 
Last edited:
Idea:
What about having two (or more) objects and cycling through incoming note-on messages so they take turns?
Edit -- oh yeah... you want voice off.. sorry again.[/QUOTE]

This is what i'm doing ... but it is a limitation, i need more and more objects...
The filter isn't a solution, the clicking is very strong and it's always present!
I'm testing a solution using a gate directly on the mixer object When the MIDI keyboard or sequencer send "noteoff" (mixer goes to 0) and "noteon" (mixer goes to 1), but it's very difficult because it's must to be fast and stable... it's a work around for a concrete problem anyhow.

This is a great limitation for a drum object, the drum is made for a rapid sequence and a clicking over a repetition is the worst way to make a function but we can not speak about that ... :p
 
Last edited:
So adding a noteOff() routine solves the clicking on repeated triggers.

But then it clicks when noteOff is called.

Feel free to give it a try

Code:
diff --git a/synth_simple_drum.cpp b/synth_simple_drum.cpp
index 54510ce..219bab4 100644
--- a/synth_simple_drum.cpp
+++ b/synth_simple_drum.cpp
@@ -42,6 +42,12 @@ void AudioSynthSimpleDrum::noteOn(void)
   __enable_irq();
 }

+void AudioSynthSimpleDrum::noteOff(void)
+{
+  env_lin_current = 0x0000;
+}
+
+
 void AudioSynthSimpleDrum::secondMix(float level)
 {
   // As level goes from 0.0 to 1.0,
@@ -205,4 +211,3 @@ void AudioSynthSimpleDrum::update(void)
   release(block_wav);

 }
-
diff --git a/synth_simple_drum.h b/synth_simple_drum.h
index 2982154..5f1a1ba 100644
--- a/synth_simple_drum.h
+++ b/synth_simple_drum.h
@@ -44,6 +44,7 @@ public:
     wav_amplitude2 = 0;
   }
   void noteOn();
+  void noteOff();

   void frequency(float freq)
   {
@@ -92,4 +93,3 @@ private:
 };

 #endif
 
This is a good idea! i can use a mixer.gain 0 before NoteOff :)

How can i use your code?
Sorry but it's the first time that i use a "diff" code.

Thank You.
 
If you've got a command line shell, you can use the patch utility to apply the diff to the files.

This one is small enough that you can do it manually. Go to the files it mentions, find the line/column numbers listed, and make the changes listed. Insert the parts that start with +, and remove the parts that start with -.

This is a good idea! i can use a mixer.gain 0 before NoteOff

My money is on that clicking, also.

I'm thinking through how an actual fix would work, but it might be after the holidays to have time to write & test it.
 
I'm thinking through how an actual fix would work, but it might be after the holidays to have time to write & test it.

Your work is welcome, there are the same problems in evelope.noteOn(); and envelope.noteOff(); clicking is always present when you change note status if a wave is active... :(
I thought that it was a drums object problem only but it's present in all part of synth functions.
 
Status
Not open for further replies.
Back
Top