Exemplo n.º 1
0
    void Start()
    {
        microphonePitchTracker.MicProfile = settings.MicProfiles.Where(it => it.IsEnabled && it.IsConnected).FirstOrDefault();

        settings.SongEditorSettings.ObserveEveryValueChanged(it => it.RecordingSource)
        .Subscribe(OnNoteRecordingSourceChanged);
        songAudioPlayer.ObserveEveryValueChanged(it => it.IsPlaying)
        .Subscribe(OnSongIsPlayingChanged);

        microphonePitchTracker.PitchEventStream
        .Subscribe(pitchEvent => OnPitchDetected(pitchEvent));
    }
Exemplo n.º 2
0
    void Start()
    {
        micPitchTracker.MicProfile = settings.MicProfiles.Where(it => it.IsEnabled && it.IsConnected).FirstOrDefault();

        settings.SongEditorSettings.ObserveEveryValueChanged(it => it.RecordingSource).Subscribe(OnNoteRecordingSourceChanged);
        songAudioPlayer.ObserveEveryValueChanged(it => it.IsPlaying).Subscribe(OnSongIsPlayingChanged);
        songAudioPlayer.JumpBackInSongEventStream.Subscribe(OnJumpedBackInSong);
        songAudioPlayer.PlaybackStartedEventStream.Subscribe(OnPlaybackStarted);
        songAudioPlayer.PlaybackStoppedEventStream.Subscribe(OnPlaybackStopped);

        micPitchTracker.PitchEventStream.Subscribe(pitchEvent => OnPitchDetected(pitchEvent));
        if (settings.SongEditorSettings.RecordingSource == ESongEditorRecordingSource.Microphone)
        {
            micPitchTracker.MicSampleRecorder.StartRecording();
        }
    }