Пример #1
0
        public MusicPlayer(Song song)
        {
            _song = song;

            _chordQueue = new Queue<Chord>(_song.Chords.OrderBy(chord => chord.StartBeat));
            _notesBeingPlayed = new List<PlayedNote>();
        }
Пример #2
0
        private void PlayPauseBtn_Click(object sender, RoutedEventArgs e)
        {
            // Actually just saves it at the moment.
            double songDurationInBeats = double.Parse(SongLengthTB.Text) / double.Parse(BeatDurationTB.Text);
            List<Chord> chords = _noteGroups.Where((x, index) => _groupsToDraw[index]).SelectMany(ng => ng.Chords).ToList();

            Song song = new Song(chords,
                                 _currentScale.Length,
                                 float.Parse(MinNoteDurationTB.Text),
                                 (float)songDurationInBeats);
            WavWriter.WriteSongToWav(song, double.Parse(BeatDurationTB.Text), _ruleString + ((Label)KeyComboBox.SelectedItem).Content);
        }