Cabbage Logo
Back to Cabbage Site

Some beginners questions

Some of the chords are really wide voiced…
So I think b) would be awesome…

Yeah, option 2 is not going to work as the Juce MIDIKeyboardComponent class, MUST be tied to an actual MIDI state. This means I can’t set up a dummy one. I can still look at creating a keyboard display widget but I’m not sure about having a scroll-able range like you do with the current one. That would involve a fair amount of work. Leave it with me. I’ll see what I can do.

Maybe it is possible shorten the keyboard and remove arrows. I don’t need it as low as -C2.
For example from C0 to C6
And then play with images?

Another question about labels:

Stext  strcpyk "Start"
SIdentifier sprintfk "text(\"%s\")", Stext
chnset SIdentifier, "chord"  

   
if (p4 == 2 && kCombo == 2) then

 Stext  strcpyk "Cmin9"
SIdentifier sprintfk "text(\"%s\")", Stext
chnset SIdentifier, "chord"   

When i am presing and holding 2 and with kCombo 2 preset selected it keeps blinking between “Start” and “Cmin9”.

Thanks!!!

Can you post a full example?

I added a keyboarddisplay widget that is entirely graphical in nature. You can control the colours and look of it as you do the regular keyboard, but pressing on the keys will not result in any action. But you can update the currently held keys using the keypressed() identifier as shown in the attached gif. I’ve not added a manual page yet, but will try to get around to that shortly. Note that there is no keyreleased() identifier, each time keypressed() is called it resets all previous notes.

Great news about keydisplay!

Here is example for text label.
TEXT example.csd (1.6 KB)

Text is blinking when holding key with a mouse.
Also, it starts with “hello” by default. How to make it start form “Start”

Thank You

You can add a text() identifier to the label in your Cabbage section and set the initial text there. I can’t recreate the flashing problem you noted? If I press note 2 on the MIDI keyboard, while 2 is displayed in the combobox I see “Cmin9” appear on screen. No flashing.

[edit] Now I’m seeing some flashing of text…

The issue here is that you keep writing “start” to the label each time a note is pressed. And then after that you write another label depending on the note pressed. You should only write text once per note press. Try moving the ‘start’ text to an else block (see below).

instr	1
; EXAMPLE FOR SHOWING TEXT.
; Combox(presets).
kCombo chnget "heythere"
; MIDI note 2 preset 2.

     
if (p4 == 2 && kCombo == 2) then

    Stext  strcpyk "Cmin9"
    SIdentifier sprintfk "text(\"%s\")", Stext
    chnset SIdentifier, "chord"   

    kNoteIndex  = p4
    kNoteIndex2 = p4+53
    kNoteIndex3 = p4+55

   
    midion 1,kNoteIndex, p5
    midion 1,kNoteIndex2, p5
    midion 1,kNoteIndex3, p5
        
    printk2 kNoteIndex
    printk2 kNoteIndex2 
    printk2 kNoteIndex3 
      
      

; MIDI note 3 preset 3.

elseif (p4 == 3 && kCombo == 3) then

    Stext  strcpyk "Amin"
    SIdentifier sprintfk "text(\"%s\")", Stext
    chnset SIdentifier, "chord"   


    kNoteIndex  = p4+0
    kNoteIndex2 = p4+3
    kNoteIndex3 = p4+5

   
    midion 1,kNoteIndex, p5
    midion 1,kNoteIndex2, p5
    midion 1,kNoteIndex3, p5
        
    printk2 kNoteIndex
    printk2 kNoteIndex2 
    printk2 kNoteIndex3 
        
else

Stext  strcpyk "start"
SIdentifier sprintfk "text(\"%s\")", Stext
chnset SIdentifier, "chord"  
endif
           
endin

Thanks,
Everything with the text label seems to be clear.

Now i ma trying to figure out the key display.

Do i need to download something additional for keyboarddisplay widget?

Can you remind me which OS you are on?

Win7, Win8

Try this one.

As i understand it is not showing keyboarddisplay as a widget… (blue color instead of grey)
Is this ok?

That’s Ok for now. I am not yet finished the full implementation, but it should still work ok for now.