Enjoy programming more!
Kidspod is a post site which supports young programmers.
First step to join us.
Register as a member
For members

2019/04/08 13:47:14

MixJuice GET URL : kidspod.club/mj/784

音勘テスト ANAkeyで入力

音感テスト
OUT2に圧電サウンダを接続 PWM2で正確な音程の音が鳴ります。
赤ボタンを押すと音が鳴ります。
ANAkeyで入力すると音が鳴って、正誤が表示されます。
青ボタンで終了。

改造のヒント 問題の聞き直しや音階の確かめができるようにしてみよう。

  • 1
  • 2
  • 1
  • 2

SOURCE CODE

10 'OnKanTest
20 VIDEO3:CLS
30 POKE#800,196,222,0
40 POKE#804,196,222,35,0
50 POKE#808,218,0
60 POKE#80C,208,98,0
70 POKE#810,208,0
80 POKE#814,204,167,0
90 POKE#818,204,167,35,0
100 POKE#81C,191,0
110 POKE#820,215,98,0
120 POKE#824,215,0
130 POKE#828,188,98,0
140 POKE#82C,188,0
150 POKE#830,196,222,0
160 LET[50],3822,3608,3405,3214,3034,2863,2703,2551,2408,2273,2145,2025,1911
170 LET[70],50,100,200,300,350,400,500,600,650,750,850,900,1000
180 OUT 2,0
190 ?"IchigoOnKanTest":M=-1
200 @LP:IF!IN(1)VIDEO1:END:ELSEIFIN(3)CONT
210 K=RND(13):IFK=MCONT:ELSEM=K
220 ?"? ";:PWM2,[50+M]/40,[50+M]/20
230 IF!IN(3)CONT:ELSEOUT2,0
240 N=ANA(2):IFN>1000CONT:ELSEO=0
250 IFN>[70+O]O=O+1:CONT
260 PWM2,[50+O]/40,[50+O]/20
270 IFANA(2)<1000:CONT:ELSEOUT2,0
280 IFO=M?"~E9";:ELSE?"~E8";
290 ?" ";STR$(#800+K*4):GOTO@LP

COMMENT