I'm making some assumptions and not considered cost, so take what you will out of my reply.
Assuming that your MIDI notes are files, you would want some kind of storage to store them and some intelligence to read them. That immediately suggests a microcontroller.
You also want sound to be output.
So my suggestions in order of increasing complexity:
1. Use a Raspberry Pi (Model A is good enough for this, Model B/B+ would be overkill):
- It can run Java, has onboard audio output, and can accept keyboard inputs via USB or onboard GPIO (General Purpose Input Output) pins
- On the Raspberry Pi, write a program that reads the USB device or GPIO pins.
My preferred way to program the Pi is using python or C because the community and support are good. But if you're not comfortable with them, then use Java + [
Pi4J library.
- This program checks the inputs, selects appropriate MIDI file and runs a command line MIDI player like
timidity to play it.
- You need some kind of keyboard (maybe a mini USB qwerty, or a membrane keypad, or build your own 3d printed piano keyboard). Unfortunately, I have never built a keyboard, so I don't
have any suggestions, except to search in a site like Instructables.
- Connect keyboard to Pi via USB or via the onboard GPIO pins.
2. Using an arduino:
- I don't have a precise answer, but since you mention you're new to electronics, I thought I'll introduce some arduino related words that might help you google for a solution.
- Arduinos don't have onboard audio output capability. So you want to search for an appropriate "audio shield". "Shield" is the arduino term for an addon board that connects to
the arduino and adds some capabilities to it.
- If the audio data is small enough, you can store it in arduino's memory (which is limited to 32KB-256KB). Otherwise, you'll also need an SD/microSD card shield to store the data.
- Again, you'll need some kind of keyboard/keypad, but USB devices can be connected to only to a Yun as far as I know. For other arduinos, you'll need
a USB shield or other specialized shield.
One site I can recommend for such DIYs is
Instructables.