Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Merry Christmas & Happy Holidays 5

Status
Not open for further replies.

EzLogic

Programmer
Aug 21, 2001
1,230
US
To all that celebrate the Holidays across the globe, Merry Christmas & Happy Holidays.


Ez Logic
Michigan
 
Merry Christmas and a Happy New Year!
Code:
* Silent night
LOCAL loMidi,lni,unit,octave,octave1,octave2,octave3,c,cs,d,ds,e,f,fs,g,gs,a,as,b,db,eb,gb,ab,bb,volume1,volume2,lntimes,lnj
LOCAL octave
LOCAL c,cs,d,ds,e,f,fs,g,gs,a,as,b,db,eb,gb,ab,bb
* normal
LOCAL c0,cs0,d0,ds0,e0,f0,fs0,g0,gs0,a0,as0,b0,db0,eb0,gb0,ab0,bb0
* acut
LOCAL c1,cs1,d1,ds1,e1,f1,fs1,g1,gs1,a1,as1,b1,db1,eb1,gb1,ab1,bb1
LOCAL c2,cs2,d2,ds2,e2,f2,fs2,g2,gs2,a2,as2,b2,db2,eb2,gb2,ab2,bb2
LOCAL c3,cs3,d3,ds3,e3,f3,fs3,g3,gs3,a3,as3,b3,db3,eb3,gb3,ab3,bb3
* grav
LOCAL c4,cs4,d4,ds4,e4,f4,fs4,g4,gs4,a4,as4,b4,db4,eb4,gb4,ab4,bb4
LOCAL c5,cs5,d5,ds5,e5,f5,fs5,g5,gs5,a5,as5,b5,db5,eb5,gb5,ab5,bb5
LOCAL c6,cs6,d6,ds6,e6,f6,fs6,g6,gs6,a6,as6,b6,db6,eb6,gb6,ab6,bb6
*DOEVENTS
loMidi=CREATEOBJECT("TMidiNote")
* semibreve=4.5 secunde
unit=4500
* volume
volume1=100
volume2=130
* Instruments
loMidi.ChangePatch(96,0)
loMidi.ChangePatch(46,1)
loMidi.ChangePatch(122,2)
loMidi.ChangePatch(123,3)
*octava
octave=5
* a=la,b=si,c=do, etc. cs=do diez db=do bemol
c=0
STORE 1 TO cs,db
d=2
STORE 3 TO ds,eb
e=4
f=5
STORE 6 TO fs,gb
g=7
STORE 8 TO gs,ab
a=9
STORE 10 TO as,bb
b=11
* normal
c0=octave*12+c
STORE octave*12+cs TO cs0,db0
d0=octave*12+d
STORE octave*12+ds TO ds0,eb0
e0=octave*12+e
f0=octave*12+f
STORE octave*12+fs TO fs0,gb0
g0=octave*12+g
STORE octave*12+gs TO gs0,ab0
a0=octave*12+a
STORE octave*12+as TO as0,bb0
b0=octave*12+b
* acut
c1=(octave+1)*12+c
STORE (octave+1)*12+cs TO cs1,db1
d1=(octave+1)*12+d
STORE (octave+1)*12+ds TO ds1,eb1
e1=(octave+1)*12+e
f1=(octave+1)*12+f
STORE (octave+1)*12+fs TO fs1,gb1
g1=(octave+1)*12+g
STORE (octave+1)*12+gs TO gs1,ab1
a1=(octave+1)*12+a
STORE (octave+1)*12+as TO as1,bb1
b1=(octave+1)*12+b

c2=(octave+2)*12+c
STORE (octave+2)*12+cs TO cs2,db2
d2=(octave+2)*12+d
STORE (octave+2)*12+ds TO ds2,eb2
e2=(octave+2)*12+e
f2=(octave+2)*12+f
STORE (octave+2)*12+fs TO fs2,gb2
g2=(octave+2)*12+g
STORE (octave+2)*12+gs TO gs2,ab2
a2=(octave+2)*12+a
STORE (octave+2)*12+as TO as2,bb2
b2=(octave+2)*12+b

c3=(octave+3)*12+c
STORE (octave+3)*12+cs TO cs3,db3
d3=(octave+3)*12+d
STORE (octave+3)*12+ds TO ds3,eb3
e3=(octave+3)*12+e
f3=(octave+3)*12+f
STORE (octave+3)*12+fs TO fs3,gb3
g3=(octave+3)*12+g
STORE (octave+3)*12+gs TO gs3,ab3
a3=(octave+3)*12+a
STORE (octave+3)*12+as TO as3,bb3
b3=(octave+3)*12+b

*grav
c4=(octave-1)*12+c
STORE (octave-1)*12+cs TO cs4,db4
d4=(octave-1)*12+d
STORE (octave-1)*12+ds TO ds4,eb4
e4=(octave-1)*12+e
f4=(octave-1)*12+f
STORE (octave-1)*12+fs TO fs4,gb4
g4=(octave-1)*12+g
STORE (octave-1)*12+gs TO gs4,ab4
a4=(octave-1)*12+a
STORE (octave-1)*12+as TO as4,bb4
b4=(octave-1)*12+b

c5=(octave-2)*12+c
STORE (octave-2)*12+cs TO cs5,db5
d5=(octave-2)*12+d
STORE (octave-2)*12+ds TO ds5,eb5
e5=(octave-2)*12+e
f5=(octave-2)*12+f
STORE (octave-2)*12+fs TO fs5,gb5
g5=(octave-2)*12+g
STORE (octave-2)*12+gs TO gs5,ab5
a5=(octave-2)*12+a
STORE (octave-2)*12+as TO as5,bb5
b5=(octave-2)*12+b

c6=(octave-3)*12+c
STORE (octave-3)*12+cs TO cs6,db6
d6=(octave-3)*12+d
STORE (octave-3)*12+ds TO ds6,eb6
e6=(octave-3)*12+e
f6=(octave-3)*12+f
STORE (octave-3)*12+fs TO fs6,gb6
g6=(octave-3)*12+g
STORE (octave-3)*12+gs TO gs6,ab6
a6=(octave-3)*12+a
STORE (octave-3)*12+as TO as6,bb6
b6=(octave-3)*12+b


********************
lntimes=2
loMidi.PlayNote(d4,volume1,2)
loMidi.Pause(unit/2)

loMidi.PlayNote(d0,volume1,3)
loMidi.Pause(unit/16)

loMidi.PlayNote(f0,volume1,3)
loMidi.Pause(unit/16)

loMidi.PlayNote(eb0,volume1,3)
loMidi.Pause(unit/16)

loMidi.PlayNote(f0,volume1,3)
loMidi.Pause(unit/16)

loMidi.PlayNote(eb0,volume1,3)
loMidi.Pause(unit/4)
loMidi.StopNote(d4,2)
loMidi.StopNote(d0,3)
loMidi.StopNote(f0,3)
loMidi.StopNote(eb0,3)

loMidi.PlayNote(d0,volume1,3)
loMidi.Pause(unit/16)

loMidi.PlayNote(f0,volume1,3)
loMidi.Pause(unit/16)

loMidi.PlayNote(d4,volume1,2)
loMidi.PlayNote(eb0,volume1,3)
loMidi.Pause(unit/16)

loMidi.PlayNote(f0,volume1,3)
loMidi.Pause(unit/16)

loMidi.PlayNote(eb0,volume1,3)
loMidi.Pause(unit/4)
loMidi.StopNote(d4,2)
loMidi.StopNote(d0,3)
loMidi.StopNote(f0,3)
loMidi.StopNote(eb0,3)

FOR lni=1 TO lntimes
FOR lnj=1 TO 2
loMidi.PlayNote(d0,volume1,0)
loMidi.PlayNote(f0,volume1,0)
loMidi.PlayNote(bb5,volume1,1)
loMidi.PlayNote(bb4,volume1,1)
loMidi.Pause(unit*3/16)
loMidi.StopNote(d0,0)
loMidi.StopNote(f0,0)

loMidi.PlayNote(eb0,volume1,0)
loMidi.PlayNote(g0,volume1,0)
loMidi.Pause(unit/16)
loMidi.StopNote(eb0,0)
loMidi.StopNote(g0,0)
loMidi.StopNote(bb5,1)
loMidi.StopNote(bb4,1)

loMidi.PlayNote(d0,volume1,0)
loMidi.PlayNote(f0,volume1,0)
loMidi.PlayNote(bb5,volume1,1)
loMidi.PlayNote(bb4,volume1,1)
loMidi.Pause(unit/8)
loMidi.StopNote(d0,0)
loMidi.StopNote(f0,0)
loMidi.StopNote(bb5,1)
loMidi.StopNote(bb4,1)

