kujirahand / picosakura

piko sakura is music box for browser with MML Compiler Sakura
MIT License
5 stars 0 forks source link

RandomSelect #26

Open kujirahand opened 2 weeks ago

kujirahand commented 2 weeks ago

https://sakuramml.com/mmlbbs6/post.php?mml_id=2614 より

// Relaxation IV
System.RandomSeed=2024

Array M1=(">c<ba^^^^^", ">dc<b^^^^^", "agf^^^^^")
Array M2=("agfe", "dc<b><a>")
Array M4=("r^","r^","o5a^")

Array Ist=(,GrandPiano,Cello,Strings2,BirdTweet)
#Ef1="q=100 V=80 t.Random=2"
#Ef2="q=100 V=50 v.Random=32"
#Ef3="q=100 V=60 REV=100"
#Ef4="q=100 V=80 REV=100 P(RandomSelect(30,90))"

[16 Tempo=(60+RandomSelect(-4,0,4)) 
  TR(1) @Ist(1) #Ef1 [2 l8 o(RandomSelect(5,6)) #MML=M1(Random(SizeOf(M1))) [2 #MML]]
  TR(2) @Ist(2) #Ef2 [2 l2 o(RandomSelect(4,5)) #MML=M2(Random(SizeOf(M2))) [1 #MML]]
  TR(3) @Ist(3) #Ef3 [2 l1 o3a^]
  TR(4) @Ist(4) #Ef4 [2 l2 #MML=M4(Random(SizeOf(M4))) [2 #MML]]
]

を実行すると

[ERROR](14) Unknown Character: "5" near ",6)) #MM"
[ERROR](14) Unknown Character: "6" near ")) #MML="
[ERROR](15) Unknown Character: "4" near ",5)) #MM"
[ERROR](15) Unknown Character: "5" near ")) #MML="
[ERROR](14) Runtime Error: Array(M1) index out of range
[ERROR](17) Runtime Error: Array(M4) index out of range
[ERROR](17) Runtime Error: Array(M4) index out of range
[ERROR](15) Runtime Error: Array(M2) index out of range
[ERROR](14) Runtime Error: Array(M1) index out of range
[ERROR](15) Runtime Error: Array(M2) index out of range
[ERROR](17) Runtime Error: Array(M4) index out of range
[ERROR](14) Runtime Error: Array(M1) index out of range
[ERROR](14) Runtime Error: Array(M1) index out of range
[ERROR](17) Runtime Error: Array(M4) index out of range
[ERROR](14) Runtime Error: Array(M1) index out of range
[ERROR](14) Runtime Error: Array(M1) index out of range
[ERROR](17) Runtime Error: Array(M4) index out of range
[ERROR](17) Runtime Error: Array(M4) index out of range
[ERROR](17) Runtime Error: Array(M4) index out of range
[ERROR](17) Runtime Error: Array(M4) index out of range
[ERROR](14) Runtime Error: Array(M1) index out of range
[ERROR](14) Runtime Error: Array(M1) index out of range
[ERROR](15) Runtime Error: Array(M2) index out of range
[ERROR](17) Runtime Error: Array(M4) index out of range
[ERROR](17) Runtime Error: Array(M4) index out of range
[ERROR](14) Runtime Error: Array(M1) index out of range
[ERROR](14) Runtime Error: Array(M1) index out of range
[ERROR](17) Runtime Error: Array(M4) index out of range
[ERROR](15) Runtime Error: Array(M2) index out of range
[ERROR](17) Runtime Error: Array(M4) index out of range
[ERROR](17) Runtime Error: Array(M4) index out of range

となります。

kujirahand commented 2 weeks ago

関数の引数にある負数を読むと skip となってしまいます。