Orchestra ========= Compatible motors powered by Talon FX have the ability to produce audible output through the ``MusicTone`` (`Java `__, `C++ `__, `Python `__) control request. The Orchestra API extends this ability and orchestrates multiple motors to play music. To get started, construct an ``Orchestra`` (`Java `__, `C++ `__, `Python `__) object with an instrument and CHRP. Ensure that ``addInstrument()`` and ``loadMusic()`` are not called periodically, as they are blocking functions. .. note:: For information on converting MIDI to CHRP, see :doc:`/docs/tuner/tools/chrp-converter`. .. tab-set:: .. tab-item:: Java :sync: java .. code-block:: java Orchestra m_orchestra = new Orchestra(); // Add a single device to the orchestra m_orchestra.addInstrument(m_motor); // Attempt to load the chrp var status = m_orchestra.loadMusic("track.chrp"); if (!status.isOK()) { // log error } .. tab-item:: C++ :sync: cpp .. code-block:: cpp Orchestra m_orchestra; // Add a single device to the orchestra m_orchestra.addInstrument(m_motor); // Attempt to load the chrp auto status = m_orchestra.loadMusic("track.chrp"); if (!status.IsOK()) { // log error } .. tab-item:: Python :sync: python .. code-block:: python self.orchestra = Orchestra() self.orchestra.add_instrument(self.motor); status = self.orchestra.load_music("track.chrp") if not status.is_ok(): # log error Once the track has been loaded, ``play/pause/stop`` can be used to manage the track. ``play()`` only needs to be called once. .. tab-set:: .. tab-item:: Java :sync: java .. code-block:: java m_orchestra.play(); .. tab-item:: C++ :sync: cpp .. code-block:: cpp m_orchestra.Play(); .. tab-item:: Python :sync: python .. code-block:: python self.orchestra.play() Playback While Disabled (FRC) ----------------------------- Playback can be safely enabled during robot disable by enabling the ``Allow Music Dur Disable`` (`Java `__, `C++ `__, `Python `__) config.