![]() ![]() ![]() ![]() ![]() Alan numitron clock Clapclap 2313/1386 SNES Pi Webserver USB Volume/USB toys Smokey amp Laser cutter WordClock ardReveil v3 SNES Arcade cabinet Game boy projects cameleon Home Presence Detector ![]() AlanFromJapan ![]() ![]() ![]() Akizukidenshi Elec-lab Rand Nerd Tut EEVblog SpritesMods AvrFreaks Gameboy Dev FLOZz' blog Switch-science Sparkfun Suzusho Datasheet Lib Reddit Elec Ermicro Carnet du maker (fr) |
MIDI, CSharp and Yamaha chipsLast update: Thu Jun 5 22:25:41 2025
How to transform a MIDI file to Yamaha's chip command ?That was my question since in addition to be lame with electronics, I am lame at music. So, how could I revamp a not-too-complex tune from a MIDI file to something Yamaha's chip can understand.After little search I found on CodeProject (heaven for C# developpers) a very good tool for MIDI : CSharpMidiToolkit from Mr. Leslie Sanford. This man has passion for MIDI, and his code is quite nice. And also it can replay a midi tune and interprete it ... and show it on a visual piano by getting the MIDI key code... WAIT A SEC : that's exactly what I need! So after a little peep at the code one can easily manage to retrieve the keys (on the piano) that are pressed (just listen to the good event and you're done, code is very clear). Problem comes with MIDI structure: it has many channel that are playing in parallel. Indeed, our Yamaha YMZ294 (or whatever of its siblings) has also many channel... but no way to program it parallely. We have to do time-multiplexing of the notes to be able to program the chip. No worries, it's IT engineering school classics, and anyway a chronogram and a little logic can lead you through.
CodesCSharpMidiToolkitV5_demo.zip This is the Leslie Sanford excellent application that I scavenged. Please have a look to latest version on Codeproject. Thanks again to him!.Form1.SequencerDemo.zip the 3 files I've changed to allow generating YMZ294 compatible tune from midi (in the SequencerDemo project, the main form in fact). SequencerDemoPlusVamp.zip last but not least, the precompiled application (C# 2.0) |
||||
All content on this site is shared under the MIT licence (do what u want, don't sue me, hat tip appreciated) electrogeek.tokyo ~ Formerly known as Kalshagar.wikispaces.com and electrogeek.cc (AlanFromJapan [2009 - 2025]) |