Table of Contents

ugBASIC User Manual

MUSIC

SYNTAX

   MUSIC [LOOP] music [format]
   MUSIC music [format] [LOOP]

PURPOSE

The MUSIC command starts a piece of music from the music variable. This music will be played independently of your program, without affecting it in the slightest.

Normally, it's possible to store several complete arrangements. Each composition is assigned its own individual music variable.

The music system is intelligent, and will automatically suspend your music for the duration of any subsequent sound effects on the current channel. When the sound has finished, your tune will be restarted from its previous position.

The command accepts an additional keyword, LOOP, which allows you to indicate that the piece of music must be played without ever ending playback: ugBASIC will make it start again from the beginning, once playback has finished.

Finally, the command accepts the indication of the format in which the music is stored in the variable. This specification is necessary only if the audio file was not loaded by the LOAD MUSIC command. The LOAD MUSIC command takes care of converting one of the supported formats into the internal (IAF) ugBASIC format. However, ugBASIC can play formats compatible with your audio hardware. In this case, by specifying the format in which the data is prepared, it is possible to follow up on this request.

Each target has a specific list of supported audio formats.

EXAMPLE

  MUSIC fugue
  MUSIC backmusic LOOP
  MUSIC soundtrack PSG

ABBREVIATION

 Mus

AVAILABLE ON

ANY PROBLEM?

If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please open an issue for this keyword on GitHub. Thank you!

POWERED BY