jxmorris12 / synthviz

visualize MIDI files from piano MIDI or audio
14 stars 2 forks source link

output video only show note on clef g (higher note) #1

Open sugizo opened 1 year ago

sugizo commented 1 year ago

the same midi, produce different result in the key pressed

result in synthviz there is no note in clef f pressed (lower note) image

expected should be with the note in clef f pressed for lower note image

best regards

sugizo commented 1 year ago

test1.mp4 from only clef g (higher note pressed)

https://github.com/jxmorris12/synthviz/assets/2418295/7653f68c-4f3f-447b-af83-dee7dca22b97

test2.mp4 from only clef f (lower notes pressed simultanously or chord)

https://github.com/jxmorris12/synthviz/assets/2418295/08948118-8743-4653-bc33-4da505266c04

test0.mp4 from complete midi (clef g (higher note pressed) and clef f (lower notes pressed simultanously or chord) ) this one is the problem report on first post, because lower notes not shown

https://github.com/jxmorris12/synthviz/assets/2418295/fd6227c4-ecf2-4e68-bd49-f9b6242aa989

p.s. everything is from same midi, just separate it using musescore then export it as separate midi then create it with synthviz

best regards

sugizo commented 1 year ago

perhaps the problem is in synthviz/main.py

    notes = [
        { "note": n.pitch, "start": n.start, "end": n.end}
        for n in midi_data.instruments[0].notes
    ]

midi_data.instruments[0].notes

it only load the first instrument

it should be

    notes = []

    for instrument in midi_data.instruments:
        for n in instrument.notes:
            notes.append({"note": n.pitch, "start": n.start, "end": n.end} )

i've modified a lot from your code, could share, if you interest

here is the result https://www.youtube.com/watch?v=aDR29fh6erY

best regards

jxmorris12 commented 1 year ago

ah thanks for investigating! Yes would love a pull request :) Or I can fix this eventually, but it could be a while.