MIDI to G-Code



  • Hi!

    I just saw this nice tool:

    https://alexyu132.github.io/midi-m300

    but I have some issues: when I play the resulting G-Code on the web site, it works fine, but some notes are missing on the Duet.

    Does anyone has this issue?



  • @fma said in MIDI to G-Code:

    but some notes are missing on the Duet.

    In Duet web control of panelDue?

    Had mixed results with DWC but panelDue doesn't skip a beat as far as I can tell.

    Share g-code?



  • I uploaded the midi/gcode file as a macro, and asked Duet to run it through PanelDue...

    Here is Mario:

    M300 P153 S659
    G4 P153
    M300 P149 S659
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S659
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S523
    G4 P149
    M300 P148 S659
    G4 P148
    M300 P149 S0
    G4 P149
    M300 P154 S784
    G4 P154
    M300 P446 S0
    G4 P446
    M300 P154 S392
    G4 P154
    M300 P452 S0
    G4 P452
    M300 P154 S523
    G4 P154
    M300 P298 S0
    G4 P298
    M300 P148 S392
    G4 P148
    M300 P304 S0
    G4 P304
    M300 P148 S330
    G4 P148
    M300 P303 S0
    G4 P303
    M300 P149 S440
    G4 P149
    M300 P149 S0
    G4 P149
    M300 P150 S494
    G4 P150
    M300 P154 S0
    G4 P154
    M300 P149 S466
    G4 P149
    M300 P149 S440
    G4 P149
    M300 P151 S0
    G4 P151
    M300 P103 S392
    G4 P103
    M300 P100 S0
    G4 P100
    M300 P100 S659
    G4 P100
    M300 P100 S0
    G4 P100
    M300 P97 S784
    G4 P97
    M300 P100 S0
    G4 P100
    M300 P154 S880
    G4 P154
    M300 P150 S0
    G4 P150
    M300 P148 S698
    G4 P148
    M300 P148 S784
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S659
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S523
    G4 P148
    M300 P154 S587
    G4 P154
    M300 P149 S494
    G4 P149
    M300 P302 S0
    G4 P302
    M300 P155 S523
    G4 P155
    M300 P298 S0
    G4 P298
    M300 P148 S392
    G4 P148
    M300 P304 S0
    G4 P304
    M300 P148 S330
    G4 P148
    M300 P303 S0
    G4 P303
    M300 P149 S440
    G4 P149
    M300 P149 S0
    G4 P149
    M300 P150 S494
    G4 P150
    M300 P154 S0
    G4 P154
    M300 P149 S466
    G4 P149
    M300 P149 S440
    G4 P149
    M300 P151 S0
    G4 P151
    M300 P103 S392
    G4 P103
    M300 P100 S0
    G4 P100
    M300 P100 S659
    G4 P100
    M300 P100 S0
    G4 P100
    M300 P97 S784
    G4 P97
    M300 P100 S0
    G4 P100
    M300 P154 S880
    G4 P154
    M300 P150 S0
    G4 P150
    M300 P148 S698
    G4 P148
    M300 P148 S784
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S659
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S523
    G4 P148
    M300 P154 S587
    G4 P154
    M300 P149 S494
    G4 P149
    M300 P603 S0
    G4 P603
    M300 P149 S784
    G4 P149
    M300 P153 S740
    G4 P153
    M300 P155 S698
    G4 P155
    M300 P149 S622
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S659
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S415
    G4 P149
    M300 P148 S440
    G4 P148
    M300 P148 S523
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S440
    G4 P149
    M300 P149 S523
    G4 P149
    M300 P150 S587
    G4 P150
    M300 P304 S0
    G4 P304
    M300 P148 S784
    G4 P148
    M300 P148 S740
    G4 P148
    M300 P154 S698
    G4 P154
    M300 P149 S622
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S659
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S1047
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S1047
    G4 P148
    M300 P154 S1047
    G4 P154
    M300 P752 S0
    G4 P752
    M300 P149 S784
    G4 P149
    M300 P153 S740
    G4 P153
    M300 P155 S698
    G4 P155
    M300 P149 S622
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S659
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S415
    G4 P149
    M300 P148 S440
    G4 P148
    M300 P148 S523
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S440
    G4 P149
    M300 P149 S523
    G4 P149
    M300 P150 S587
    G4 P150
    M300 P304 S0
    G4 P304
    M300 P148 S622
    G4 P148
    M300 P303 S0
    G4 P303
    M300 P149 S587
    G4 P149
    M300 P297 S0
    G4 P297
    M300 P154 S523
    G4 P154
    M300 P1356 S0
    G4 P1356
    M300 P149 S784
    G4 P149
    M300 P153 S740
    G4 P153
    M300 P155 S698
    G4 P155
    M300 P149 S622
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S659
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S415
    G4 P149
    M300 P148 S440
    G4 P148
    M300 P148 S523
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S440
    G4 P149
    M300 P149 S523
    G4 P149
    M300 P150 S587
    G4 P150
    M300 P304 S0
    G4 P304
    M300 P148 S784
    G4 P148
    M300 P148 S740
    G4 P148
    M300 P154 S698
    G4 P154
    M300 P149 S622
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S659
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S1047
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S1047
    G4 P148
    M300 P154 S1047
    G4 P154
    M300 P752 S0
    G4 P752
    M300 P149 S784
    G4 P149
    M300 P153 S740
    G4 P153
    M300 P155 S698
    G4 P155
    M300 P149 S622
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S659
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S415
    G4 P149
    M300 P148 S440
    G4 P148
    M300 P148 S523
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S440
    G4 P149
    M300 P149 S523
    G4 P149
    M300 P150 S587
    G4 P150
    M300 P304 S0
    G4 P304
    M300 P148 S622
    G4 P148
    M300 P303 S0
    G4 P303
    M300 P149 S587
    G4 P149
    M300 P297 S0
    G4 P297
    M300 P154 S523
    G4 P154
    M300 P1053 S0
    G4 P1053
    M300 P154 S523
    G4 P154
    M300 P149 S523
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S523
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S523
    G4 P149
    M300 P148 S587
    G4 P148
    M300 P149 S0
    G4 P149
    M300 P154 S659
    G4 P154
    M300 P149 S523
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S440
    G4 P148
    M300 P154 S392
    G4 P154
    M300 P446 S0
    G4 P446
    M300 P154 S523
    G4 P154
    M300 P149 S523
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S523
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S523
    G4 P149
    M300 P148 S587
    G4 P148
    M300 P148 S659
    G4 P148
    M300 P1200 S0
    G4 P1200
    M300 P154 S523
    G4 P154
    M300 P149 S523
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S523
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S523
    G4 P149
    M300 P148 S587
    G4 P148
    M300 P149 S0
    G4 P149
    M300 P154 S659
    G4 P154
    M300 P149 S523
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S440
    G4 P148
    M300 P154 S392
    G4 P154
    M300 P452 S0
    G4 P452
    M300 P155 S659
    G4 P155
    M300 P149 S659
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S659
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S523
    G4 P149
    M300 P148 S659
    G4 P148
    M300 P149 S0
    G4 P149
    M300 P154 S784
    G4 P154
    M300 P446 S0
    G4 P446
    M300 P154 S392
    G4 P154
    M300 P452 S0
    G4 P452
    M300 P155 S523
    G4 P155
    M300 P298 S0
    G4 P298
    M300 P148 S392
    G4 P148
    M300 P304 S0
    G4 P304
    M300 P148 S330
    G4 P148
    M300 P303 S0
    G4 P303
    M300 P149 S440
    G4 P149
    M300 P149 S0
    G4 P149
    M300 P150 S494
    G4 P150
    M300 P154 S0
    G4 P154
    M300 P149 S466
    G4 P149
    M300 P149 S440
    G4 P149
    M300 P151 S0
    G4 P151
    M300 P103 S392
    G4 P103
    M300 P100 S0
    G4 P100
    M300 P100 S659
    G4 P100
    M300 P100 S0
    G4 P100
    M300 P97 S784
    G4 P97
    M300 P100 S0
    G4 P100
    M300 P154 S880
    G4 P154
    M300 P150 S0
    G4 P150
    M300 P148 S698
    G4 P148
    M300 P148 S784
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S659
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S523
    G4 P148
    M300 P154 S587
    G4 P154
    M300 P149 S494
    G4 P149
    M300 P302 S0
    G4 P302
    M300 P155 S523
    G4 P155
    M300 P298 S0
    G4 P298
    M300 P148 S392
    G4 P148
    M300 P304 S0
    G4 P304
    M300 P148 S330
    G4 P148
    M300 P303 S0
    G4 P303
    M300 P149 S440
    G4 P149
    M300 P149 S0
    G4 P149
    M300 P150 S494
    G4 P150
    M300 P154 S0
    G4 P154
    M300 P149 S466
    G4 P149
    M300 P149 S440
    G4 P149
    M300 P151 S0
    G4 P151
    M300 P103 S392
    G4 P103
    M300 P100 S0
    G4 P100
    M300 P100 S659
    G4 P100
    M300 P100 S0
    G4 P100
    M300 P97 S784
    G4 P97
    M300 P100 S0
    G4 P100
    M300 P154 S880
    G4 P154
    M300 P150 S0
    G4 P150
    M300 P148 S698
    G4 P148
    M300 P148 S784
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S659
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S523
    G4 P148
    M300 P154 S587
    G4 P154
    M300 P149 S494
    G4 P149
    M300 P302 S0
    G4 P302
    M300 P155 S659
    G4 P155
    M300 P149 S523
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S392
    G4 P148
    M300 P304 S0
    G4 P304
    M300 P148 S415
    G4 P148
    M300 P149 S0
    G4 P149
    M300 P154 S440
    G4 P154
    M300 P149 S698
    G4 P149
    M300 P149 S0
    G4 P149
    M300 P150 S698
    G4 P150
    M300 P154 S440
    G4 P154
    M300 P449 S0
    G4 P449
    M300 P103 S494
    G4 P103
    M300 P100 S0
    G4 P100
    M300 P100 S880
    G4 P100
    M300 P100 S0
    G4 P100
    M300 P98 S880
    G4 P98
    M300 P102 S0
    G4 P102
    M300 P103 S880
    G4 P103
    M300 P100 S0
    G4 P100
    M300 P100 S784
    G4 P100
    M300 P100 S0
    G4 P100
    M300 P97 S698
    G4 P97
    M300 P100 S0
    G4 P100
    M300 P154 S659
    G4 P154
    M300 P149 S523
    G4 P149
    M300 P149 S0
    G4 P149
    M300 P150 S440
    G4 P150
    M300 P154 S392
    G4 P154
    M300 P452 S0
    G4 P452
    M300 P155 S659
    G4 P155
    M300 P149 S523
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S392
    G4 P148
    M300 P304 S0
    G4 P304
    M300 P148 S415
    G4 P148
    M300 P149 S0
    G4 P149
    M300 P154 S440
    G4 P154
    M300 P149 S698
    G4 P149
    M300 P149 S0
    G4 P149
    M300 P150 S698
    G4 P150
    M300 P154 S440
    G4 P154
    M300 P449 S0
    G4 P449
    M300 P154 S494
    G4 P154
    M300 P149 S698
    G4 P149
    M300 P150 S0
    G4 P150
    M300 P153 S698
    G4 P153
    M300 P104 S698
    G4 P104
    M300 P100 S0
    G4 P100
    M300 P100 S659
    G4 P100
    M300 P100 S0
    G4 P100
    M300 P97 S587
    G4 P97
    M300 P100 S0
    G4 P100
    M300 P154 S523
    G4 P154
    M300 P149 S330
    G4 P149
    M300 P150 S0
    G4 P150
    M300 P153 S330
    G4 P153
    M300 P155 S262
    G4 P155
    M300 P446 S0
    G4 P446
    M300 P154 S659
    G4 P154
    M300 P149 S523
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S392
    G4 P148
    M300 P304 S0
    G4 P304
    M300 P148 S415
    G4 P148
    M300 P149 S0
    G4 P149
    M300 P154 S440
    G4 P154
    M300 P149 S698
    G4 P149
    M300 P149 S0
    G4 P149
    M300 P150 S698
    G4 P150
    M300 P154 S440
    G4 P154
    M300 P449 S0
    G4 P449
    M300 P103 S494
    G4 P103
    M300 P100 S0
    G4 P100
    M300 P100 S880
    G4 P100
    M300 P100 S0
    G4 P100
    M300 P98 S880
    G4 P98
    M300 P102 S0
    G4 P102
    M300 P103 S880
    G4 P103
    M300 P100 S0
    G4 P100
    M300 P100 S784
    G4 P100
    M300 P100 S0
    G4 P100
    M300 P97 S698
    G4 P97
    M300 P100 S0
    G4 P100
    M300 P154 S659
    G4 P154
    M300 P149 S523
    G4 P149
    M300 P149 S0
    G4 P149
    M300 P150 S440
    G4 P150
    M300 P154 S392
    G4 P154
    M300 P452 S0
    G4 P452
    M300 P155 S659
    G4 P155
    M300 P149 S523
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S392
    G4 P148
    M300 P304 S0
    G4 P304
    M300 P148 S415
    G4 P148
    M300 P149 S0
    G4 P149
    M300 P154 S440
    G4 P154
    M300 P149 S698
    G4 P149
    M300 P149 S0
    G4 P149
    M300 P150 S698
    G4 P150
    M300 P154 S440
    G4 P154
    M300 P449 S0
    G4 P449
    M300 P154 S494
    G4 P154
    M300 P149 S698
    G4 P149
    M300 P150 S0
    G4 P150
    M300 P153 S698
    G4 P153
    M300 P104 S698
    G4 P104
    M300 P100 S0
    G4 P100
    M300 P100 S659
    G4 P100
    M300 P100 S0
    G4 P100
    M300 P97 S587
    G4 P97
    M300 P100 S0
    G4 P100
    M300 P154 S523
    G4 P154
    M300 P149 S330
    G4 P149
    M300 P150 S0
    G4 P150
    M300 P153 S330
    G4 P153
    M300 P155 S262
    G4 P155
    M300 P446 S0
    G4 P446
    M300 P154 S523
    G4 P154
    M300 P149 S523
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S523
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S523
    G4 P149
    M300 P148 S587
    G4 P148
    M300 P149 S0
    G4 P149
    M300 P154 S659
    G4 P154
    M300 P149 S523
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S440
    G4 P148
    M300 P154 S392
    G4 P154
    M300 P446 S0
    G4 P446
    M300 P154 S523
    G4 P154
    M300 P149 S523
    G4 P149
    M300 P148 S0
    G4 P148
    M300 P148 S523
    G4 P148
    M300 P154 S0
    G4 P154
    M300 P149 S523
    G4 P149
    M300 P148 S587
    G4 P148
    M300 P148 S659
    G4 P148
    M300 P1200 S0
    G4 P1200
    M300 P154 S523
    G4 P154
    M300 P149 S523
    G4 P149
    


  • suppose the specific midi file for comparison would be good, almost feels like there are gaps here and there.

    come think if it midi would allow chords (or whatever they call "parallell" notes), the duet would struggle replicating that and the conversion would have to make compromises

    duet2wifi
    rrf2.05.1 wifi 1.23
    paneldue 1.23.2

    video: https://streamable.com/yxzs87



  • Midi file is here: http://www.mariopiano.com/midi-sound-file-overworld-main-theme.html

    I selected the track 2. The thing is it works fine when previewed in the web tool; I guess it reads the gcode, and not the midi, as you can only preview after generating the file...



  • I've previously only tested shorter sequences, maybe 8-10 lines and the duet 2 with paneldue was always working, while the duet 3 with dwc skipped a lot of them.

    I'll poke the midi file when i'm bored and compare it.



  • i'm no beethoven but can't detect any difference between the streamable video and previewing track2 in the web tool (admittedly i cut the video short, but )



  • Yes, the preview in the webtool is OK; but once uploaded on the Duet, the music is not OK anymore... The



  • @bearer said in MIDI to G-Code:

    video: https://streamable.com/yxzs87

    play this side by side the preview and see if you can tell a difference? i didn't go to the step of making videos of both to sync the audio to say left and right. in any case it was mostly meant as a "this is what is sounds like on my paneldue"



  • It seems to works fine on your Duet; I can ear missing notes in this small part, on mine... I'll dig further tomorrow to see what notes make problems.

    Thanks.



  • no worries, it shouldn't make a difference but it was an 7i pandeldue (with a slightly MacGyver fix on the buzzer. can try an older regular 4.3 later, but with the same firmware i expect them to do the same thing.


  • Moderator

    I just tested your mario code on my older V2 PanelDue and it ran fine. I couldn't get it to play over DWC and can't disconnect the PanelDue without some dissaembly.

    Here's another version of the mario theme that's even faster that plays perfectly as well.

    MarioTheme.g



  • This file has even more missing notes... Looks like a com issue between the Duet and the PanelDue, don't you think? Is there a checksum used for this com? Some commands seem to be drop...



  • @fma said in MIDI to G-Code:

    Is there a checksum used for this com

    there is, could be a possible factor. shorter cable or lower baud rate are simple tests. i used the supplied 1 meter or so cable for the 7i test (i did twist the pairs a little just to tidy it up a little)

    also took a stab at recording the preview but computer failed badly at recording its own audio (at least using the win10/xbox game thing)


  • Moderator

    @fma Can you provide a video of how it's playing on your end?

    I am also using the 4 wire cable. It's about 1.2 to 1.5 meter long and I've braided the wires as it runs alongside some motor wiring.



  • Ok, I'll do that. My cable is 1m long, and I also twisted the wires. I will try to use a shielded cable.



  • @fma said in MIDI to G-Code:

    I will try to use a shielded cable.

    trying lower baud rate may be simpler as a test?



  • How do I do that?


  • Moderator



  • It does not seem to work: as soon as I change the baudrate, the PanelDue is unable to communicate with the Duet...


  • Moderator

    Did you change the baud rate at the PanelDue to match?



  • No :o/

    Now it communicates, but it still misses notes. I only tried at 9600bauds; I will try other speeds tomorrow.



  • @fma said in MIDI to G-Code:

    but it still misses notes

    if it stayed the same, no need to try other speeds, but if it missed more notes it might be too slow.


Log in to reply