Package music.ui.lib

Examples of music.ui.lib.Note


    if (musicScore == null)
      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);
            }
            else if (topJoinedNotes != null)
            {
              topJoinedNotes.addNote(note);
              topJoinedNotes = null;
            }
            else
              musicCanvas.addNote(note, false);
          }
          note.setMidiNote(midiNote, measure, 0);
        }
      }
    }
    if (bar != null)
      musicCanvas.addBar(bar);
View Full Code Here


 
  public void addNote(int note, int randomNo)
  {
    if (note > 62)
    {
      Note n = new Note(1);
      n.setMidiNote(note, 4, randomNo);
     
      musicCanvas.addNote(n, false);
    }
    else if (note > 55)
    {
     
      if (randomNo < 1)
      {
        Note n = new Note(0);
        n.setMidiNote(note, 4, randomNo);

        musicCanvas.addNote(n, true);
       
      }
      else
      {
        Note n = new Note(1);
        n.setMidiNote(note, 4, randomNo);
       
        musicCanvas.addNote(n, false);
      }
    }
    else if (note >= 36)
    {
      Note n = new Note(0);
      n.setMidiNote(note, 4, randomNo);

      musicCanvas.addNote(n, true);
    }
   
    invalidate();
View Full Code Here

    if (noteType > 4)
    {
      timingCurve.setEigthDisplay(true);
    }
   
    Note n = new Note(1);
    n.setMidiNote(note, noteType, randomNo);

    if (bar == null)
      musicCanvas.addNote(n, false);
    else
      bar.addNote(n);
View Full Code Here

TOP

Related Classes of music.ui.lib.Note

Copyright © 2018 www.massapicom. 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.