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

2019/08/27 14:02:14

MixJuice GET URL : kidspod.club/mj/898

MUSIC123 数字入力でふしづくり

out5に圧電サウンダを接続して鳴らします。

12345678 ドレミファソラシド
0 休み 9 伸ばす

L=10:N=2:P=50 音の長さ 間隔 音色 の設定

  • 1
  • 2
  • 1
  • 2

SOURCE CODE

10 'MUSIC123
20 LET[0],191,170,151,143
30 LET[4],127,113,101,95
40 CLS:?"MUSIC123"
50 L=10:N=2:P=50:Y=2
60 @S:LC0,Y:INPUT "",A
70 M=#900+32*Y
80 @P:C=PEEK(M):M=M+1:F=0
90 IFC=0OUT5,0:GOTO@N
100 IFC=57:GOTO@L
110 IFC=48OUT5,0:GOTO@L
120 IF(C>48)*(C<57)F=[C-49]
130 PWM5,F*P/100,F
140 @L:WAITL-N
150 IFPEEK(M)<>57OUT5,0
160 WAITN:GOTO@P
170 @N:Y=Y+1:IFY>21Y=2
180 GOTO@S

COMMENT