Class OrchestraSubsystem

java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
robot.subsystems.OrchestraSubsystem
All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable, edu.wpi.first.wpilibj2.command.Subsystem

public class OrchestraSubsystem extends edu.wpi.first.wpilibj2.command.SubsystemBase
Orchestra™
  • Field Details

  • Method Details

    • loadSong

      public static void loadSong(String name, int tracks, CustomTalonFX... motors)
      Loads a song to be played later with playSong(String).

      Files for the song should be located at deploy/chirp/<name>_<track>.chrp

      Parameters:
      name - The name of the song to load.
      tracks - The number of tracks the song has.
      motors - The motors that will be used to play the song. There should be at least as many motors as there are tracks. Motors will be distributed as evenly as possible between the tracks, filling all tracks first, then going back to add multiple motors to the same track (you can use nulls to skip over tracks when assigning motors).
    • playSong

      public static boolean playSong(String name)
      Play a song that was already loaded with loadSong(String, int, CustomTalonFX...).
      Parameters:
      name - The name of the song to play.
      Returns:
      Whether the song was successfully played.
    • stopSong

      public static boolean stopSong(String name)
      Stop a song.
      Parameters:
      name - The name of the song to stop.
      Returns:
      Whether the song was successfully stopped.
    • stopAll

      public static boolean stopAll()
      Stop all songs.
      Returns:
      Whether all songs were successfully stopped.
    • c_loadAndPlaySong

      public static edu.wpi.first.wpilibj2.command.Command c_loadAndPlaySong(String name, int tracks, CustomTalonFX... motors)
      Loads a song and then returns a command to play it. See loadSong(String, int, CustomTalonFX...).
      Returns:
      A Command to play the song.