Package jpianotrain.staff

Examples of jpianotrain.staff.Note


              ApplicationContext.getInstance().getActiveMidiChannel(),
              sm.getData1(), sm.getData2());
        } catch (Exception ex) {
        }
        if (message.getStatus()==ShortMessage.NOTE_ON) {
          Note n=new Note(sm.getData1());
          NoteDispatcher.getInstance().notePlayed(n);
        }
      }
      MidiThread.getInstance().enqueueEvent(message);
    } catch (Exception ex) {
View Full Code Here


    Chord c=null;
    int len=notes.length;
    List<Note> noteList=new ArrayList<Note>();
    for (int i=0;i<len;i++) {
      if (notes[i].isEnabled()) {
        noteList.add(new Note((NoteName)notes[i].getSelectedItem()));
      }
    }

    if (noteList.size()>0) {
      c=new Chord(noteList);
View Full Code Here

   */
  public Collection<Note> getNotes() {
    List<Note> result=new ArrayList<Note>();
    for (JComboBox box:notes) {
      if (box.isEnabled()) {
        result.add(new Note((NoteName)box.getSelectedItem()));
      }
    }
    return Collections.unmodifiableCollection(result);
  }
View Full Code Here

    Object src=e.getSource();
    if (src==playMidiItem) {
      int rCount=scaleTable.getRowCount();
      Note[] n=new Note[rCount];
      int pit=0;
      Note nt;
      for (int i=0;i<rCount;i++) {
        Object o=scaleTable.getValueAt(i, selectedColumn);
        log.debug("Playing: "+o);
        nt=(Note)o;
        if (nt.getPitch()>=pit) {
          pit=nt.getPitch();
        } else {
          nt.transpose(12);
        }
        n[i]=nt;
      }
      MidiThread mt=MidiThread.getInstance();
      if (mt==null) {
View Full Code Here

                      boolean isSelected,
                      boolean hasFocus,
                      int row,
                      int column) {
    if (val instanceof Note) {
      Note n=(Note)val;
      return super.getTableCellRendererComponent(table,
                        n.getName(),
                        isSelected,
                        hasFocus,
                        row,
                        column);
    } else if (val instanceof Chord) {
View Full Code Here

TOP

Related Classes of jpianotrain.staff.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.