Midi animation

midi

#1

I was thinking of generating animation with midi.
It would be pretty easy to do it with drums … a few drawings of someone “hitting” drums …
Anyone here know how to trigger pictures from midi ? I am sure the software is out there …
perhaps some sort of hash table which links a list or array of photos in a DB or list to midi notes … I don’t wan’t to reinvent the wheel …


#2

maybe this is the way to do it?


#3

just do it the way MidiKeyboardComponent does it. You have a timer running, when it’s called, it says “hey, repaint me”. your repaint code draws one of many pictures. Use your midi input callback to change which picture to draw (use locks btw)


#4

That’s a good idea thanks and that would be a useful class to start from …


#5

start with just changing pictures when you click on the GUI. i.e.

void mouseDown(const MouseEvent& e)
{
    img = GetImage(1);
    repaint();
}
void mouseUp(const MouseEvent& e)
{
    img = GetImage(0);
    repaint();
}

void paint(Graphics& g)
{
   g.drawImage(img);
}

#6

thanks so much !!