CNC Music Factory – MIDI to gcode

I’m making a note here – *huge success*

First output from ‘mid2cnc.py’, a program to convert MIDI to gcode linear moves, allowing one to play music on a CNC machine (will publish it when it’s done!). The music is Jonathan Coulton’s “Still Alive” from the ending credits of Portal.

Basically, it’s possible to compute a combination of (distance, feedrate) that will cause the stepper motor to spin at an exact frequency corresponding to a musical note. With a little vector magic, the same can be done for (x, y, z, feedrate) to produce chords as the machine follows a 3D line through space.

TODO:
Handle more than 3 notes played at a time (drop some if there are not as many axes…)

Lock notes to their initial axis for their duration (maybe only an issue on my ghetto machine where the axis motors sound very different)

(try to) Improve frequency accuracy where 2 or more notes are played simultaneously (may be a CNC software issue)

A description of how it works is on my blog at http://tim.cexx.org/?p=633

Duration : 0:2:55


Technorati Tags: , , , , , , ,

Tags: , , , , , , ,

25 Responses to “CNC Music Factory – MIDI to gcode”

  1. coyote20030 Says:

    Dude that’s awesome!
    Dude that’s awesome!

  2. activiafibras Says:

    five stars just …
    five stars just because the song!…(if had been something else, they would have been 4) so, well done ^^

  3. maclover201 Says:

    LOL! Awesome!
    LOL! Awesome!

  4. jdsanchez473 Says:

    lamo
    lamo

  5. freedomisntfreeffs Says:

    blegh, how can you …
    blegh, how can you be so skilled with cnc man?! :P

  6. orbitalchiller Says:

    lmao
    lmao

  7. Rand0081 Says:

    THIS WAS A TRIUMPH !
    THIS WAS A TRIUMPH !

  8. kram242 Says:

    Nice job this is …
    Nice job this is too cool!

  9. burrito873 Says:

    God this is full of …
    God this is full of win.

  10. theDisasternauts Says:

    Beautiful.
    Beautiful.

  11. WorldWarCheese Says:

    Watching this makes …
    Watching this makes me wish I was female so that I could bear you children.

  12. Blake687 Says:

    And don’t forget …
    And don’t forget the Z axis. There are actually 3 axis in total playing Still Alive. X, Y, Z

  13. danz409 Says:

    OMG its got 2 bits …
    OMG its got 2 bits of music coming from it! both axes playing 1 bass and 1 main … that’s soo freaking amazing!

  14. OblivionKnight457 Says:

    HUGE SUCCES!
    HUGE SUCCES!

  15. shauron2569 Says:

    wow, thats …
    wow, thats impressive. i wish i knew how to program soemthing like that. i never thought u could make a cnc sing. awesome.

  16. xenepp Says:

    Best thing I’ve …
    Best thing I’ve seen one of these make yet! :-D

  17. GroovyMango Says:

    damn!! =o
    damn!! =o

  18. showson1 Says:

    WTF! Dude, that’s …
    WTF! Dude, that’s insane.. in a good way. :)

  19. memcwhoDave Says:

    Dear sir,
    I LOVE …

    Dear sir,
    I LOVE YOU!
    YOU ARE A FRIKIN’ GENIUS!
    Yours Faithfully
    MemcwhoDave

  20. dgthall Says:

    OK, nobody has …
    OK, nobody has asked this yet, so…

    What does it make if it actually has stock in the machine?

    This is critical, because as long as it’s not some tiny pellet, it could *totally* be a collectors’ item!

  21. Moratorium Says:

    That is so lame …
    That is so lame it’s almost cool again.

  22. savsavysavage Says:

    this sounds better …
    this sounds better than the original lol

  23. rodstartube Says:

    hahahh cnc wanted a …
    hahahh cnc wanted a break and begun to sing

  24. AmazingAaron1 Says:

    Wow, and they say I …
    Wow, and they say I have to much time on my hands!

  25. evi1wombat Says:

    That is awesome.

    . …
    That is awesome.

    … but does it CNC a cake if you turn the spindle on and put something underneath?

Leave a Reply