The goal of this set of "mini-programs" is to consolidate concepts such as Serialization, File I/O, Network and Threads in Java. The final program is a simple Software Synthesizer with a chat that enable users to load and play tracks from other users. I'm using JavaSound API to implement the synthesizer as well as the mini-programs.
This project is organized in such a way that each branch represents a little development step. In the next lines is a brief description of what is implemented on each branch:
1-miniminimusic: In this first branch are the initial steps with javax.sound.midi package. When this program is executed, it plays a piano note for a short period of time.
2-minimusiccmd: This program have the same goal as the program in the first branch. The key difference is that an user can enter on commandline two arguments:
- The first one informing what instrument the user wants a note to be played on
- The second being the note to be played
3-minimusicplay: In this branch the MIDI events creation was abstracted to a method, and an event was associated to a note so that each time a note is played, an event is registrated within this note. With that, an event is created, and the inner class MyDrawPanel listens the created event and draws a random square on the screen each time a note is played.
4-beatboxGUI: This is where the synthesizer program starts to take shape. The interface with the instruments and checkboxes to select which instruments should be played in a certain beat, as well as buttons to control the music flow was developed here.
5-beatboxSerialization: It was added options of serialize and deserialize beats patterns.
6-finalBeatboxProgram: The final version of the synthesizer (BeatBox) program. It was added the chatbox and with that the network logic, as well as some code refactoring. An image of this final version can be viewed bellow:
1 - You can clone this repo (by using
git clone
) or download and extract this repo files.
2 - Ensure that you have Java installed and configured (version >= 1.5).
3 - On the project's main folder, run
javac <filename.java>
to compile the source file.
4 - Run the compiled file using the
java <filename>
command.