# MidiKeyboardComponent?

**URL:** <https://forum.juce.com/t/midikeyboardcomponent/545>\
**Category:** General JUCE discussion\
**Created:** [December 9, 2005, 9:26pm UTC](https://forum.juce.com/t/midikeyboardcomponent/545 "2005-12-09T21:26:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kunitoki](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kunitoki/32/15_2.png) [@kunitoki](https://forum.juce.com/u/kunitoki)\
**Post date:** [December 9, 2005, 9:26pm UTC](https://forum.juce.com/t/midikeyboardcomponent/545/1 "2005-12-09T21:26:35Z")

</div>

i’m testing the new MidiKeyboard component, and it integrates well into the filter. apart from a “little” overhead add to each calls of audio processing, i’ve tried to play my synth with the mouse. incidentally, when moving too fast between the keys, some noteoff seems to be lost in the process. but playing my vst synth with midi input (e.g. sequencer or external midi keyboard) in a “crazy performer mode” i don’t get note stucks (i’ve tested widely the voice’s start/stop and allocation/deallocation, and is working perfectly). also sometimes when i press some notes on the keyboard, i see some cpu spikes when releasing notes…  
i’ve tried also integrating Daniel’s VirtualPiano component, and my synth treat midi messages injected from the gui as expected.  
if you need some more info i’m here.

lou

---

<div class="post-metadata">

**Author:** ![kunitoki](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kunitoki/32/15_2.png) [@kunitoki](https://forum.juce.com/u/kunitoki)\
**Post date:** [December 9, 2005, 9:35pm UTC](https://forum.juce.com/t/midikeyboardcomponent/545/2 "2005-12-09T21:35:41Z")

</div>

another thing i’ve discovered casually testing the synth + keyboard component on tracktion. when u minimize the app during play (and there is no background processing activated) the playback stops, but there is no midi allNotesOff or allSoundOff message triggered, cause i see in the keyboard component that the last midi notes played are still on (coloured with yellow)…  
this is mostly related with tracktion than with the component, but just to signal the strange behaviour :o

---

<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:** [December 10, 2005, 1:23pm UTC](https://forum.juce.com/t/midikeyboardcomponent/545/3 "2005-12-10T13:23:49Z")

</div>

Ta. It’s only a first stab at a keyboard component, I didn’t expect it to be bulletproof just yet. I wanted a keyboard to use in a project I’m working on, and needed some features that weren’t in Daniel’s component, so thought I’d have a go.

---

<div class="post-metadata">

**Author:** ![kunitoki](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kunitoki/32/15_2.png) [@kunitoki](https://forum.juce.com/u/kunitoki)\
**Post date:** [December 12, 2005, 10:28pm UTC](https://forum.juce.com/t/midikeyboardcomponent/545/4 "2005-12-12T22:28:56Z")

</div>

i’ve found that there is a lacking note off when u click on a note, then you drag fast to other keys and then u return back to the first key you clicked on . something like pressing C-D-D#-C notes, then C remains on. i’ve not investigated too much into the code but sure is the updateNoteUnderMouse that is loosing a case…  
another question, why

`bool MidiKeyboardComponent::mouseDownOnKey (int midiNoteNumber, const MouseEvent& e)
{
    return true;
} `

returns true always ?

---

<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:** [December 13, 2005, 10:13am UTC](https://forum.juce.com/t/midikeyboardcomponent/545/5 "2005-12-13T10:13:57Z")

</div>

Can’t see any bugs in that myself. Are you getting the key being drawn as stuck down, or just the sound continuing?

And mouseDownOnKey is virtual - have a read of its comment.

---

<div class="post-metadata">

**Author:** ![kunitoki](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/kunitoki/32/15_2.png) [@kunitoki](https://forum.juce.com/u/kunitoki)\
**Post date:** [December 14, 2005, 2:31am UTC](https://forum.juce.com/t/midikeyboardcomponent/545/6 "2005-12-14T02:31:51Z")

</div>

hey jules i don’t know why but now is working. me crappy i’ve made some tweak to the voice allocation engine that i didn’t managed to catch off. sorry for arising stuff that was perfect already… everything in these days is going bad… :roll:

---

<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:** [December 14, 2005, 9:46am UTC](https://forum.juce.com/t/midikeyboardcomponent/545/7 "2005-12-14T09:46:04Z")

</div>

Ah - glad to see I’m not losing my touch!

---

<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:** [May 12, 2017, 9:51am UTC](https://forum.juce.com/t/midikeyboardcomponent/545/8 "2017-05-12T09:51:36Z")

</div>

Closed on May 12, 2017, 9:51am UTC


