Orchestra Class

Orchestra is used to play music through devices. It uses a "Chirp" (.chrp) music file that can be generated using Phoenix Tuner.Chirp files are generated from standard MIDI files.

Any Chirp file located in the src/main/deploy directory of your FRC project will automatically be copied to the roboRIO on code deploy.

The robot must be enabled to play music. Additionally, devices playing in Orchestra will not run any other control requests while Orchestra is running. Users can Pause or Stop the Orchestra to re-enable device control.

Each device can only play a single track within the music file. For multi-track files, multiple devices are needed. Devices can be added with an explicit track number. Otherwise, the first track will be played through the first Talon FX added, the second track will be played through the second Talon FX added, etc.

To use Orchestra:

Both of these can also be done in the Orchestra constructor.

Once ready, the Orchestra can be controlled using Play/Pause/Stop. New music files can be loaded at any time.

Definition

Namespace: CTRE.Phoenix6
Assembly: Phoenix6 (in Phoenix6.dll) Version: 1.0.0
C#
public class Orchestra
Inheritance
Object    Orchestra

Constructors

Orchestra Constructor for a new Orchestra.
Orchestra(ParentDevice) Constructor for a new Orchestra using the given instruments.
Orchestra(String) Constructor for a new Orchestra using the given Chirp file.
Orchestra(String, ParentDevice) Constructor for a new Orchestra using the given instruments and chirp file.

Properties

CurrentTime Gets the current timestamp of the music file in seconds. The timestamp will reset to zero whenever LoadMusic(String) or Stop is called.

If IsPlaying returns false, this method can be used to determine if the music is stopped or paused.

Methods

AddInstrument(ParentDevice) Adds an instrument to the orchestra
AddInstrument(ParentDevice, UInt16) Adds an instrument to the given track.
ClearInstruments Clears all instruments in the orchestra.
Close Closes this Orchestra Instance
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
IsPlaying Gets whether the current track is actively playing.
LoadMusic Loads a chirp file at the specified file path

If the Chirp file is inside your "src/main/deploy" directory, it will be automatically deployed to a default directory on the roboRIO when you deploy code.For these files, the name and file extension is sufficient.

A Chirp file can be created from a MIDI file using Phoenix Tuner.

MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Pause Pauses the loaded music file. This saves the current position in the track so it can be resumed later
Play Plays the loaded music file. If the player is paused, this will resume the orchestra
Stop Stops the loaded music file. This resets the current position in the track to the start
ToStringReturns a string that represents the current object.
(Inherited from Object)

See Also