Making 8-bit Music From Scratch at the Commodore 64 BASIC Prompt
SCREEN() function in GWBASIC: http://www.antonis.de/qbebooks/gwbasman/screenf.html
SCREEN() function in QBasic: https://www.qbasic.net/en/reference/qb1 ... SCREEN.htm
You can use some form of PEEK() from screen memory, but that is more complicated than using a SCREEN() function. You still need to use machine code to get multitasking, i.e. being able to edit the music while it plays. You can use Stop-key (Ctrl+C or Ctrl+Break or Ctrl+ScrollLock) and CONT (continue) instead of multitasking.
I wrote this in GW-BASIC that is compatible with Linus Åkesson's tracker, but it has only one channel:
Code: Select all
10 GOTO 90 'TRACKER INSPIRED BY LTFKRYO'S FOR C64 EDITOR IN BASIC&MC.
20 N0=ASC("@") 'CODE IS PURE GWBASIC. BREAK EARLY USING CTRL+SCRLK!
30 FOR I=8 TO 79
40 N=SCREEN(7,I):C=SCREEN(4,I)
50 N$=CHR$(N):C$=CHR$(C):LOCATE 4,I:COLOR 15:PRINT C$;
60 IF N$<>" " AND N$<>":" THEN PLAY "N"+STR$(N-N0) ELSE PLAY "N0"
70 LOCATE 4,I:COLOR 7:PRINT C$;
80 NEXT:GOTO 30
90 COLOR 7:CLS:PRINT "RUN 20":PRINT TAB(8)"GWTRAKR":LIST 91- 'ONLY ONE CHANNEL
91 REM
92 REM +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---
93 REM : : : : : : : : : : : : : : : : : :
94 REM : : : : : : : : : : : : : : : : : :
95 REM AEFH:AEFH AEFH E:A E:C EECA AE H:HF EFH E A C A : : : :QSU:ZX
96 REM
97 REM B D G I K N P S U W Z
98 REM A C E F H J L M O Q R T V X Y