Include(gs.h) ResetGS()r4 CH=10 GS_RHYTHM(1)r8
SysEx$ = F0,41,10,42,12,{40,00,00,00,04,00,00},F7;r48
FUNCTION Randomusic(Int Loop, Int AL, Int R, Int C, Array NotePi){
//_宣言値
// Int Loop=1000 //繰り返し回数
// Int AL = 4; //連続音乱回数発音確率
// Int R = 5; //休符発音確率
// Int C = 2; //和音発音確率
Int CR = 20; //和音乱音
Int Note; //音符
Int SoundLength; //音長
Int ContinuousSound; //連続音乱回数発音確率
Int Rest; //休符発音確率
Int Chord; //和音発音確率
Int ChordRandom; //3和音発音確率
//_プログラム
[(Loop) //音楽開始
Note = RandomSelect(NotePi)
SoundLength =RandomSelect(1,2,4,8,16,32)
ContinuousSound = Random(AL)
Rest = Random(R)
Chord = Random(C)
ChordRandom = Random(CR)
[(ContinuousSound)
IF(Rest=1){ //休符
IF(SoundLength=1){ SoundLength=0 }
IF(SoundLength=2){ SoundLength=0 } r(SoundLength) }
l(SoundLength) n(Note) //音長・音
IF(Chord=1){r-(SoundLength) n(Note+ChordRandom) }
IF(ChordRandom>15){ ChordRandom = Random(CR) r-(SoundLength) n(Note+ChordRandom) }
]
]
}
ARRAY N1 = (1, 3, 5, 6, 8, 10, 12 ) //音階1
ARRAY N2 = (13, 15, 17, 18, 20, 22, 24 ) //音階2
ARRAY N3 = (25, 27, 29, 30, 32, 34, 36 ) //音階3
ARRAY N4 = (37, 39, 41, 42, 44, 46, 48 ) //音階4
ARRAY N5 = (49, 51, 53, 54, 56, 58, 60 ) //音階5
ARRAY N6 = (61, 63, 65, 66, 68, 70, 72 ) //音階6
ARRAY N7 = (73, 75, 77, 78, 80, 82, 84 ) //音階7
ARRAY N8 = (85, 87, 89, 90, 92, 94, 96 ) //音階8
ARRAY N9 = (97, 99, 101, 102, 104, 106, 108 ) //音階9
ARRAY N10 =(109, 111, 113, 114, 116, 118, 120 ) //音階10
ARRAY N11 =(121, 123, 125, 126, 128, 130, 132 ) //音階11
Array NotePi = (N1,N2,N3,N4,N5,N6,N7,N8,N9,N10,N11);
TimeBase=96 Tempo=211 Time=(!1) TrackSync
TR=1 @14,0,0
Randomusic(100, 4, 5, 2, NotePi) // ループ, 連続音, 休符, 和音, 必要なノート
TR=2 @12,0,0
Randomusic(100, 4, 5, 2, NotePi)