Page 1 of 2

A little musical demo to show off the R42 BASIC additions

Posted: Wed Mar 08, 2023 12:31 am
by MooingLemur
Copy and paste into emulator version R42 should work :)

Code: Select all

100 FMINIT
110 FOR I=1 TO 7
120 FMINST I,50
130 NEXT
135 FMINST 0,24
137 DATA 0,"V0RV0RV0RV0RV0R"
140 DATA 0,"O3G>CE",4,"L16T90O3","CDEG>",4,"O7","C<GED"
150 DATA 0,"O3A>CE",4,"O2","AB>CE",4,"O6","AEC<B"
160 DATA 0,"O3G>CE",4,"O3","CDEG>",4,"O7","C<GED"
170 DATA 0,"O3A>CE",4,"O2","AB>CE",4,"O6","AEC<B"
180 DATA 0,"O3A>CF",4,"O2","FGA>C",4,"O6","FC<AG"
190 DATA 0,"O3B>DG",4,"O2","GAB>D",4,"O6","GD<BA"
200 DATA 0,"O3A-C>G",4,"O2","A->CE-G",4,"O6","A-GE-C<"
210 DATA 0,"O3B->FG",4,"O2","B->DFA",4,"O6","B-AFD<"
220 DATA 0,"V48RV48RV48RV63RV63R"
290 DATA -1
300 READ L
310 IF L<0 THEN GOTO 380
313 IF L>0 THEN GOTO 320
315 READ A$
317 FMCHORD 1,A$
319 GOTO 300
320 READ A$,B$
330 FMPLAY 0,A$
340 FOR I=1 TO L
345 FMDRUM 4,35
347 IF I=2 OR I=4 THEN FMDRUM 5,39
350 FMPLAY 0,B$
360 NEXT
370 GOTO 300
380 RESTORE 140
385 FMDRUM 5,46
390 GOTO 300

Re: A little musical demo to show off the R42 BASIC additions

Posted: Wed Mar 08, 2023 12:45 am
by StephenHorn
May you always walk in the light of the Crystal.

Re: A little musical demo to show off the R42 BASIC additions

Posted: Wed Mar 08, 2023 12:45 am
by grml
I had a bunch of fun with FMDRUM in a loop in BASIC. You can create some really cool sound effects by triggering a number of those sounds really fast. Some real nice gunshot sound effects, even with a kind of reverb effect!

How are those percussions created? They do sound like samples.

Re: A little musical demo to show off the R42 BASIC additions

Posted: Wed Mar 08, 2023 1:01 am
by MooingLemur
grml wrote: Wed Mar 08, 2023 12:45 am
How are those percussions created? They do sound like samples.
They are all simple YM2151 patches. One of the requirements for how the music commands worked in BASIC was that all the sounds would be triggered without requiring the CPU to control any envelopes or macros while the note is playing. The patch is loaded, and the X16 issues a key on event. No further register writes are needed.

This means making some types of instruments sound realistic is nearly impossible to pull off, but I think about 95% of them are at least passable.

Re: A little musical demo to show off the R42 BASIC additions

Posted: Wed Mar 08, 2023 5:14 pm
by desertfish
Oh , wow, this is the first time I've heard those new sound basic commands . Stellar job!!

Re: A little musical demo to show off the R42 BASIC additions

Posted: Sat Mar 11, 2023 7:00 pm
by Ed Minchau
That's wild. In BASIC yet. Great addition.

Re: A little musical demo to show off the R42 BASIC additions

Posted: Fri Mar 17, 2023 3:08 am
by EbonHawk
Nice!! :o

Re: A little musical demo to show off the R42 BASIC additions

Posted: Fri Apr 07, 2023 12:26 pm
by ahenry3068
Is there anywhere I can find documentation on these
Basic keywords.... ?

Re: A little musical demo to show off the R42 BASIC additions

Posted: Fri Apr 07, 2023 7:09 pm
by StephenHorn
The documentation is hosted on GitHub:
https://github.com/X16Community/x16-docs

Re: A little musical demo to show off the R42 BASIC additions

Posted: Fri Apr 07, 2023 9:12 pm
by ahenry3068
Thank you