int notes = musicScore.getTotalNotes();
MusicScoreNote scoreNote;
Note note;
JoinedNotes topJoinedNotes = null;
JoinedNotes bottomJoinedNotes = null;
Bar bar = null;
int channel;
int midiNote;
int measure;
for (int i = 0;i < notes;i ++)
{
scoreNote = musicScore.getNote(i);
if (scoreNote.isBar())
{
if (bar != null)
musicCanvas.addBar(bar);
bar = new Bar();
topJoinedNotes = bottomJoinedNotes = null;
}
else if (bar != null)
{
channel = scoreNote.getChannel();