loMidi.PlayNote(d0,volume1,0)
loMidi.PlayNote(bb4,volume1,0)
loMidi.PlayNote(bb5,volume1,1)
loMidi.PlayNote(f4,volume1,1)
loMidi.Pause(unit*3/8)
loMidi.StopNote(d0,0)
loMidi.StopNote(bb4,0)
loMidi.StopNote(bb5,1)
loMidi.StopNote(f4,1)
NEXT

loMidi.PlayNote(c1,volume1,0)
loMidi.PlayNote(eb0,volume1,0)
loMidi.PlayNote(a4,volume1,1)
loMidi.PlayNote(f4,volume1,1)
loMidi.Pause(unit/4)
loMidi.StopNote(c1,0)
loMidi.StopNote(eb0,0)
loMidi.StopNote(a4,1)
loMidi.StopNote(f4,1)

loMidi.PlayNote(c1,volume1,0)
loMidi.PlayNote(eb0,volume1,0)
loMidi.PlayNote(a4,volume1,1)
loMidi.PlayNote(f4,volume1,1)
loMidi.Pause(unit/8)
loMidi.StopNote(c1,0)
loMidi.StopNote(eb0,0)
loMidi.StopNote(a4,1)
loMidi.StopNote(f4,1)

loMidi.PlayNote(c0,volume1,0)
loMidi.PlayNote(a0,volume1,0)
loMidi.PlayNote(f4,volume1,1)
loMidi.PlayNote(f4,volume1,1)
loMidi.Pause(unit*3/8)
loMidi.StopNote(c0,0)
loMidi.StopNote(a0,0)
loMidi.StopNote(f4,1)
loMidi.StopNote(f4,1)

loMidi.PlayNote(bb0,volume1,0)
loMidi.PlayNote(d0,volume1,0)
loMidi.PlayNote(bb5,volume1,1)
loMidi.PlayNote(f4,volume1,1)
loMidi.Pause(unit/4)
loMidi.StopNote(bb0,0)
loMidi.StopNote(d0,0)
loMidi.StopNote(bb5,1)
loMidi.StopNote(f4,1)

loMidi.PlayNote(bb0,volume1,0)
loMidi.PlayNote(d0,volume1,0)
loMidi.PlayNote(bb5,volume1,1)
loMidi.PlayNote(f4,volume1,1)
loMidi.Pause(unit/8)
loMidi.StopNote(bb0,0)
loMidi.StopNote(d0,0)
loMidi.StopNote(bb5,1)
loMidi.StopNote(f4,1)

loMidi.PlayNote(f0,volume1,0)
loMidi.PlayNote(d0,volume1,0)
loMidi.PlayNote(bb4,volume1,1)
loMidi.PlayNote(bb5,volume1,1)
loMidi.Pause(unit*3/8)
loMidi.StopNote(f0,0)
loMidi.StopNote(d0,0)
loMidi.StopNote(bb4,1)
loMidi.StopNote(bb5,1)

FOR lnj=1 TO 2
loMidi.PlayNote(eb0,volume1,0)
loMidi.PlayNote(g0,volume1,0)
loMidi.PlayNote(eb4,volume1,1)
loMidi.PlayNote(bb4,volume1,1)
loMidi.Pause(unit/4)
loMidi.StopNote(eb0,0)
loMidi.StopNote(g0,0)
loMidi.StopNote(eb4,1)
loMidi.StopNote(bb4,1)

loMidi.PlayNote(eb0,volume1,0)
loMidi.PlayNote(g0,volume1,0)
loMidi.PlayNote(eb4,volume1,1)
loMidi.PlayNote(bb4,volume1,1)
loMidi.Pause(unit/8)
loMidi.StopNote(eb0,0)
loMidi.StopNote(g0,0)
loMidi.StopNote(eb4,1)
loMidi.StopNote(bb4,1)

loMidi.PlayNote(bb0,volume1,0)
loMidi.PlayNote(g0,volume1,0)
loMidi.PlayNote(eb4,volume1,1)
loMidi.PlayNote(bb4,volume1,1)
loMidi.Pause(unit*3/16)
loMidi.StopNote(bb0,0)
loMidi.StopNote(g0,0)
loMidi.StopNote(eb4,1)
loMidi.StopNote(bb4,1)

loMidi.PlayNote(a0,volume1,0)
loMidi.PlayNote(f0,volume1,0)
loMidi.PlayNote(eb4,volume1,1)
loMidi.PlayNote(bb4,volume1,1)
loMidi.Pause(unit/16)
loMidi.StopNote(f0,0)
loMidi.StopNote(a0,0)
loMidi.StopNote(eb4,1)
loMidi.StopNote(bb4,1)

loMidi.PlayNote(eb0,volume1,0)
loMidi.PlayNote(g0,volume1,0)
loMidi.PlayNote(eb4,volume1,1)
loMidi.PlayNote(bb4,volume1,1)
loMidi.Pause(unit/8)
loMidi.StopNote(eb0,0)
loMidi.StopNote(g0,0)
loMidi.StopNote(eb4,1)
loMidi.StopNote(bb4,1)

loMidi.PlayNote(d0,volume1,0)
loMidi.PlayNote(f0,volume1,0)
loMidi.PlayNote(bb5,volume1,1)
loMidi.PlayNote(bb4,volume1,1)
loMidi.Pause(unit*3/16)
loMidi.StopNote(d0,0)
loMidi.StopNote(f0,0)

loMidi.PlayNote(eb0,volume1,0)
loMidi.PlayNote(g0,volume1,0)
loMidi.Pause(unit/16)
loMidi.StopNote(eb0,0)
loMidi.StopNote(g0,0)
loMidi.StopNote(bb5,1)
loMidi.StopNote(bb4,1)

loMidi.PlayNote(d0,volume1,0)
loMidi.PlayNote(f0,volume1,0)
loMidi.PlayNote(bb5,volume1,1)
loMidi.PlayNote(bb4,volume1,1)
loMidi.Pause(unit/8)
loMidi.StopNote(d0,0)
loMidi.StopNote(f0,0)
loMidi.StopNote(bb5,1)
loMidi.StopNote(bb4,1)

loMidi.PlayNote(d0,volume1,0)
loMidi.PlayNote(bb4,volume1,0)
loMidi.PlayNote(bb5,volume1,1)
loMidi.PlayNote(f4,volume1,1)
loMidi.Pause(unit*3/8)
loMidi.StopNote(d0,0)
loMidi.StopNote(bb4,0)
loMidi.StopNote(bb5,1)
loMidi.StopNote(f4,1)
NEXT

loMidi.PlayNote(c1,volume1,0)
loMidi.PlayNote(eb0,volume1,0)
loMidi.PlayNote(a4,volume1,1)
loMidi.PlayNote(f4,volume1,1)
loMidi.Pause(unit/4)
loMidi.StopNote(c1,0)
loMidi.StopNote(eb0,0)
loMidi.StopNote(a4,1)
loMidi.StopNote(f4,1)

loMidi.PlayNote(c1,volume1,0)
loMidi.PlayNote(eb0,volume1,0)
loMidi.PlayNote(a4,volume1,1)
loMidi.PlayNote(f4,volume1,1)
loMidi.Pause(unit/8)
loMidi.StopNote(c1,0)
loMidi.StopNote(eb0,0)
loMidi.StopNote(a4,1)
loMidi.StopNote(f4,1)

loMidi.PlayNote(c0,volume1,0)
loMidi.PlayNote(eb1,volume1,0)
loMidi.PlayNote(a4,volume1,1)
loMidi.PlayNote(f4,volume1,1)
loMidi.Pause(unit*3/16)
loMidi.StopNote(c0,0)
loMidi.StopNote(eb1,0)
loMidi.StopNote(a4,1)
loMidi.StopNote(f4,1)

loMidi.PlayNote(c1,volume1,0)
loMidi.PlayNote(eb0,volume1,0)
loMidi.PlayNote(a4,volume1,1)
loMidi.PlayNote(f4,volume1,1)
loMidi.Pause(unit/16)
loMidi.StopNote(c1,0)
loMidi.StopNote(eb0,0)
loMidi.StopNote(a4,1)
loMidi.StopNote(f4,1)

