public Note(NoteName name) { Note note = new Notes()[name]; _name = note.Name; _alias = note.Alias; _hertz = note.Hertz; _positions = note.Positions; }
public Note(NoteName name, Position position, double delay, double duration) : this(name) { //_name = name; //_hertz = hertz; _position = position; _delay = delay; _duration = duration; }
public Note(NoteName name, NoteName alias, Hz hertz, Position[] positions) : this(name, hertz, positions) { _alias = alias; }
public Note(NoteName name, Hz hertz, Position[] positions) { _name = name; _hertz = hertz; _positions = positions; }
public Note this[NoteName name] { get { Note note = null; //return Array.Find(_notes, x => x.Name.ToString() == name.ToString() || x.Alias.ToString() == name.ToString()); for (int i = 0; i < _notes.Length; i++) { if (name == _notes[i].Name || name == _notes[i].Alias) { note = _notes[i]; break; } } return note; } /*set { int index = Array.FindIndex(_notes, x => x.Name == name); _notes[index] = value; }*/ }
static public bool TryParse(string s, out NoteName result) { try { result = new NoteName(s); return true; } catch (Exception ex) { Logger.Log(ex); result = null; return false; } }