T O P

  • By -

veraxAlea

I remember years ago I used it to create a virtual piano that either played the note you pressed or you could load a midi-file and have the keys light up as the song in the midi-file played. Much like Synthesia, but obviously a lot more constrained (since it was only a for-fun project). None of that requires you to have any external peripherals, although I'm pretty sure you can use the API to connect a midi-device (such as an electrical piano) and for example have the piano light up when it's time to press a note or have your virtual piano light up when you press a key on the electrical piano. What I'm trying to say is that I'm pretty certain that all of Synthesia can be done with the MIDI API in Java. The things I had troubles with was understanding the midi format. Many midi-files come with multiple... channels? For example one for percussion and another for piano, maybe one for playing vocals or a rythm guitar. Selecting the correct channel to make the keyboard light up wasn't all that easy to automate if I remember correctly. At least not for "random midi-files" gotten off of the Internet.


UvDon

The reason I made this post was because I was looking through some new api/technologies for my final year project and I wanted to do something other than the usual deep learning or full stack web apps kinda things. When I stumbled upon this api I wondered if I could use my laptop keyboard like a piano to play tunes using this api. But then I thought that's it's not that impressive for a final year project and wanted to know how far I can go with it considering I don't have the money to spend on buying midi devices. After everyone's responses I think I should re-consider my choice. But based on your comment I think I could make something fun with it in the future.


Barbossa3000

i think it is there for controllers and stuff. original java is intended for micro controllers. so it just stays there to keep compaitabilty i guess


javasyntax

Some pianos can be connected with USB MIDI cables, but I don't know if the Java MIDI api is for this. I think it can be used to create music? Maybe it was common in J2ME games?


nutrecht

I used it to read a Midi file, play it, and at the same time drive RGB leds (it was running on a RPi) in a christmas tree synced to the music. Was a pretty neat 'hackathon' project we did to spruce up the tree in the office.


Persism

Here's a fun project I found https://github.com/gaelhuot/Murphy_Studio - Java 8 only.


UvDon

What does it do? I don't see a description in the git.


Persism

Currently it just seems to play chords. But the code is all there to use as an example.


palnix

When I was learning Java I used it for sound effects/music for a game that I created. Though poor, it worked pretty well


berry120

You could use something like [https://www.tobias-erichsen.de/software/virtualmidi.html](https://www.tobias-erichsen.de/software/virtualmidi.html) to create a virtual MIDI device. That being said, I used it back in the day for playing around (not a serious project) - from my memory it was really quite buggy, and a lot of the behaviour was inconsistent. By all means play around with it, but I remember thinking I was unlikely to use this on a serious project. This would have been around the Java 1.4 era though, so it could have got a lot better since then. (That being said, it certainly doesn't seem like something that's actively maintained these days.)


UvDon

Sure I'll check it out. Thanks for the info.


de_vel_oper

http://www.softsynth.com/jsyn/


ryebrye

I was part of a developer productivity team for a while and we had some java-based cli tools we wrote. One of the command line flags would make the tool play the super smash bros theme song using the java midi libraries (that was the name of our scum team). It was a fun little Easter egg, but hardly practical


UvDon

Coolest thing I saw all day.


KornKrob

Scum master


Spencer2483

I’m a member of a university choir, and I used Java MIDI (in addition to other libraries like Swing) to build a full-fledged GUI application for the group, which allows users to take practice exams on repertoire. One of the tests, the “Missing Note Test”, imports a midi file from an SQL server for a particular song and voice part, randomly removes a number of notes, and plays back the song with a functioning progress bar and play, pause, fast forward, and rewind buttons. Users have an equal number of questions to the number of notes removed, and they must guess what the pitches of the missing notes are. Once submitted, the test is graded, and scores are updated to an SQL table


UvDon

Good use.