Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Music sight singing, word, vfp
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00767342
Message ID:
00770781
Vues:
23
Started on this. Got it to look like one continuos line of music. Started
with a simple treble cleff, saved in Paint. Then created a jpg of this,
one for each note. Used Word as below. Never finished the random part of
the project, so if you look you will see things are unfinished. The main problem
I ran into was that the jpg files, while there are clear in Paint, are
muggy looking in Word. Haven't figure that out yet. Has to do with
"lossless" compression??
Steve

public cc, cPicture, RandThis
clear

dimension dnote (12,2)

mext = ".jpg"

dnote(12,1) = "c:\d\tax\c" + mext
dnote(12,2) = 1

RandomLine = 12
do while RandomLine > 0

RandomThis = dnote(RandomLine,2)
dplace = RandomThis - 1
do GetRandomNumber

RandomLine = RandomLine - 1
enddo

wait

*dnote(11,1) = "c:\d\tax\d" + mext
dnote(10,1) = "c:\d\tax\c" + mext
dnote(9,1) = "c:\d\tax\d" + mext
dnote(8,1) = "c:\d\tax\e" + mext
dnote(7,1) = "c:\d\tax\f" + mext
dnote(6,1) = "c:\d\tax\e" + mext
dnote(5,1) = "c:\d\tax\d" + mext
dnote(4,1) = "c:\d\tax\c" + mext
dnote(3,1) = "c:\d\tax\d" + mext
dnote(2,1) = "c:\d\tax\d" + mext
dnote(1,1) = "c:\d\tax\c" + mext


mm=12
yy = 1
do while mm>0
? yy, dnote(mm,2) , dnote(mm,1)
mm = mm - 1
yy = yy + 1
enddo

wait

Release all like o*
oWord = CreateObject("Word.Application")
oWord.Visible = .T.
oDocument = oWord.Documents.Add()
oWord.Application.DisplayAlerts = .F.
*oWord.Application.DisplayAlerts = 0

oRange = oDocument.Paragraphs[1].Range()

x = 12
do while x > 0
cPicture = dnote(x,1)
ODocument.InlineShapes.AddPicture(cPicture ,.F. ,.T. , oRange )
x = x - 1
enddo

oWord.ActiveDocument.Close(0) &&without prompt
oWord.Quit()
Release all like o*



******************************************8
proc GetRandomNumber

UpperNumber =Randomthis + 1
LowerNumber = Randomthis - 1

* if RandomThis = 1
* Lowernumber = 1
* endif

RandomNumber = int((UpperNumber - LowerNumber)*Rand( ) + LowerNumber)
*? RandomNumber

FileNum = RandomNumber

Do FileChoice

if dnote(12,2) = 1
*if dnote(11,2) = 1
randomnumber = 2
cc = "c:\d\tax\d" + mext
*endif
endif

?"upper ",uppernumber
?"lower ",lowernumber
? "rand ",RandomNumber
? "file ",cc
wait

dnote(dplace,2) = RandomNumber
dnote(dplace,1) = cc

endproc

proc FileChoice
if FileNum = 0
cc = "c:\d\tax\c" + mext
endif


if FileNum = 1
cc = "c:\d\tax\c" + mext
endif

if FileNum = 2
cc = "c:\d\tax\d" + mext
endif

if FileNum = 3
cc = "c:\d\tax\e" + mext
endif

if FileNum = 4
cc = "c:\d\tax\f" + mext
endif

if FileNum = 5
cc = "c:\d\tax\g" + mext
endif

if FileNum = 6
cc = "c:\d\tax\a" + mext
endif

if FileNum = 7
cc = "c:\d\tax\b" + mext
endif

if FileNum = 8
cc = "c:\d\tax\c2" + mext
endif
endproc
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform