Commit 558691e7 authored by Flaxo's avatar Flaxo

added music challenges.

parent 0a6352e1
50 s=54272
60 fa=1 :rem verzoegerungsfaktor
100 for l=s to s+24 :poke l,0 :next :rem clear sound chip
200 poke s+5,9 :poke s+6,0
300 poke s+24,15 :rem set volume to maximum
350 goto 10000
400 read hf,lf,dr
500 if hf<0 then end
600 poke s+1,hf :poke s,177
700 poke s+4,33
800 for t=1 to dr :next
900 poke s+4,32 :for t=1 to 50 :next
1000 goto 400
1085 print " fl=";fl
9100 data 4, 1,4
9110 data 4, 3,4
9120 data 4, 5,4
9130 data 4, 6,4
9140 data 4, 8,2
9150 data 4, 8,2
9160 data 4,10,4
9170 data 4,10,4
9180 data 4,10,4
9190 data 4,10,4
9200 data 4, 8,1
9210 data 4,10,4
9220 data 4,10,4
9230 data 4,10,4
9240 data 4,10,4
9250 data 4, 8,1
9260 data 4, 6,4
9270 data 4, 6,4
9280 data 4, 6,4
9290 data 4, 6,4
9300 data 4, 5,2
9330 data 4, 5,2
9340 data 4, 8,4
9350 data 4, 8,4
9360 data 4, 8,4
9370 data 4, 8,4
9380 data 4, 1,1
9998 data -1,-1,-1
9999 end
10000 rem oktave, ton, nennen
10100 read ok, tn, ne
10150 rem ok=1 : tn=1: ne=4
10160 print "ok=";ok;" tn=";tn;" ne=";ne
10200 if ok <0 then end
10300 bf=440 : rem basisfrequenz
10320 bo=bf* (2^ok)
10350 print "bo=";bo
10360 bt=2^(tn/12)
10380 print " bt=";bt
10400 fr=bf*(2^ok) * (2^(tn/12))
10450 print "fr=";fr;
10500 rem zwoelfte wurzel aus (2 hoch tn)
10600 rem 2 hoch ton/zwoelf
10700 fh= int(fr/256)
10750 print "fh=";fh;
10800 fl=int(fr-(256*fh))
10850 print "fl=";fl;
10880 print "fl+256*fh=";fl+256*fh;
10900 poke s+1,fh :poke s,fl
20000 rem poke s+4,33: rem saegezahn
20010 poke s+4,17 :rem dreieck
20100 dr=1000/ne :rem dauer x-tel-note
20150 print " dr=";dr
20200 for t=1 to dr*fa :next
20300 poke s+4,32
20400 rem fjoy t=1 to 50:next
20500 goto 10100
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment