Menu

#28 Reading MIDI into a Score Error

open
nobody
midi io (11)
5
2013-02-07
2006-03-20
Anonymous
No

Hi,

Reading a MIDI file with system data prior to actual
notes causes first Phrase's start time to be shifted
from 0 to some large number.

The following code demostrates the bug, in conjunction
with the MIDI attachment.

Note that removing the system data from the MIDI file,
"fixes" the problem.

----

import jm.JMC;
import jm.music.data.*;
import jm.util.*;
import jm.midi.*;
import jm.music.tools.*;

public class Writer implements JMC
{
public static void main(String []args)throws
java.io.FileNotFoundException
{
//path to folder including midi
String inputMIDIFolder = "C:/Documents and
Settings/user/midiTestFiles/";
//name of midi
String filename = "bwv772.mid";

//make score
Score score=new Score();
//read midifile into score
jm.util.Read.midi(score,inputMIDIFolder+filename);
//write new midi from score
Write.midi(score,"bwv772_Reconstructed.mid");
}
}

Discussion

  • Nobody/Anonymous

    MIDI file that demonstrates bug.

     
  • Nobody/Anonymous

    Logged In: NO

    How I can fix the problem?

    What is "system data of a midi file"?

    Thank you very much.

     

Log in to post a comment.

MongoDB Logo MongoDB