loMidi.PlayNote(c0,volume1,0)
loMidi.PlayNote(a0,volume1,0)
loMidi.PlayNote(f4,volume1,1)
loMidi.PlayNote(f4,volume1,1)
loMidi.Pause(unit/8)
loMidi.StopNote(c0,0)
loMidi.StopNote(a0,0)
loMidi.StopNote(f4,1)
loMidi.StopNote(f4,1)

loMidi.PlayNote(d0,volume1,0)
loMidi.PlayNote(bb0,volume1,0)
loMidi.PlayNote(bb5,volume1,1)
loMidi.PlayNote(f4,volume1,1)
loMidi.Pause(unit*3/8)
loMidi.StopNote(d0,0)
loMidi.StopNote(bb0,0)
loMidi.StopNote(bb5,1)
loMidi.StopNote(f4,1)

loMidi.PlayNote(d1,volume1,0)
loMidi.PlayNote(f0,volume1,0)
loMidi.PlayNote(bb4,volume1,1)
loMidi.PlayNote(bb5,volume1,1)
loMidi.Pause(unit/4)
loMidi.StopNote(d1,0)
loMidi.StopNote(f0,0)
loMidi.StopNote(bb4,1)
loMidi.StopNote(bb5,1)

loMidi.Pause(unit/8)

loMidi.PlayNote(d0,volume1,0)
loMidi.PlayNote(bb0,volume1,0)
loMidi.PlayNote(f5,volume1,1)
loMidi.PlayNote(f4,volume1,1)
loMidi.Pause(unit*3/16)
loMidi.StopNote(d0,0)

loMidi.PlayNote(f0,volume1,0)
loMidi.Pause(unit/16)
loMidi.StopNote(f0,0)
loMidi.StopNote(bb0,0)
loMidi.StopNote(f5,1)
loMidi.StopNote(f4,1)

loMidi.PlayNote(d0,volume1,0)
loMidi.PlayNote(bb4,volume1,0)
loMidi.PlayNote(f5,volume1,1)
loMidi.PlayNote(f4,volume1,1)
loMidi.Pause(unit/8)
loMidi.StopNote(d0,0)
loMidi.StopNote(bb4,0)
loMidi.StopNote(f5,1)
loMidi.StopNote(f4,1)

loMidi.PlayNote(d0,volume1,0)
loMidi.PlayNote(f0,volume1,0)
loMidi.PlayNote(f5,volume1,1)
loMidi.PlayNote(f4,volume1,1)
loMidi.Pause(unit*3/16)
loMidi.StopNote(d0,0)
loMidi.StopNote(f0,0)
loMidi.StopNote(f5,1)
loMidi.StopNote(f4,1)

loMidi.PlayNote(c0,volume1,0)
loMidi.PlayNote(eb0,volume1,0)
loMidi.PlayNote(f5,volume1,1)
loMidi.PlayNote(f4,volume1,1)
loMidi.Pause(unit/16)
loMidi.StopNote(c0,0)
loMidi.StopNote(eb0,0)
loMidi.StopNote(f5,1)
loMidi.StopNote(f4,1)

loMidi.PlayNote(c0,volume1,0)
loMidi.PlayNote(a4,volume1,0)
loMidi.PlayNote(f5,volume1,1)
loMidi.PlayNote(eb4,volume1,1)
loMidi.Pause(unit/8)
loMidi.StopNote(c0,0)
loMidi.StopNote(a4,0)
loMidi.StopNote(f5,1)
loMidi.StopNote(eb4,1)

IF lni=2
loMidi.PlayNote(bb4,volume1,0)
loMidi.PlayNote(bb4,volume1,0)
loMidi.PlayNote(bb5,volume1,1)
loMidi.PlayNote(d4,volume1,1)
loMidi.Pause(unit*5/8)
loMidi.StopNote(bb4,0)
loMidi.StopNote(bb4,0)
loMidi.StopNote(bb5,1)
loMidi.StopNote(d4,1)

loMidi.Pause(unit/8)
ELSE
loMidi.PlayNote(bb4,volume1,0)
loMidi.PlayNote(bb4,volume1,0)
loMidi.PlayNote(bb5,volume1,1)
loMidi.PlayNote(d4,volume1,1)

loMidi.PlayNote(d0,volume1,3)
loMidi.Pause(unit/16)

loMidi.PlayNote(f0,volume1,3)
loMidi.Pause(unit/16)

loMidi.PlayNote(d4,volume1,2)
loMidi.PlayNote(eb0,volume1,3)
loMidi.Pause(unit/16)

loMidi.PlayNote(f0,volume1,3)
loMidi.Pause(unit/16)

loMidi.PlayNote(eb0,volume1,3)
loMidi.Pause(unit*3/8)
loMidi.StopNote(bb4,0)
loMidi.StopNote(bb4,0)
loMidi.StopNote(bb5,1)
loMidi.StopNote(d4,1)

loMidi.Pause(unit/8)
loMidi.StopNote(d4,2)
loMidi.StopNote(d0,3)
loMidi.StopNote(f0,3)
loMidi.StopNote(eb0,3)

ENDIF
NEXT

******************
* from News2News *
******************
DEFINE CLASS TMidiNote As Session
#DEFINE MIDI_STATUS_PLAYNOTE 9
#DEFINE MIDI_STATUS_PATCH 12
PROTECTED hDevice, channel
    hDevice=0
    channel=0
 
PROCEDURE Init(lDeclare)
    THIS.declare
    IF NOT THIS.OpenDevice()
        RETURN .F.
    ENDIF
 
PROCEDURE Destroy
    THIS.CloseDevice
 
PROTECTED FUNCTION OpenDevice() As Boolean
    IF midiOutGetNumDevs() = 0
        MESSAGEBOX("No Midi Devices found.",  48, "MIDI Error")
        RETURN .F.
    ENDIF
 
    LOCAL hDevice, nResult
    hDevice=0
    nResult = midiOutOpen(@hDevice, 0,0,0,0)
    THIS.hDevice = m.hDevice
    IF nResult <> 0
        MESSAGEBOX("Call to midiOutOpen failed: " +  TRANSFORM(nResult), 48, "MIDI Error")
    ENDIF
RETURN (m.nResult=0)
 
PROTECTED PROCEDURE CloseDevice
    IF THIS.hDevice <> 0
        = midiOutReset(THIS.hDevice)
        = midiOutClose(THIS.hDevice)
        THIS.hDevice = 0
    ENDIF
 
PROCEDURE SendMIDICommand(b1, b2, b3, b4, nchan)
    IF THIS.hDevice <> 0
        LOCAL nMsg, nResult
        IF PCOUNT()=4
            nMsg = THIS.channel + BITLSHIFT(m.b1,4) +BITLSHIFT(m.b2,8) +BITLSHIFT(m.b3,16) + BITLSHIFT(m.b4,24)
            nResult = midiOutShortMsg(THIS.hDevice, m.nMsg)
           ELSE
            nMsg = nchan + BITLSHIFT(m.b1,4) +BITLSHIFT(m.b2,8) +BITLSHIFT(m.b3,16) + BITLSHIFT(m.b4,24)
            nResult = midiOutShortMsg(THIS.hDevice, m.nMsg)
           ENDIF
           IF nResult <> 0
               MESSAGEBOX("Call to midiOutShortMsg failed: " +TRANSFORM(nResult), 48, "MIDI Error")
        ENDIF
    ENDIF

PROCEDURE PlayNote(nNote, nVelocity, nchan)
    IF PCOUNT()=2
        nchan=0
    ENDIF
    THIS.SendMIDICommand(MIDI_STATUS_PLAYNOTE,nNote, nVelocity, 0,nchan)
 
PROCEDURE StopNote(nNote, nchan)
    IF PCOUNT()=1
        nchan=0
    ENDIF
    THIS.SendMIDICommand(MIDI_STATUS_PLAYNOTE,m.nNote, 0, 0, nchan)
 
PROCEDURE ChangePatch(nPatchNo, nchan)
    IF PCOUNT()=1
        nchan=0
    ENDIF
    THIS.SendMIDICommand(MIDI_STATUS_PATCH,nPatchNo, 0, 0, nchan)
 
PROCEDURE Pause(dwMilliseconds)
	Sleep(dwMilliseconds)
ENDPROC

PROCEDURE declare
    DECLARE INTEGER midiOutGetNumDevs IN Winmm
    DECLARE INTEGER midiOutClose IN Winmm INTEGER hmo  
    DECLARE INTEGER midiOutReset IN Winmm INTEGER hmo  
    DECLARE Sleep IN kernel32 INTEGER dwMilliseconds
     DECLARE INTEGER midiOutOpen IN Winmm INTEGER @lphmo, INTEGER uDeviceID, INTEGER dwCallback,INTEGER dwCallbackInstance, INTEGER dwFlags
     DECLARE INTEGER midiOutShortMsg IN Winmm INTEGER hmo, LONG dwMsg    
 ENDDEFINE

