Examples of JoinedNotes


Examples of music.ui.lib.JoinedNotes

      return;
   
    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();
        midiNote = scoreNote.getMidiNote();
        measure = scoreNote.getMeasure();
       
        note = null;
        if ((midiNote > 0) && (midiNote < 127) &&
          ((measure == 1) || (measure == 2) || (measure == 4) || (measure == 8) || (measure == 16)))
        {
          if (channel == 0)
          {
            note = new Note(0);
           
            if (scoreNote.getBeamToNextNote() != 0)
            {
              if (bottomJoinedNotes == null)
              {
                bottomJoinedNotes = new JoinedNotes();
                musicCanvas.addJoinedNotes(bottomJoinedNotes, true);
              }
             
              bottomJoinedNotes.addNote(note);
            }
            else if (bottomJoinedNotes != null)
            {
              bottomJoinedNotes.addNote(note);
              bottomJoinedNotes = null;
            }
            else
              musicCanvas.addNote(note, true);
          }
          else if (channel == 1)
          {
            note = new Note(1);
            if (scoreNote.getBeamToNextNote() != 0)
            {
              if (topJoinedNotes == null)
              {
                topJoinedNotes = new JoinedNotes();
                musicCanvas.addJoinedNotes(topJoinedNotes, false);
              }
             
              topJoinedNotes.addNote(note);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.