Sammy1Am / Moppy2

The evolution of the Musical flOPPY controller
Other
309 stars 50 forks source link

Description of the device #191

Closed Besteciler closed 1 year ago

Besteciler commented 1 year ago

Hello I looked at the code, everything is very cool. Almost every command has an explanation in the code. But I'm interested in the description of the operation of the device after it is turned on.

Could not help with a description of the work after switching on and after downloading the melody. What is actually happening at this moment. And is there a block diagram of the algorithm?

DJthefirst commented 1 year ago

I’ll just write out the general concept and can go into a deeper explanation later if you want. Basically the Song is in MIDI format so java has a lib that plays the song in time. when it is playing notes are generated and sent as note on and off commands. MIDI has 16 channels so these notes are messages with an assigned channel and command such as note 10 on or off. I would recommend looking at the midi protocol. After that the messages go through moppys mappers. The mapper is needed because floppy drives can only play one note at a time so chords are a problem. Notes are sorted by channel, sent to different drives with round robin, and removed if they are out of range etc. This is mapping individual notes to physical floppy drives. Then it is sent as new moppy msg to the drive which was encoded. It gets a device ID for each microcontroller and instrument Id. Then the microcontroller has an interrupt and counter that will toggle the pin at the frequency of the note from that lookup table.

DJthefirst commented 1 year ago

If your interested in how moppy works I would also suggest you look at my project Mechanical Midi Music which uses the same general idea. It might be easier to understand how Midi is used. The difference from Moppy is instead of being split between a java server and microcontroller I use an esp32 with Arduino to do all the processing on the micro controller. The communication fully uses the midi protocol so you can better use midi keyboards and controllers without a computer. Also instead of having a mapper I have virtual distributors that take a MIDI channel and distribute it to a pool of instruments(such as Floppy Drives). Still a work in progress.