@Test public void testNoteNameToNote(){ NoteDescriptor v1 = NoteDescriptors.PIANO.getNoteByName("A0"); assertNote(v1, "A0", 21, 1, 27.5f); assertEquals("a", v1.note.name); }
public NoteDescriptor getNoteByName(String name) { for(NoteDescriptor v: descritors) if(v!=null && v.name.equals(name)) return v; return null; }
NoteDescriptors { public NoteDescriptor getNoteByName(String name) { for(NoteDescriptor v: descritors) if(v!=null && v.name.equals(name)) return v; return null; } }
NoteDescriptors { public NoteDescriptor getNoteByName(String name) { for(NoteDescriptor v: descritors) if(v!=null && v.name.equals(name)) return v; return null; } NoteDescriptors(NoteDescriptor[] descritors); }
NoteDescriptors { public NoteDescriptor getNoteByName(String name) { for(NoteDescriptor v: descritors) if(v!=null && v.name.equals(name)) return v; return null; } NoteDescriptors(NoteDescriptor[] descritors); NoteDescriptor getNoteByKey(int keyId); NoteDescriptor getNoteByMidi(int i); NoteDescriptor getNoteByName(String name); static float name2freq(String noteName); static int name2midi(String noteName); }
NoteDescriptors { public NoteDescriptor getNoteByName(String name) { for(NoteDescriptor v: descritors) if(v!=null && v.name.equals(name)) return v; return null; } NoteDescriptors(NoteDescriptor[] descritors); NoteDescriptor getNoteByKey(int keyId); NoteDescriptor getNoteByMidi(int i); NoteDescriptor getNoteByName(String name); static float name2freq(String noteName); static int name2midi(String noteName); static NoteDescriptor[] PIANO_KEYS; static NoteDescriptors PIANO; }