X Tutup

A downloadable tool

 8bit MUSICERDSK : Matteo Trevisan, Copilot : Free Download, Borrow, and Streaming : Internet Archive

What this program is for

This 10‑line Applesoft BASIC program is a tiny 8‑bit music composer for the Apple II.

You type a sequence of digits (0–9), and the computer turns each digit into a note 

played through the Apple II’s internal speaker.

Each number controls:

the pitch (higher number → higher tone)

the duration (higher number → longer beep)

It’s essentially a simple monophonic sequencer: you “compose” by typing numbers,

and the Apple II plays your melody.

Code

10 PRINT CHR$(4);"PR#0":PRINT CHR$(21);"8BIT MUSICER":DIM N$(1)
20 PRINT "SEQ (0-9):";:INPUT N$
30 L=LEN(N$):IF L=0 THEN 20
40 FOR I=1 TO L:Q=ASC(MID$(N$,I,1))-48
50 F=200+Q*80:D=10+Q*3
60 FOR T=1 TO D:POKE -16336,0:POKE -16336,1:NEXT
70 NEXT
80 PRINT "AGAIN? (Y/N)";:GET A$:IF A$="Y" THEN 20
90 PRINT "BYE"

Line per line explanation

Line 10

Codice

PRINT CHR$(4);"PR#0":PRINT CHR$(21);"8BIT MUSICER":DIM N$(1)

Switches output to the screen (PR#0)

Clears inverse video (CHR$(21))

Prints the title “8BIT MUSICER”

Allocates a string array N$ (must be done only once)

🔍 Line 20

Codice

PRINT "SEQ (0-9):";:INPUT N$

Asks the user to type a sequence of digits

Stores the sequence in the string N$

🔍 Line 30

Codice

L=LEN(N$):IF L=0 THEN 20

Gets the length of the sequence

If the user typed nothing, ask again

🔍 Line 40

Codice

FOR I=1 TO L:Q=ASC(MID$(N$,I,1))-48

Loops through each character of the sequence

Converts the character "0"–"9" into a number 0–9

(ASC("0") = 48, so subtracting 48 gives the digit)

 Line 50

Codice

F=200+Q*80:D=10+Q*3

Calculates the frequency of the note

Calculates the duration

Higher digits → higher pitch and longer note

 Line 60

Codice

FOR T=1 TO D:POKE -16336,0:POKE -16336,1:NEXT

Generates the actual sound

Toggling address -16336 turns the Apple II speaker on/off

Repeating this loop produces a tone

 Line 70

Codice

NEXT

Ends the note loop and moves to the next digit

 Line 80

Codice

PRINT "AGAIN? (Y/N)";:GET A$:IF A$="Y" THEN 20

Asks if you want to compose another melody

If yes, jumps back to line 20 (input)

 Line 90

Codice

PRINT "BYE":END

Ends the program cleanly

Published 2 days ago
StatusReleased
CategoryTool
AuthorBASIC 10Liner

Download

Download
8bit MUSICER APPLE IIE BY MATTEO TREvISAN TOOLKITMAN.txt 2.1 kB
Download
8bitMUSICERDSK 140 kB

Leave a comment

Log in with itch.io to leave a comment.

X Tutup