public static SongNote ConvertXmlNoteToSongNote(double noteTime, Note xmlNote) { var songNote = new SongNote(); songNote.NoteTime = noteTime; songNote.PitchId = (xmlNote.Pitch.Octave + 1) * 12 + XmlMusicHelper.GetMidiIdOffsetFromC(xmlNote); songNote.Velocity = 100; songNote.Duration = xmlNote.Duration; return(songNote); }
private int CalculateNoteDuration(SongNote songNote) { return((int)songNote.Duration * 1000 * 60 / _song.Tempo); }