APPLICATIONSDIVERS ★ RSX BACKGROUND MUSIC (YOUR COMPUTER) ★

RSX Background Music (Your Computer)Applications Divers
★ Ce texte vous est présenté dans sa version originale ★ 
 ★ This text is presented to you in its original version ★ 
 ★ Este texto se presenta en su versión original ★ 
 ★ Dieser Text wird in seiner Originalfassung präsentiert ★ 

Many popular video games nowadays have music ringing in the background during play. The Amstrad CPC-464 computer has some excellent facilities for, sound generation but attempting to add background music to a Basic program using the Every instruction generally gives poor results with the game being slowed down considerably.

The assembly language program presented here allows interrupt driven background music to be added to Basic programs through the use of some simple RSX-Resident System extension-commands. It also allows the us of one, two or all three sound channels.

The following commands are provided. Note that each one must be preceded by a vertical bar (Shift ‘@') symbol. A parameter enclosed in square brackets is optional.

(1). MUSICON ,t, a1 (,a2) (,a3) — turn on music, where t is the tempo (the length in fiftieths of a second, of the shortest available note) and al,a2 and a3 are two less than the addresses of the data for channels 1,2 and 3 respectively.

(2). MUSICOFF — turn off music.

(3). VOLUME v, 1 (,v2) (,v3) — set for channel (s), where vl, v2 and v3 are the respective amplitudes of channels 1,2 and 3.

(4). PAUSE — stop playing music.

(5). CONTINUE — continue playing music after pausing.

To enter the program, you can either enter and assemble the source code — listing 1 — using an assembler. I have used Devpac but any good one should do). Or if you do not have an assembler I have provided a Basic loader program — listing 2 — which should be typed in and Run to store the code in memory.

Once the code is in memory, it can be saved on tape (or disc) using the command SAVE “MUSIC”, B,&A000,&2A0 (enter)

To make the computer recognise the new commands the instruction CALL &A1C5 should be given. At this point the program can be tested by entering and Running listing 3 which tells the computer to repeatedly play all the notes available until a Musicoff command is given.

Any program using the extension commands should include the following line to load the code and log-on the commands MEMORY &9FFF: LOAD “!MUSIC”:CALL&A1C5

The data for the music to be played through a channel is arranged as follows:-byte 1 —duration of note 1 (1-127), byte 2 (upper nybble) — note 1 octave (0-5), byte 2 (lower nybble) — note 1 number (0-11), byte 3 — duration of note 2, byte 4 (upper nybble) — note 2 octave, byte 4 (lower nybble) — note 2 number....... , 0

Once the music playing routine discovers the 0 in place of a duration number it then loops back to the beginning again. If bit 7 of the duration number is

set (just add 128), then the note is a rest otherwise 1 is the shortest note available, 2 is twic as long, 3 is three times as long etc. The octaves available correspond to octaves —2 to + 3 shown in the CPC-464 manual appendix VII and in the firmware manual appendix VIII. e.g. bytes 2,52 define a note of duration 2, octave 3, note 4; 129, 0 define a rest of duration 1. A simple formula for working ot the second byte of a note is therefore:

byte stored = 16*octave + note

If you do not wish to type in the program I can supply copies of it on cassette for £4 each. Please include a 24 pence SAE. Write to: M.B.L. Dunlop, 19 Droridge, Dartington, Totnes, Devon, TQ9 6JG.

YR

★ PUBLISHERS: SINTAX , YOUR COMPUTER
★ YEAR: 1985
★ CONFIG: 64K + AMSDOS
★ LANGUAGE:
★ LiCENCE: LISTING
★ COLLECTION: YOUR COMPUTER 1985
★ AUTHOR: Myles DUNLOP
 

★ AMSTRAD CPC ★ DOWNLOAD ★

Type-in/Listings:
» RSX-Background  Music    (Your  Computer)    ENGLISH    LISTINGDATE: 2023-09-11
DL: 60
TYPE: PDF
SiZE: 2203Ko
NOTE: 4 pages/PDFlib v1.6

» RSX-Background  Music    SPANISHDATE: 2014-08-26
DL: 253
TYPE: ZIP
SiZE: 5Ko
NOTE: Extended DSK/40 Cyls
.HFE: Χ

★ AMSTRAD CPC ★ A voir aussi sur CPCrulez , les sujets suivants pourront vous intéresser...

Lien(s):
» Applications » RSX : Sound (CPC Magazin)
» Applications » RSX Speech Generator (Popular Computing Weekly)
» Applications » RSX Sound (Schneider Magazin)
» Applications » Sound FX RSX (Popular Computing Weekly)
» Applications » RSX-Voz
» Applications » Music (Amstrad Magazine)
Je participe au site:
» Pour ce titre nous ne disposons de fichier executable sur CPC (Dump, Saisie du listing) , alors si vous avez ça dans vos cartons ou vous désirez usé vos petit doigts boudinés sur votre clavier faites le nous savoir.
» Vous avez des infos personnel ?
» Vous avez remarqué une erreur dans ce texte ?
» Aidez-nous à améliorer cette page : en nous contactant via le forum ou par email.

CPCrulez[Content Management System] v8.7-desktop/c
Page créée en 344 millisecondes et consultée 1507 fois

L'Amstrad CPC est une machine 8 bits à base d'un Z80 à 4MHz. Le premier de la gamme fut le CPC 464 en 1984, équipé d'un lecteur de cassettes intégré il se plaçait en concurrent  du Commodore C64 beaucoup plus compliqué à utiliser et plus cher. Ce fut un réel succès et sorti cette même années le CPC 664 équipé d'un lecteur de disquettes trois pouces intégré. Sa vie fut de courte durée puisqu'en 1985 il fut remplacé par le CPC 6128 qui était plus compact, plus soigné et surtout qui avait 128Ko de RAM au lieu de 64Ko.