lots of statements after "then" of "if"
lots of statements after "then" of "if"
- Subject: lots of statements after "then" of "if"
- From: micro-people <email@hidden>
- Date: Tue, 9 Sep 2003 23:19:34 +0900
Excuse me for posting to 2 list at once..
the following script will let AC self-compose a tiny song
which should be sang by someone like Fred or Kathy @ PT
well yes am posting this to beg for your idea
to make the script look more smarter
my biggest wondering is
"is there a way to do several things
after "then" of "if"
if yes
would like to do some more complicated calculation
and make the song sound more funny
some of you can understand that
the spit-out script will sing a simple pentatonic scale
but
what i am aiming is to
make PT vibrate between 2 different pentatonics
well
maybe just adding somemore
if sarigama = x then set pada to (yy + 12 * (random number from 0 to 3)) as text
line is the answer
but if possible
would like to not completely mix the elements
but "vibrate" between 2 tonality
thanx in advance
---the script---
set fragment to open for access file "sarigama:@:as:song1" with write permission
try
write return to fragment starting at eof
repeat 12 times
set pmod to (random number from 0 to 127) as text
set rate to (random number from 30 to 500) as text
write "[[pmod " & pmod & "]]" & "[[rate " & rate & "]]" to fragment
set sarigama to (random number from 1 to 5)
if sarigama = 1 then set pada to (26 + 12 * (random number from 0 to 3)) as text
if sarigama = 2 then set pada to (28 + 12 * (random number from 0 to 3)) as text
if sarigama = 3 then set pada to (30 + 12 * (random number from 0 to 3)) as text
if sarigama = 4 then set pada to (33 + 12 * (random number from 0 to 3)) as text
if sarigama = 5 then set pada to (35 + 12 * (random number from 0 to 3)) as text
if sarigama = 1 then set nisa to "[[pbas " & pada & "]]Sa"
if sarigama = 2 then set nisa to "[[pbas " & pada & "]]Ri"
if sarigama = 3 then set nisa to "[[pbas " & pada & "]]Ga"
if sarigama = 4 then set nisa to "[[pbas " & pada & "]]Pa"
if sarigama = 5 then set nisa to "[[pbas " & pada & "]]Da"
repeat 12 times
set nobiru to (random number from 0 to 1)
if (nobiru = 1 and sarigama is not 2) then set nisa to nisa & "a"
if (nobiru = 1 and sarigama = 2) then set nisa to nisa & "i"
end repeat
write nisa & space to fragment
end repeat
write return to fragment
on error errMes
close access fragment
error errMes
end try
close access fragment
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.