TopDown Engine  v4.2
MoreMountains.Feedbacks.MMSoundSequencer Class Reference

A MMSequencer with ready made slots to play sounds More...

Inheritance diagram for MoreMountains.Feedbacks.MMSoundSequencer:
MoreMountains.Feedbacks.MMSequencer

Public Member Functions

override void PlayTrackEvent (int index)
 When playing our event for control, we play our audiosource More...
 
override void EditorMaintenance ()
 When looking for changes we make sure we have enough sounds in our array More...
 
virtual void SetupSounds ()
 Ensures the array is always the right length More...
 
- Public Member Functions inherited from MoreMountains.Feedbacks.MMSequencer
virtual void ToggleSequence ()
 Plays or stops the sequence based on its current state More...
 
virtual void PlaySequence ()
 Starts playing the sequence More...
 
virtual void StopSequence ()
 Stops the playback of the sequence More...
 
virtual void ClearSequence ()
 Clears the contents of the sequence More...
 
virtual void PlayBeat ()
 Triggers events on the beat if needed More...
 
virtual void ToggleActive (int trackIndex)
 Turns a sequence track active (will play its notes) or inactive (won't do it) More...
 
virtual void ToggleStep (int stepIndex)
 Toggles a whole step column, turning all its notes active or inactive More...
 
virtual void IncrementLength ()
 Adds one column at the end of the sequence More...
 
virtual void DecrementLength ()
 Removes the last column of the sequence More...
 
virtual void UpdateTimestampsToMatchNewBPM ()
 Parses the sequence contents and updates timestamps to match the new BPM More...
 
virtual void ApplySequencerLengthToSequence ()
 Rebuilds the sequence properties to match length and track count - will destroy contents More...
 
virtual void SetupTrackEvents ()
 Adds or rebuilds to the event list More...
 

Public Attributes

List< AudioClip > Sounds
 the list of audio clips to play (one per track) More...
 
- Public Attributes inherited from MoreMountains.Feedbacks.MMSequencer
MMSequence Sequence
 the sequence to design on or to play More...
 
int BPM = 160
 the intended BPM for playback and design More...
 
int SequencerLength = 8
 the number of notes in the sequence More...
 
TimeScales TimeScale = TimeScales.Scaled
 the timescale on which this sequencer should play More...
 
bool Loop = true
 whether the sequence should loop or not when played back More...
 
bool RandomSequence = false
 if this is true the sequence will play in random order More...
 
bool PlayOnStart = false
 whether that sequencer should start playing on application start More...
 
AudioClip MetronomeSound
 a sound to play every beat More...
 
float MetronomeVolume = 0.2f
 the volume of the metronome sound More...
 
List< UnityEvent > TrackEvents
 a list of events to play every time an active beat is found on each track (one event per track) More...
 
bool Playing = false
 true if the sequencer is playing right now More...
 
bool PlayedOnce = false
 true if the sequencer has been played once More...
 
bool BeatThisFrame = false
 true if a perfect beat was found this frame More...
 
int LastBeatIndex = 0
 the index of the last played bit (our position in the playing sequence) More...
 
float InternalTime => TimeScale == TimeScales.Scaled ? Time.time : Time.unscaledTime
 
int LastBPM = -1
 
int LastTracksCount = -1
 
int LastSequencerLength = -1
 
MMSequence LastSequence
 
int CurrentSequenceIndex = 0
 
float LastBeatTimestamp = 0f
 

Protected Member Functions

override void Initialization ()
 On Initialization we create our audiosources to play later More...
 
override void OnBeat ()
 On beat we play our audio sources More...
 
- Protected Member Functions inherited from MoreMountains.Feedbacks.MMSequencer
virtual void Start ()
 On Start we initialize our sequencer More...
 
virtual void Update ()
 On update we handle our beat More...
 
virtual void HandleBeat ()
 Determines if we're on a beat, and plays the beat if needed More...
 
virtual void PlayMetronomeSound ()
 Plays the sound of the metronome More...
 

Protected Attributes

List< AudioSource > _audioSources
 
- Protected Attributes inherited from MoreMountains.Feedbacks.MMSequencer
float _beatInterval
 
AudioSource _beatSoundAudiosource
 

Additional Inherited Members

- Public Types inherited from MoreMountains.Feedbacks.MMSequencer
enum  TimeScales { TimeScales.Scaled, TimeScales.Unscaled }
 

Detailed Description

A MMSequencer with ready made slots to play sounds

Member Function Documentation

◆ EditorMaintenance()

override void MoreMountains.Feedbacks.MMSoundSequencer.EditorMaintenance ( )
virtual

When looking for changes we make sure we have enough sounds in our array

Reimplemented from MoreMountains.Feedbacks.MMSequencer.

◆ Initialization()

override void MoreMountains.Feedbacks.MMSoundSequencer.Initialization ( )
protectedvirtual

On Initialization we create our audiosources to play later

Reimplemented from MoreMountains.Feedbacks.MMSequencer.

◆ OnBeat()

override void MoreMountains.Feedbacks.MMSoundSequencer.OnBeat ( )
protectedvirtual

On beat we play our audio sources

Reimplemented from MoreMountains.Feedbacks.MMSequencer.

◆ PlayTrackEvent()

override void MoreMountains.Feedbacks.MMSoundSequencer.PlayTrackEvent ( int  index)
virtual

When playing our event for control, we play our audiosource

Parameters
index

Reimplemented from MoreMountains.Feedbacks.MMSequencer.

◆ SetupSounds()

virtual void MoreMountains.Feedbacks.MMSoundSequencer.SetupSounds ( )
virtual

Ensures the array is always the right length

Member Data Documentation

◆ _audioSources

List<AudioSource> MoreMountains.Feedbacks.MMSoundSequencer._audioSources
protected

◆ Sounds

List<AudioClip> MoreMountains.Feedbacks.MMSoundSequencer.Sounds

the list of audio clips to play (one per track)


The documentation for this class was generated from the following file: