Transformer: Getting generated accompaniment in MIDI form without original notes?

87 views
Skip to first unread message

Dan Tenenbaum

unread,
Apr 30, 2021, 2:51:17 PM4/30/21
to Magenta Discuss
Hi,

I was running the Transformer IPython Notebook to auto-generate some accompaniment for a piece of music in a MIDI file.

The notebook lets me download the accompaniment as an audio file or a MIDI file. In both cases, the original notes are included in the file.

I would like to be able to download a MIDI file containing just the accompaniment. For one thing, I have the original notes already, and for another, I would like to process the accompaniment separately (perhaps have it play on a separate software instrument).

I tried to create a simple Python script to remove notes that are in the original from the original + accompaniment MIDI file, but it seems the process of creating the accompaniment has changed note durations slightly so it is not straightforward to identify notes that are in the original. Even if both files are quantized this remains the case.

Is it possible to generate the accompaniment without the original notes? Or the accompaniment could be written to a separate MIDI track.

Also, I notice that if I bring both the original track, and the generated accompaniment track, into a DAW and play them at the same time, they are not exactly in sync. This is true whether or not I import tempo information from the tracks (both tracks have the same tempo). Is it possible for the timing of the generated output to precisely match that of the original? Without that, the feature I am asking for will not really work.

Thanks in advance.

Ian Simon

unread,
May 1, 2021, 12:14:21 AM5/1/21
to Dan Tenenbaum, Magenta Discuss
Unfortunately for your purposes, the model is trained to generate a full piano performance (melody + accompaniment) from a simplified representation of the melody.  What you're doing now to programmatically identify the melody notes in the full performance is probably the best thing to do, even if imperfect.

Note that the model is also generating properties of the melody not given as conditioning e.g. the velocities of the notes.

-Ian

--
Magenta project: magenta.tensorflow.org
To post to this group, send email to magenta...@tensorflow.org
To unsubscribe from this group, send email to magenta-discu...@tensorflow.org
---
To unsubscribe from this group and stop receiving emails from it, send an email to magenta-discu...@tensorflow.org.
Reply all
Reply to author
Forward
0 new messages