Respectfully,
Vilhelm-Ion Praisach
Resita, Romania
 
That is Romanian brilliance at its best....
Worth the 'Star of Wonder' award.
Thanks for the fun.
JF
 
[bowright] Thank you.[bowleft]
Instead of "*** got talent" I prefer to go to "Dancing with the stars" [lightsaber]

Happy New Year! [turkey]


Respectfully,
Vilhelm-Ion Praisach
Resita, Romania
 
Any chance you could do a rendition of Auld Land Syne for the New Year ?
If not.. I perfectly understand.

John Fox

Sydney, Australia
 
I like to do that :)
Auld Lang Syne (repeated 4 times, with different instruments; there is a For lni = 1 to 4)

Code:
* [URL unfurl="true"]http://www.8notes.com/scores/1476.asp[/URL]
LOCAL loMidi
loMidi=CREATEOBJECT("TMidiNote")
LOCAL lni,unit,octave,octave1,octave2,octave3,c,cs,d,ds,e,f,fs,g,gs,a,as,b,db,eb,gb,ab,bb,volume1,volume2,lnTimes
LOCAL octave
LOCAL c,cs,d,ds,e,f,fs,g,gs,a,as,b,db,eb,gb,ab,bb
* normal
LOCAL c0,cs0,d0,ds0,e0,f0,fs0,g0,gs0,a0,as0,b0,db0,eb0,gb0,ab0,bb0
* acut
LOCAL c1,cs1,d1,ds1,e1,f1,fs1,g1,gs1,a1,as1,b1,db1,eb1,gb1,ab1,bb1
LOCAL c2,cs2,d2,ds2,e2,f2,fs2,g2,gs2,a2,as2,b2,db2,eb2,gb2,ab2,bb2
LOCAL c3,cs3,d3,ds3,e3,f3,fs3,g3,gs3,a3,as3,b3,db3,eb3,gb3,ab3,bb3
* grav
LOCAL c4,cs4,d4,ds4,e4,f4,fs4,g4,gs4,a4,as4,b4,db4,eb4,gb4,ab4,bb4
LOCAL c5,cs5,d5,ds5,e5,f5,fs5,g5,gs5,a5,as5,b5,db5,eb5,gb5,ab5,bb5
LOCAL c6,cs6,d6,ds6,e6,f6,fs6,g6,gs6,a6,as6,b6,db6,eb6,gb6,ab6,bb6
DOEVENTS
* semibreve=2 seconds
unit=2000
* volume
volume1=100
volume2=130
*octava
octave=5
* a=la,b=si,c=do, etc. cs=do diez db=do bemol
c=0
STORE 1 TO cs,db
d=2
STORE 3 TO ds,eb
e=4
f=5
STORE 6 TO fs,gb
g=7
STORE 8 TO gs,ab
a=9
STORE 10 TO as,bb
b=11
* normal
c0=octave*12+c
STORE octave*12+cs TO cs0,db0
d0=octave*12+d
STORE octave*12+ds TO ds0,eb0
e0=octave*12+e
f0=octave*12+f
STORE octave*12+fs TO fs0,gb0
g0=octave*12+g
STORE octave*12+gs TO gs0,ab0
a0=octave*12+a
STORE octave*12+as TO as0,bb0
b0=octave*12+b
* acut
c1=(octave+1)*12+c
STORE (octave+1)*12+cs TO cs1,db1
d1=(octave+1)*12+d
STORE (octave+1)*12+ds TO ds1,eb1
e1=(octave+1)*12+e
f1=(octave+1)*12+f
STORE (octave+1)*12+fs TO fs1,gb1
g1=(octave+1)*12+g
STORE (octave+1)*12+gs TO gs1,ab1
a1=(octave+1)*12+a
STORE (octave+1)*12+as TO as1,bb1
b1=(octave+1)*12+b

c2=(octave+2)*12+c
STORE (octave+2)*12+cs TO cs2,db2
d2=(octave+2)*12+d
STORE (octave+2)*12+ds TO ds2,eb2
e2=(octave+2)*12+e
f2=(octave+2)*12+f
STORE (octave+2)*12+fs TO fs2,gb2
g2=(octave+2)*12+g
STORE (octave+2)*12+gs TO gs2,ab2
a2=(octave+2)*12+a
STORE (octave+2)*12+as TO as2,bb2
b2=(octave+2)*12+b

c3=(octave+3)*12+c
STORE (octave+3)*12+cs TO cs3,db3
d3=(octave+3)*12+d
STORE (octave+3)*12+ds TO ds3,eb3
e3=(octave+3)*12+e
f3=(octave+3)*12+f
STORE (octave+3)*12+fs TO fs3,gb3
g3=(octave+3)*12+g
STORE (octave+3)*12+gs TO gs3,ab3
a3=(octave+3)*12+a
STORE (octave+3)*12+as TO as3,bb3
b3=(octave+3)*12+b

*grav
c4=(octave-1)*12+c
STORE (octave-1)*12+cs TO cs4,db4
d4=(octave-1)*12+d
STORE (octave-1)*12+ds TO ds4,eb4
e4=(octave-1)*12+e
f4=(octave-1)*12+f
STORE (octave-1)*12+fs TO fs4,gb4
g4=(octave-1)*12+g
STORE (octave-1)*12+gs TO gs4,ab4
a4=(octave-1)*12+a
STORE (octave-1)*12+as TO as4,bb4
b4=(octave-1)*12+b

c5=(octave-2)*12+c
STORE (octave-2)*12+cs TO cs5,db5
d5=(octave-2)*12+d
STORE (octave-2)*12+ds TO ds5,eb5
e5=(octave-2)*12+e
f5=(octave-2)*12+f
STORE (octave-2)*12+fs TO fs5,gb5
g5=(octave-2)*12+g
STORE (octave-2)*12+gs TO gs5,ab5
a5=(octave-2)*12+a
STORE (octave-2)*12+as TO as5,bb5
b5=(octave-2)*12+b

c6=(octave-3)*12+c
STORE (octave-3)*12+cs TO cs6,db6
d6=(octave-3)*12+d
STORE (octave-3)*12+ds TO ds6,eb6
e6=(octave-3)*12+e
f6=(octave-3)*12+f
STORE (octave-3)*12+fs TO fs6,gb6
g6=(octave-3)*12+g
STORE (octave-3)*12+gs TO gs6,ab6
a6=(octave-3)*12+a
STORE (octave-3)*12+as TO as6,bb6
b6=(octave-3)*12+b


