# Multiple startNote calls in SynthesizerVoice?

**URL:** <https://forum.juce.com/t/multiple-startnote-calls-in-synthesizervoice/15984>\
**Category:** Audio Plugins\
**Created:** [November 17, 2015, 8:41pm UTC](https://forum.juce.com/t/multiple-startnote-calls-in-synthesizervoice/15984 "2015-11-17T20:41:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pizzafilms](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pizzafilms/32/562_2.png) [@pizzafilms](https://forum.juce.com/u/pizzafilms)\
**Post date:** [November 17, 2015, 8:41pm UTC](https://forum.juce.com/t/multiple-startnote-calls-in-synthesizervoice/15984/1 "2015-11-17T20:41:50Z")

</div>

Is there any reason why I would see multiple calls to startNote/stopNote when playing one key?

I added a voiceIndex to each of my SynthVoices to see what was playing and this is the console out when I played one note:

```
<--------- pressed key
voice: 6, startNote: 62
voice: 6, stopNote
voice: 7, startNote: 62
voice: 7, stopNote
voice: 6, stopNote
voice: 0, startNote: 62
                                <--------- released key
voice: 0, stopNote
voice: 7, stopNote 
voice: 6, stopNote
```

What would cause this?

My synth is barely modified from the Juce Demo Plugin, running in the Plugin Host.

Thanks.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [November 17, 2015, 8:45pm UTC](https://forum.juce.com/t/multiple-startnote-calls-in-synthesizervoice/15984/2 "2015-11-17T20:45:33Z")

</div>

Where's the midi coming from? Is your external keyboard maybe a bit jittery? We're not aware of anything broken in the synth class, so you might want to use a midi tool to look at the incoming midi data before assuming it's something weird that the synth is doing.

---

<div class="post-metadata">

**Author:** ![pizzafilms](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pizzafilms/32/562_2.png) [@pizzafilms](https://forum.juce.com/u/pizzafilms)\
**Post date:** [November 17, 2015, 9:41pm UTC](https://forum.juce.com/t/multiple-startnote-calls-in-synthesizervoice/15984/3 "2015-11-17T21:41:12Z")

</div>

The MIDI is coming from the Plugin Host keyboard.

I stripped some stuff out and now it's still calling startNote() 3 times, but all the same voice instead of different voices.

&nbsp;

---

<div class="post-metadata">

**Author:** ![pizzafilms](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/pizzafilms/32/562_2.png) [@pizzafilms](https://forum.juce.com/u/pizzafilms)\
**Post date:** [November 18, 2015, 1:30am UTC](https://forum.juce.com/t/multiple-startnote-calls-in-synthesizervoice/15984/4 "2015-11-18T01:30:17Z")

</div>

I figured it out.

I was calling addSound() in Processor in my initSynth() method which was in the Processor's prepareToPlay() method.&nbsp;

And for whatever reason,&nbsp;&nbsp;prepareToPlay() was getting called 3 times during startup, and therefore, creating 3 sounds, which in Synthesizer::noteOn, loops through the number of sounds.

Hopefully that will help anyone else that gets snagged on that.

And Jules, having the souce for the framework definitely made it much easier to debug. Thank you.

&nbsp;

&nbsp;

&nbsp;