********************
* Repeated 4 times with different instruments
FOR lni = 1 TO 4
* Instruments
	DO CASE
	CASE lni = 1
		loMidi.ChangePatch(41,0)
		loMidi.ChangePatch(73,1)
	CASE lni = 2
		loMidi.ChangePatch(33,0)
		loMidi.ChangePatch(34,1)
	CASE lni = 3
		loMidi.ChangePatch(54,0)
		loMidi.ChangePatch(50,1)
	CASE lni = 4
		loMidi.ChangePatch(94,0)
		loMidi.ChangePatch(52,1)
	ENDCASE

	loMidi.PlayNote(c0,volume1,0)
	loMidi.PlayNote(c0,volume1,0)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(c0,0)
	loMidi.StopNote(c4,1)

	loMidi.PlayNote(c0,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(a5,volume1,1)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit*3/8)
	loMidi.StopNote(c0,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(a5,1)
	loMidi.StopNote(f5,1)

	loMidi.PlayNote(c0,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(bb5,volume1,1)
	loMidi.PlayNote(g5,volume1,1)
	loMidi.Pause(unit/8)
	loMidi.StopNote(c0,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(bb5,1)
	loMidi.StopNote(g5,1)

	loMidi.PlayNote(c0,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(a5,volume1,1)
	loMidi.PlayNote(a5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(c0,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(a5,1)

	loMidi.PlayNote(a0,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(a0,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(c4,1)
	loMidi.StopNote(f5,1)

	loMidi.PlayNote(g0,volume1,0)
	loMidi.PlayNote(e0,volume1,0)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.PlayNote(c5,volume1,1)
	loMidi.Pause(unit*3/8)
	loMidi.StopNote(g0,0)
	loMidi.StopNote(e0,0)
	loMidi.StopNote(c4,1)
	loMidi.StopNote(c5,1)

	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(d0,volume1,0)
	loMidi.PlayNote(a5,volume1,1)
	loMidi.PlayNote(c5,volume1,1)
	loMidi.Pause(unit/8)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(d0,0)
	loMidi.StopNote(a5,1)
	loMidi.StopNote(c5,1)

	loMidi.PlayNote(g0,volume1,0)
	loMidi.PlayNote(e0,volume1,0)
	loMidi.PlayNote(bb5,volume1,1)
	loMidi.PlayNote(c5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(g0,0)
	loMidi.StopNote(e0,0)
	loMidi.StopNote(bb5,1)
	loMidi.StopNote(c5,1)

	loMidi.PlayNote(a0,volume1,0)
	loMidi.PlayNote(e0,volume1,0)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.PlayNote(c5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(a0,0)
	loMidi.StopNote(e0,0)
	loMidi.StopNote(c4,1)
	loMidi.StopNote(c5,1)



	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(a5,volume1,1)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit*3/8)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(a5,1)
	loMidi.StopNote(f5,1)

	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(a5,volume1,1)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit/8)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(a5,1)
	loMidi.StopNote(f5,1)

	loMidi.PlayNote(a0,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(a0,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(c4,1)
	loMidi.StopNote(f5,1)

	loMidi.PlayNote(c1,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(a5,volume1,1)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(c1,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(a5,1)
	loMidi.StopNote(f5,1)

	loMidi.PlayNote(d1,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(bb5,volume1,1)
	loMidi.PlayNote(bb5,volume1,1)
	loMidi.Pause(unit*3/4-unit/16)
	loMidi.StopNote(d1,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(bb5,1)


	loMidi.Pause(unit/8)


	loMidi.PlayNote(d1,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(bb5,volume1,1)
	loMidi.PlayNote(bb5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(d1,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(bb5,1)

	loMidi.PlayNote(c1,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(a5,volume1,1)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.Pause(unit*3/8)
	loMidi.StopNote(c1,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(a5,1)
	loMidi.StopNote(c4,1)

	loMidi.PlayNote(a0,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit/8)
	loMidi.StopNote(a0,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(c4,1)
	loMidi.StopNote(f5,1)

	loMidi.PlayNote(a0,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(a0,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(c4,1)
	loMidi.StopNote(f5,1)

	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(a5,volume1,1)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(a5,1)
	loMidi.StopNote(f5,1)

	loMidi.PlayNote(g0,volume1,0)
	loMidi.PlayNote(e0,volume1,0)
	loMidi.PlayNote(c5,volume1,1)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.Pause(unit*3/8)
	loMidi.StopNote(g0,0)
	loMidi.StopNote(e0,0)
	loMidi.StopNote(c5,1)
	loMidi.StopNote(c4,1)

	loMidi.PlayNote(d0,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(a5,volume1,1)
	loMidi.PlayNote(c5,volume1,1)
	loMidi.Pause(unit/8)
	loMidi.StopNote(d0,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(a5,1)
	loMidi.StopNote(c5,1)

	loMidi.PlayNote(g0,volume1,0)
	loMidi.PlayNote(e0,volume1,0)
	loMidi.PlayNote(bb5,volume1,1)
	loMidi.PlayNote(c5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(g0,0)
	loMidi.StopNote(e0,0)
	loMidi.StopNote(bb5,1)
	loMidi.StopNote(c5,1)

	loMidi.PlayNote(a0,volume1,0)
	loMidi.PlayNote(e0,volume1,0)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.PlayNote(c5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(a0,0)
	loMidi.StopNote(e0,0)
	loMidi.StopNote(c4,1)
	loMidi.StopNote(c5,1)

	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(d0,volume1,0)
	loMidi.PlayNote(a5,volume1,1)
	loMidi.PlayNote(d5,volume1,1)
	loMidi.Pause(unit*3/8)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(d0,0)
	loMidi.StopNote(a5,1)
	loMidi.StopNote(d5,1)

	loMidi.PlayNote(d0,volume1,0)
	loMidi.PlayNote(a4,volume1,0)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.PlayNote(d5,volume1,1)
	loMidi.Pause(unit/8)
	loMidi.StopNote(d0,0)
	loMidi.StopNote(a4,0)
	loMidi.StopNote(f5,1)
	loMidi.StopNote(d5,1)

	loMidi.PlayNote(bb4,volume1,0)
	loMidi.PlayNote(d0,volume1,0)
	loMidi.PlayNote(bb6,volume1,1)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(bb4,0)
	loMidi.StopNote(d0,0)
	loMidi.StopNote(bb6,1)
	loMidi.StopNote(f5,1)

	loMidi.PlayNote(bb4,volume1,0)
	loMidi.PlayNote(c0,volume1,0)
	loMidi.PlayNote(e5,volume1,1)
	loMidi.PlayNote(c5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(bb4,0)
	loMidi.StopNote(c0,0)
	loMidi.StopNote(e5,1)
	loMidi.StopNote(c5,1)

	loMidi.PlayNote(a4,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.PlayNote(f6,volume1,1)
	loMidi.Pause(unit*3/4-unit/16)
	loMidi.StopNote(a4,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(f5,1)
	loMidi.StopNote(f6,1)


	loMidi.Pause(unit/8)




	loMidi.PlayNote(d1,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(bb5,volume1,1)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(d1,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(bb5,1)
	loMidi.StopNote(f5,1)

	loMidi.PlayNote(c1,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(a5,volume1,1)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit*3/8)
	loMidi.StopNote(c1,0)
	*loMidi.StopNote(f0,0)
	loMidi.StopNote(a5,1)
	*loMidi.StopNote(f5,1)

	loMidi.PlayNote(a0,volume1,0)
	*loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(c4,volume1,1)
	*loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit/8)
	loMidi.StopNote(a0,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(c4,1)
	loMidi.StopNote(f5,1)

	loMidi.PlayNote(a0,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(a0,0)
	*loMidi.StopNote(f0,0)
	*loMidi.StopNote(c4,1)
	loMidi.StopNote(f5,1)

	*loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(a5,volume1,1)
	*loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(a6,1)
	loMidi.StopNote(c4,1)

	loMidi.PlayNote(g0,volume1,0)
	loMidi.PlayNote(e0,volume1,0)
	loMidi.PlayNote(c5,volume1,1)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.Pause(unit*3/8)
	loMidi.StopNote(g0,0)
	loMidi.StopNote(e0,0)
	loMidi.StopNote(c5,1)
	loMidi.StopNote(c4,1)

	loMidi.PlayNote(d0,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(a5,volume1,1)
	loMidi.PlayNote(c5,volume1,1)
	loMidi.Pause(unit/8)
	loMidi.StopNote(d0,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(a5,1)
	loMidi.StopNote(c5,1)

	loMidi.PlayNote(g0,volume1,0)
	loMidi.PlayNote(e0,volume1,0)
	loMidi.PlayNote(bb5,volume1,1)
	loMidi.PlayNote(c5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(g0,0)
	loMidi.StopNote(e0,0)
	loMidi.StopNote(bb5,1)
	loMidi.StopNote(c5,1)

	loMidi.PlayNote(d1,volume1,0)
	loMidi.PlayNote(e0,volume1,0)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.PlayNote(c5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(d1,0)
	loMidi.StopNote(e0,0)
	loMidi.StopNote(c4,1)
	loMidi.StopNote(c5,1)

	loMidi.PlayNote(c1,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(a5,volume1,1)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit*3/8)
	loMidi.StopNote(c1,0)
	*loMidi.StopNote(f0,0)
	loMidi.StopNote(a5,1)
	*loMidi.StopNote(f5,1)

	loMidi.PlayNote(a0,volume1,0)
	*loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(c4,volume1,1)
	*loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit/8)
	loMidi.StopNote(a0,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(f5,1)
	loMidi.StopNote(c4,1)

	loMidi.PlayNote(a0,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(a0,0)
	*loMidi.StopNote(f0,0)
	loMidi.StopNote(c4,1)
	*loMidi.StopNote(f5,1)

	loMidi.PlayNote(c1,volume1,0)
	*loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(a5,volume1,1)
	*loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(c1,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(a5,1)
	loMidi.StopNote(f5,1)

	loMidi.PlayNote(d1,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(bb5,volume1,1)
	loMidi.PlayNote(bb5,volume1,1)
	loMidi.Pause(unit*3/4-unit/16)
	loMidi.StopNote(d1,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(bb5,1)


	loMidi.Pause(unit/8)





	loMidi.PlayNote(f1,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(d4,volume1,1)
	loMidi.PlayNote(bb5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(f1,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(d4,1)
	loMidi.StopNote(bb5,1)

	loMidi.PlayNote(c1,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(a5,volume1,1)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.Pause(unit*3/8)
	loMidi.StopNote(c1,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(a5,1)
	loMidi.StopNote(c4,1)

	loMidi.PlayNote(a0,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit/8)
	loMidi.StopNote(a0,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(c4,1)
	loMidi.StopNote(f5,1)

	loMidi.PlayNote(a0,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(a0,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(c4,1)
	loMidi.StopNote(f5,1)

	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(c0,volume1,0)
	loMidi.PlayNote(a6,volume1,1)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(c0,0)
	loMidi.StopNote(a6,1)
	loMidi.StopNote(f5,1)

	loMidi.PlayNote(g0,volume1,0)
	loMidi.PlayNote(e0,volume1,0)
	loMidi.PlayNote(c5,volume1,1)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.Pause(unit*3/8)
	loMidi.StopNote(g0,0)
	loMidi.StopNote(e0,0)
	loMidi.StopNote(c5,1)
	loMidi.StopNote(c4,1)

	loMidi.PlayNote(d0,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.PlayNote(c5,volume1,1)
	loMidi.Pause(unit/8)
	loMidi.StopNote(d0,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(c4,1)
	loMidi.StopNote(c5,1)

	loMidi.PlayNote(g0,volume1,0)
	loMidi.PlayNote(e0,volume1,0)
	loMidi.PlayNote(c4,volume1,1)
	loMidi.PlayNote(c5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(g0,0)
	loMidi.StopNote(e0,0)
	loMidi.StopNote(c4,1)
	loMidi.StopNote(c5,1)

	loMidi.PlayNote(a0,volume1,0)
	loMidi.PlayNote(e0,volume1,0)
	loMidi.PlayNote(a5,volume1,1)
	loMidi.PlayNote(cs5,volume1,1)
	loMidi.Pause(unit/8)
	loMidi.StopNote(a0,0)
	*loMidi.StopNote(e0,0)
	*loMidi.StopNote(a5,1)
	*loMidi.StopNote(cs5,1)

	loMidi.PlayNote(g0,volume1,0)
	loMidi.Pause(unit/8)
	loMidi.StopNote(g0,0)
	loMidi.StopNote(e0,0)
	loMidi.StopNote(a5,1)
	loMidi.StopNote(cs5,1)

	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(d0,volume1,0)
	loMidi.PlayNote(a5,volume1,1)
	loMidi.PlayNote(d5,volume1,1)
	loMidi.Pause(unit*3/8)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(d0,0)
	loMidi.StopNote(a5,1)
	*loMidi.StopNote(d5,1)

	loMidi.PlayNote(d0,volume1,0)
	loMidi.PlayNote(a4,volume1,0)
	loMidi.PlayNote(f5,volume1,1)
	*loMidi.PlayNote(d5,volume1,1)
	loMidi.Pause(unit/8)
	loMidi.StopNote(d0,0)
	loMidi.StopNote(a4,0)
	loMidi.StopNote(f5,1)
	loMidi.StopNote(d5,1)

	loMidi.PlayNote(bb4,volume1,0)
	loMidi.PlayNote(d0,volume1,0)
	loMidi.PlayNote(bb6,volume1,1)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.Pause(unit/4)
	*loMidi.StopNote(bb4,0)
	loMidi.StopNote(d0,0)
	loMidi.StopNote(bb6,1)
	loMidi.StopNote(f5,1)

	*loMidi.PlayNote(bb4,volume1,0)
	loMidi.PlayNote(c0,volume1,0)
	loMidi.PlayNote(e5,volume1,1)
	loMidi.PlayNote(c5,volume1,1)
	loMidi.Pause(unit/4)
	loMidi.StopNote(bb4,0)
	loMidi.StopNote(c0,0)
	loMidi.StopNote(e5,1)
	loMidi.StopNote(c5,1)

	loMidi.PlayNote(a4,volume1,0)
	loMidi.PlayNote(f0,volume1,0)
	loMidi.PlayNote(f5,volume1,1)
	loMidi.PlayNote(f6,volume1,1)
	loMidi.Pause(unit*3/4)
	loMidi.StopNote(a4,0)
	loMidi.StopNote(f0,0)
	loMidi.StopNote(f5,1)
	loMidi.StopNote(f6,1)
NEXT

RETURN .T.


*************
* News2News *
*************
DEFINE CLASS TMidiNote As Session
#DEFINE MIDI_STATUS_PLAYNOTE 9
#DEFINE MIDI_STATUS_PATCH 12
PROTECTED hDevice, channel
    hDevice=0
    channel=0
 
PROCEDURE Init(lDeclare)
    THIS.declare
    IF NOT THIS.OpenDevice()
        RETURN .F.
    ENDIF
 
PROCEDURE Destroy
    THIS.CloseDevice
 
PROTECTED FUNCTION OpenDevice() As Boolean
    IF midiOutGetNumDevs() = 0
        MESSAGEBOX("No Midi Devices found.",;
            48, "MIDI Error")
        RETURN .F.
    ENDIF
 
    LOCAL hDevice, nResult
    hDevice=0
    nResult = midiOutOpen(@hDevice, 0,0,0,0)
    THIS.hDevice = m.hDevice
    IF nResult <> 0
        MESSAGEBOX("Call to midiOutOpen failed: " +;
            TRANSFORM(nResult), 48, "MIDI Error")
    ENDIF
RETURN (m.nResult=0)
 
PROTECTED PROCEDURE CloseDevice
    IF THIS.hDevice <> 0
        = midiOutReset(THIS.hDevice)
        = midiOutClose(THIS.hDevice)
        THIS.hDevice = 0
    ENDIF
 
PROCEDURE SendMIDICommand(b1, b2, b3, b4, nchan)
    IF THIS.hDevice <> 0
        LOCAL nMsg, nResult
        IF PCOUNT()=4
            nMsg = THIS.channel + BITLSHIFT(m.b1,4) +BITLSHIFT(m.b2,8) +BITLSHIFT(m.b3,16) + BITLSHIFT(m.b4,24)
            nResult = midiOutShortMsg(THIS.hDevice, m.nMsg)
           ELSE
            nMsg = nchan + BITLSHIFT(m.b1,4) +BITLSHIFT(m.b2,8) +BITLSHIFT(m.b3,16) + BITLSHIFT(m.b4,24)
            nResult = midiOutShortMsg(THIS.hDevice, m.nMsg)
           ENDIF
           IF nResult <> 0
               MESSAGEBOX("Call to midiOutShortMsg failed: " +TRANSFORM(nResult), 48, "MIDI Error")
        ENDIF
    ENDIF

PROCEDURE PlayNote(nNote, nVelocity, nchan)
    IF PCOUNT()=2
        nchan=0
    ENDIF
    THIS.SendMIDICommand(MIDI_STATUS_PLAYNOTE,nNote, nVelocity, 0,nchan)
 
PROCEDURE StopNote(nNote, nchan)
    IF PCOUNT()=1
        nchan=0
    ENDIF
    THIS.SendMIDICommand(MIDI_STATUS_PLAYNOTE,m.nNote, 0, 0, nchan)
 
PROCEDURE ChangePatch(nPatchNo, nchan)
    IF PCOUNT()=1
        nchan=0
    ENDIF
    THIS.SendMIDICommand(MIDI_STATUS_PATCH,nPatchNo, 0, 0, nchan)
 
PROCEDURE Pause(dwMilliseconds)
	Sleep(dwMilliseconds)
ENDPROC

PROCEDURE declare
    DECLARE INTEGER midiOutGetNumDevs IN Winmm
    DECLARE INTEGER midiOutClose IN Winmm INTEGER hmo  
    DECLARE INTEGER midiOutReset IN Winmm INTEGER hmo  
    DECLARE Sleep IN kernel32 INTEGER dwMilliseconds
 
    DECLARE INTEGER midiOutOpen IN Winmm;
        INTEGER @lphmo, INTEGER uDeviceID, INTEGER dwCallback,;
        INTEGER dwCallbackInstance, INTEGER dwFlags
 
    DECLARE INTEGER midiOutShortMsg IN Winmm;
        INTEGER hmo, LONG dwMsg    
 
ENDDEFINE

Respectfully,
Vilhelm-Ion Praisach
Resita, Romania
 
My best wishes for you! Happy Birthday!
Code:
* [URL unfurl="true"]http://www.8notes.com/scores/1110.asp[/URL]
LOCAL loMidi
loMidi=CREATEOBJECT("TMidiNote")
LOCAL lni,unit,octave,octave1,octave2,octave3,c,cs,d,ds,e,f,fs,g,gs,a,as,b,db,eb,gb,ab,bb,volume1,volume2,lnTimes
LOCAL octave
LOCAL c,cs,d,ds,e,f,fs,g,gs,a,as,b,db,eb,gb,ab,bb
* normal
LOCAL c0,cs0,d0,ds0,e0,f0,fs0,g0,gs0,a0,as0,b0,db0,eb0,gb0,ab0,bb0
* acut
LOCAL c1,cs1,d1,ds1,e1,f1,fs1,g1,gs1,a1,as1,b1,db1,eb1,gb1,ab1,bb1
LOCAL c2,cs2,d2,ds2,e2,f2,fs2,g2,gs2,a2,as2,b2,db2,eb2,gb2,ab2,bb2
LOCAL c3,cs3,d3,ds3,e3,f3,fs3,g3,gs3,a3,as3,b3,db3,eb3,gb3,ab3,bb3
* grav
LOCAL c4,cs4,d4,ds4,e4,f4,fs4,g4,gs4,a4,as4,b4,db4,eb4,gb4,ab4,bb4
LOCAL c5,cs5,d5,ds5,e5,f5,fs5,g5,gs5,a5,as5,b5,db5,eb5,gb5,ab5,bb5
LOCAL c6,cs6,d6,ds6,e6,f6,fs6,g6,gs6,a6,as6,b6,db6,eb6,gb6,ab6,bb6
DOEVENTS
* Instruments
loMidi.ChangePatch(94,0)
loMidi.ChangePatch(2,1)
* semibreve=2 seconds
unit=2000
* volume
volume1=100
volume2=130
*octava
octave=5
* a=la,b=si,c=do, etc. cs=do diez db=do bemol
c=0
STORE 1 TO cs,db
d=2
STORE 3 TO ds,eb
e=4
f=5
STORE 6 TO fs,gb
g=7
STORE 8 TO gs,ab
a=9
STORE 10 TO as,bb
b=11
* normal
c0=octave*12+c
STORE octave*12+cs TO cs0,db0
d0=octave*12+d
STORE octave*12+ds TO ds0,eb0
e0=octave*12+e
f0=octave*12+f
STORE octave*12+fs TO fs0,gb0
g0=octave*12+g
STORE octave*12+gs TO gs0,ab0
a0=octave*12+a
STORE octave*12+as TO as0,bb0
b0=octave*12+b
* acut
c1=(octave+1)*12+c
STORE (octave+1)*12+cs TO cs1,db1
d1=(octave+1)*12+d
STORE (octave+1)*12+ds TO ds1,eb1
e1=(octave+1)*12+e
f1=(octave+1)*12+f
STORE (octave+1)*12+fs TO fs1,gb1
g1=(octave+1)*12+g
STORE (octave+1)*12+gs TO gs1,ab1
a1=(octave+1)*12+a
STORE (octave+1)*12+as TO as1,bb1
b1=(octave+1)*12+b

c2=(octave+2)*12+c
STORE (octave+2)*12+cs TO cs2,db2
d2=(octave+2)*12+d
STORE (octave+2)*12+ds TO ds2,eb2
e2=(octave+2)*12+e
f2=(octave+2)*12+f
STORE (octave+2)*12+fs TO fs2,gb2
g2=(octave+2)*12+g
STORE (octave+2)*12+gs TO gs2,ab2
a2=(octave+2)*12+a
STORE (octave+2)*12+as TO as2,bb2
b2=(octave+2)*12+b

c3=(octave+3)*12+c
STORE (octave+3)*12+cs TO cs3,db3
d3=(octave+3)*12+d
STORE (octave+3)*12+ds TO ds3,eb3
e3=(octave+3)*12+e
f3=(octave+3)*12+f
STORE (octave+3)*12+fs TO fs3,gb3
g3=(octave+3)*12+g
STORE (octave+3)*12+gs TO gs3,ab3
a3=(octave+3)*12+a
STORE (octave+3)*12+as TO as3,bb3
b3=(octave+3)*12+b

*grav
c4=(octave-1)*12+c
STORE (octave-1)*12+cs TO cs4,db4
d4=(octave-1)*12+d
STORE (octave-1)*12+ds TO ds4,eb4
e4=(octave-1)*12+e
f4=(octave-1)*12+f
STORE (octave-1)*12+fs TO fs4,gb4
g4=(octave-1)*12+g
STORE (octave-1)*12+gs TO gs4,ab4
a4=(octave-1)*12+a
STORE (octave-1)*12+as TO as4,bb4
b4=(octave-1)*12+b

c5=(octave-2)*12+c
STORE (octave-2)*12+cs TO cs5,db5
d5=(octave-2)*12+d
STORE (octave-2)*12+ds TO ds5,eb5
e5=(octave-2)*12+e
f5=(octave-2)*12+f
STORE (octave-2)*12+fs TO fs5,gb5
g5=(octave-2)*12+g
STORE (octave-2)*12+gs TO gs5,ab5
a5=(octave-2)*12+a
STORE (octave-2)*12+as TO as5,bb5
b5=(octave-2)*12+b

c6=(octave-3)*12+c
STORE (octave-3)*12+cs TO cs6,db6
d6=(octave-3)*12+d
STORE (octave-3)*12+ds TO ds6,eb6
e6=(octave-3)*12+e
f6=(octave-3)*12+f
STORE (octave-3)*12+fs TO fs6,gb6
g6=(octave-3)*12+g
STORE (octave-3)*12+gs TO gs6,ab6
a6=(octave-3)*12+a
STORE (octave-3)*12+as TO as6,bb6
b6=(octave-3)*12+b


loMidi.PlayNote(c0,volume1,0)
loMidi.Pause(unit*3/16)
loMidi.StopNote(c0,0)

loMidi.PlayNote(c0,volume1,0)
loMidi.Pause(unit/16)
loMidi.StopNote(c0,0)

loMidi.PlayNote(d0,volume1,0)
loMidi.PlayNote(a5,volume1,1)
loMidi.PlayNote(f5,volume1,1)
loMidi.Pause(unit/4)
loMidi.StopNote(d0,0)

loMidi.PlayNote(c0,volume1,0)
loMidi.Pause(unit/4)
loMidi.StopNote(c0,0)

loMidi.PlayNote(f0,volume1,0)
loMidi.Pause(unit/4)
loMidi.StopNote(f0,0)
loMidi.StopNote(a5,1)
loMidi.StopNote(f5,1)

loMidi.PlayNote(e0,volume1,0)
loMidi.PlayNote(bb5,volume1,1)
loMidi.PlayNote(c5,volume1,1)
loMidi.Pause(unit/2)
loMidi.StopNote(e0,0)

loMidi.PlayNote(c0,volume1,0)
loMidi.Pause(unit*3/16)
loMidi.StopNote(c0,0)

loMidi.PlayNote(c0,volume1,0)
loMidi.Pause(unit/16)
loMidi.StopNote(c0,0)
loMidi.StopNote(bb5,1)
loMidi.StopNote(c5,1)

loMidi.PlayNote(d0,volume1,0)
loMidi.PlayNote(bb5,volume1,1)
loMidi.PlayNote(c5,volume1,1)
loMidi.Pause(unit/4)
loMidi.StopNote(d0,0)

loMidi.PlayNote(c0,volume1,0)
loMidi.Pause(unit/4)
loMidi.StopNote(c0,0)

loMidi.PlayNote(g0,volume1,0)
loMidi.Pause(unit/4)
loMidi.StopNote(g0,0)
loMidi.StopNote(bb5,1)
loMidi.StopNote(c5,1)

loMidi.PlayNote(f0,volume1,0)
loMidi.PlayNote(a5,volume1,1)
loMidi.PlayNote(f5,volume1,1)
loMidi.Pause(unit/2)
loMidi.StopNote(f0,0)

loMidi.PlayNote(c0,volume1,0)
loMidi.Pause(unit*3/16)
loMidi.StopNote(c0,0)

loMidi.PlayNote(c0,volume1,0)
loMidi.Pause(unit/16)
loMidi.StopNote(c0,0)
loMidi.StopNote(a5,1)
loMidi.StopNote(f5,1)

loMidi.PlayNote(c1,volume1,0)
loMidi.PlayNote(a5,volume1,1)
loMidi.PlayNote(f5,volume1,1)
loMidi.Pause(unit/4)
loMidi.StopNote(c1,0)

loMidi.PlayNote(a0,volume1,0)
loMidi.Pause(unit/4)
loMidi.StopNote(a0,0)

loMidi.PlayNote(f0,volume1,0)
loMidi.Pause(unit/4)
loMidi.StopNote(f0,0)
loMidi.StopNote(a5,1)
loMidi.StopNote(f5,1)

loMidi.PlayNote(e0,volume1,0)
loMidi.PlayNote(bb5,volume1,1)
loMidi.PlayNote(f5,volume1,1)
loMidi.Pause(unit/4)
loMidi.StopNote(e0,0)

loMidi.PlayNote(d0,volume1,0)
loMidi.Pause(unit/4+unit/8)
loMidi.StopNote(d0,0)
loMidi.StopNote(bb5,1)
loMidi.StopNote(f5,1)

loMidi.Pause(unit/8)

loMidi.PlayNote(bb5,volume1,1)
loMidi.PlayNote(f5,volume1,1)
loMidi.PlayNote(bb0,volume1,0)
loMidi.Pause(unit*3/16)
loMidi.StopNote(bb0,0)

loMidi.PlayNote(bb0,volume1,0)
loMidi.Pause(unit/16)
loMidi.StopNote(bb0,0)
loMidi.StopNote(bb5,1)
loMidi.StopNote(f5,1)

loMidi.PlayNote(a0,volume1,0)
loMidi.PlayNote(a5,volume1,1)
loMidi.PlayNote(f5,volume1,1)
loMidi.Pause(unit/4)
loMidi.StopNote(a0,0)

loMidi.PlayNote(f0,volume1,0)
loMidi.Pause(unit/4)
loMidi.StopNote(f0,0)
loMidi.StopNote(a5,1)
loMidi.StopNote(f5,1)

loMidi.PlayNote(g0,volume1,0)
loMidi.PlayNote(bb5,volume1,1)
loMidi.PlayNote(c5,volume1,1)
loMidi.Pause(unit/4)
loMidi.StopNote(g0,0)
loMidi.StopNote(bb5,1)
loMidi.StopNote(c5,1)

loMidi.PlayNote(f0,volume1,0)
loMidi.PlayNote(a5,volume1,1)
loMidi.PlayNote(f5,volume1,1)
loMidi.Pause(unit*3/4)
loMidi.StopNote(f0,0)
loMidi.StopNote(a5,1)
loMidi.StopNote(f5,1)

RETURN .T.


*************
* News2News *
*************
DEFINE CLASS TMidiNote As Session
#DEFINE MIDI_STATUS_PLAYNOTE 9
#DEFINE MIDI_STATUS_PATCH 12
PROTECTED hDevice, channel
    hDevice=0
    channel=0
 
PROCEDURE Init(lDeclare)
    THIS.declare
    IF NOT THIS.OpenDevice()
        RETURN .F.
    ENDIF
 
PROCEDURE Destroy
    THIS.CloseDevice
 
PROTECTED FUNCTION OpenDevice() As Boolean
    IF midiOutGetNumDevs() = 0
        MESSAGEBOX("No Midi Devices found.",;
            48, "MIDI Error")
        RETURN .F.
    ENDIF
 
    LOCAL hDevice, nResult
    hDevice=0
    nResult = midiOutOpen(@hDevice, 0,0,0,0)
    THIS.hDevice = m.hDevice
    IF nResult <> 0
        MESSAGEBOX("Call to midiOutOpen failed: " +;
            TRANSFORM(nResult), 48, "MIDI Error")
    ENDIF
RETURN (m.nResult=0)
 
PROTECTED PROCEDURE CloseDevice
    IF THIS.hDevice <> 0
        = midiOutReset(THIS.hDevice)
        = midiOutClose(THIS.hDevice)
        THIS.hDevice = 0
    ENDIF
 
PROCEDURE SendMIDICommand(b1, b2, b3, b4, nchan)
    IF THIS.hDevice <> 0
        LOCAL nMsg, nResult
        IF PCOUNT()=4
            nMsg = THIS.channel + BITLSHIFT(m.b1,4) +BITLSHIFT(m.b2,8) +BITLSHIFT(m.b3,16) + BITLSHIFT(m.b4,24)
            nResult = midiOutShortMsg(THIS.hDevice, m.nMsg)
           ELSE
            nMsg = nchan + BITLSHIFT(m.b1,4) +BITLSHIFT(m.b2,8) +BITLSHIFT(m.b3,16) + BITLSHIFT(m.b4,24)
            nResult = midiOutShortMsg(THIS.hDevice, m.nMsg)
           ENDIF
           IF nResult <> 0
               MESSAGEBOX("Call to midiOutShortMsg failed: " +TRANSFORM(nResult), 48, "MIDI Error")
        ENDIF
    ENDIF

PROCEDURE PlayNote(nNote, nVelocity, nchan)
    IF PCOUNT()=2
        nchan=0
    ENDIF
    THIS.SendMIDICommand(MIDI_STATUS_PLAYNOTE,nNote, nVelocity, 0,nchan)
 
PROCEDURE StopNote(nNote, nchan)
    IF PCOUNT()=1
        nchan=0
    ENDIF
    THIS.SendMIDICommand(MIDI_STATUS_PLAYNOTE,m.nNote, 0, 0, nchan)
 
PROCEDURE ChangePatch(nPatchNo, nchan)
    IF PCOUNT()=1
        nchan=0
    ENDIF
    THIS.SendMIDICommand(MIDI_STATUS_PATCH,nPatchNo, 0, 0, nchan)
 
PROCEDURE Pause(dwMilliseconds)
	Sleep(dwMilliseconds)
ENDPROC

PROCEDURE declare
    DECLARE INTEGER midiOutGetNumDevs IN Winmm
    DECLARE INTEGER midiOutClose IN Winmm INTEGER hmo  
    DECLARE INTEGER midiOutReset IN Winmm INTEGER hmo  
    DECLARE Sleep IN kernel32 INTEGER dwMilliseconds
 
    DECLARE INTEGER midiOutOpen IN Winmm;
        INTEGER @lphmo, INTEGER uDeviceID, INTEGER dwCallback,;
        INTEGER dwCallbackInstance, INTEGER dwFlags
 
    DECLARE INTEGER midiOutShortMsg IN Winmm;
        INTEGER hmo, LONG dwMsg    
 
ENDDEFINE

Respectfully,
Vilhelm-Ion Praisach
Resita, Romania
 
In my first career, I was a classically-trained clarinetist.

I salute you, sir!
 
It's an honor to me!

The sounds can be easily modified.
1 Instruments
loMidi.ChangePatch(94,0)
- first parameter is the instrument (integer, range 0 -127); 94 is human voices 'oh' or 'ah', 0,1,2 are different kind of pianos and so on
- the second parameter is the channel 0 (Happy birthday is programmed on two channels, which means two different instruments)

2 The speed or tempo
* semibreve=2 seconds
unit=2000
I guess it's obvious what can do

3 The sound volume
volume1=100
I guess it's obvious what can do

4 The pitch of the sound
*octava
octave=5
A higher number means a more acute sound

5 If you want to translate to another scale, alter these:
* a=la,b=si,c=do, etc. cs=do diez db=do bemol
c=0
STORE 1 TO cs,db
d=2
STORE 3 TO ds,eb
e=4
f=5
STORE 6 TO fs,gb
g=7
STORE 8 TO gs,ab
a=9
STORE 10 TO as,bb
b=11

adding 1 alter up with a semitone


Respectfully,
Vilhelm-Ion Praisach
Resita, Romania
 
Yes, happy birthday John Fox aka Foxegg. Our birthdays are quite near, I had birthday on 28th.

And another dance with the stars...

Bye, Olaf.
 
That is simply awesome....

I particularly like the comment "The sounds can be easily modified."... EASY !!!! are you kidding...and here am I still trying to work out Views and Database Containers.

What a great last week of the year (including a birthday) I have had.

All I can say is

Code:
THANK GOD THAT ALL I ASKED FOR WAS 'AULD LANG SYNE' AND THAT I DIDN'T ASK FOR THE ENTIRE WORKS OF BEETHOVEN AS INTERPRETED BY HERBERT VON KARAJAN...

because I would have little doubt that Vilhelm-Ion would have done it.

V-I, You honour us with your work...

Also thanks to everyone else for nudging my VFP knowledge along

John Fox
(a tiny bit older today)

(? Can I give another Star ?)




Sydney, Australia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top