Private Declare Function mciSendString
Lib "winmm.dll"
Alias "mciSendStringA" (
ByVal lpstrCommand
As String,
ByVal lpstrReturnString
As String,
ByVal uReturnLength
As Long,
ByVal hwndCallback
As Long)
As Long
Private Sub Form_Load()
midi$ = "4D546864000000060000000100304D54726B0000168C00FF0308756E7469746C656400FF58040402180800FF5902000000FF"
midi$ = midi$ & "510306C81C00C03000B0076400C13000B1076400C25100B2076400922F7F00C35100B3076400C42600B4076400942F7F00C5"
midi$ = midi$ & "2600B5076400C63D00B6076400962F7F00C73D00B7076400C82100B8076400C90000B9077F00C90000B9077F00C90000B907"
midi$ = midi$ & "7F00C90000B9077F24932A7F00952A7F00972A7F05962F0000922F0000942F001F92237F0094237F0096237F03932A000097"
midi$ = midi$ & "2A0000952A002792230000942300009623001E92307F0094307F0096307F063000009430000092300006307F0094307F0096"
midi$ = midi$ & "307F053000009430000092300007307F0094307F0096307F18932F7F00952F7F00972F7F0496300000923000009430001993"
midi$ = midi$ & "2F0000952F0000972F0007922A7F00942A7F00962A7F182A0000942A0000922A000C2F7F00942F7F00962F7F0D2F0000942F"
midi$ = midi$ & "0000922F000B307F0094307F0096307F093000009430000092300003307F0094307F0096307F083000009430000092300004"
midi$ = midi$ & "307F0094307F0096307F09300000943000009230000F307F0094307F0096307F0A3000009430000092300002307F0094307F"
midi$ = midi$ & "0096307F083000009430000092300004307F0094307F0096307F1830000094300000923000002F7F00942F7F00962F7F0099"
midi$ = midi$ & "237F00247F0524000023001C922F0000942F0000962F0003922A7F00942A7F00962A7F0C99237F00247F0524000023001292"
midi$ = midi$ & "2A0000942A0000962A000192237F0094237F0096237F1899237F00247F052400002300129223000094230000962300199230"
midi$ = midi$ & "7F0094307F0096307F0099237F00247F052400009630000092300000943000009923000792307F0094307F0096307F053000"
midi$ = midi$ & "009430000092300007307F0094307F0096307F18932F7F00952F7F00972F7F0099237F00247F052400002300029430000092"
midi$ = midi$ & "30000096300011992A7F052A0005972F0000952F0000932F0002922A7F00942A7F00962A7F0C99237F00247F052400002300"
midi$ = midi$ & "07922A0000942A0000962A000C922F7F00942F7F00962F7F00992A7F052A001393307F0095307F0097307F0099237F00247F"
midi$ = midi$ & "04922F0000962F0000942F00019924000023000693300000953000009730000192307F0094307F0096307F08300000943000"
midi$ = midi$ & "0092300004307F0094307F0096307F00992A7F052A000F92300000943000009630000492307F0094307F0096307F0099237F"
midi$ = midi$ & "00247F0524000023000892300000943000009630000B92307F0094307F0096307F00992A7F052A0013932F7F00952F7F0097"
midi$ = midi$ & "2F7F0099237F00247F01923000009630000094300004992400002300132A7F052A0006972F0000952F0000932F0001922A7F"
midi$ = midi$ & "00942A7F00962A7F0C99237F00247F0524000023001393237F0095237F0097237F00992A7F01922A0000962A0000942A0004"
midi$ = midi$ & "992A0013237F00247F05240000230012952300009723000093230001992A7F052A001392307F0094307F0096307F0099237F"
midi$ = midi$ & "00247F0524000023000192300000943000009630000692307F0094307F0096307F063000009430000092300006307F009430"
midi$ = midi$ & "7F0096307F00992A7F052A0013932F7F00952F7F00972F7F0099237F00247F05240000230001943000009630000092300012"
midi$ = midi$ & "992A7F052A000792237F0094237F0096237F02972F0000932F0000952F000A99237F00247F05240000230010962300009423"
midi$ = midi$ & "0000922300032F7F00942F7F00962F7F00992A7F052A001393307F0095307F0097307F0099237F00247F0524000023000394"
midi$ = midi$ & "2F0000962F0000922F000393300000953000009730000192307F0094307F0096307F083000009430000092300004307F0094"
midi$ = midi$ & "307F0096307F00992A7F052A000492300000943000009630000F92307F0094307F0096307F0099237F00247F052400002300"
midi$ = midi$ & "0892300000943000009630000B92307F0094307F0096307F00992A7F052A0013932F7F00952F7F00972F7F0099237F00247F"
midi$ = midi$ & "03923000009630000094300002992400002300132A7F052A0002972F0000952F0000932F0005922A7F00942A7F00962A7F0C"
midi$ = midi$ & "99237F00247F05240000230010922A0000942A0000962A000392237F0094237F0096237F00992A7F052A0013237F00247F05"
midi$ = midi$ & "2400002300132A7F052A000A92230000942300009623000992307F0094307F0096307F0099237F00247F0524000023000192"
midi$ = midi$ & "300000943000009630000692307F0094307F0096307F053000009430000092300007307F0094307F0096307F00992A7F052A"
midi$ = midi$ & "000B92300000943000009630000892307F0094307F0096307F083000009430000092300004307F0094307F0096307F083000"
midi$ = midi$ & "009430000092300004307F0094307F0096307F103000009430000092300008307F0094307F0096307F083000009430000092"
midi$ = midi$ & "300004307F0094307F0096307F083000009430000092300004307F0094307F0096307F103000009430000092300008307F00"
midi$ = midi$ & "94307F0096307F083000009430000092300004307F0094307F0096307F083000009430000092300004307F0094307F009630"
midi$ = midi$ & "7F103000009430000092300008307F0094307F0096307F083000009430000092300004307F0094307F0096307F0830000094"
midi$ = midi$ & "30000092300004307F0094307F0096307F10300000943000009230000890477F00922F7F00942F7F00962F7F0099237F0024"
midi$ = midi$ & "7F052400002300132A7F052A000791427F00932A7F00952A7F00972A7F05962F0000942F000090470000922F000799237F00"
midi$ = midi$ & "247F00263F05260000230000240013903B7F0092237F0094237F0096237F00992A7F03952A000091420000972A0000932A00"
midi$ = midi$ & "02992A0013237F00247F0524000023000D922300009623000094230000903B0006992A7F052A001390487F0092307F009430"
midi$ = midi$ & "7F0096307F0099237F00247F00263F052600002300002400019430000090480000923000009630000690487F0092307F0094"
midi$ = midi$ & "307F0096307F0530000090480000923000009430000790487F0092307F0094307F0096307F00992A7F052A001391477F0093"
midi$ = midi$ & "2F7F00952F7F00972F7F0099237F00247F0494300000963000009048000092300001992300002400132A7F052A0000932F00"
midi$ = midi$ & "0091470000972F0000952F000790427F00922A7F00942A7F00962A7F0C99237F00247F00263F05260000230000240007942A"
midi$ = midi$ & "000090420000922A0000962A000C90477F00922F7F00942F7F00962F7F00992A7F052A0008942F000090470000922F000096"
midi$ = midi$ & "2F000B90487F0092307F0094307F0096307F0099237F00247F05240000230004943000009048000092300000963000039048"
midi$ = midi$ & "7F0092307F0094307F0096307F0830000090480000923000009430000490487F0092307F0094307F0096307F00992A7F052A"
midi$ = midi$ & "00049430000090480000923000009630000F90487F0092307F0094307F0096307F0099237F00247F00263F05260000230000"
midi$ = midi$ & "2400059430000090480000923000009630000290487F0092307F0094307F0096307F08300000904800009230000094300004"
midi$ = midi$ & "90487F0092307F0094307F0096307F00992A7F052A00139430000090480000923000009630000090477F00922F7F00942F7F"
midi$ = midi$ & "00962F7F0099237F00247F052400002300132A7F052A0004962F000090470000922F0000942F000390427F00922A7F00942A"
midi$ = midi$ & "7F00962A7F0C99237F00247F00263F05260000230000240012942A000090420000922A0000962A0001903B7F0092237F0094"
midi$ = midi$ & "237F0096237F00992A7F052A0013237F00247F0524000023001296230000903B00009223000094230001992A7F052A001390"
midi$ = midi$ & "487F0092307F0094307F0096307F0099237F00247F00263F0526000023000092300000943000009048000099240000963000"
midi$ = midi$ & "0790487F0092307F0094307F0096307F0530000090480000923000009430000790487F0092307F0094307F0096307F00992A"
midi$ = midi$ & "7F052A001391477F00932F7F00952F7F00972F7F0099237F00247F0524000023000296300000904800009430000092300011"
midi$ = midi$ & "992A7F052A0005952F000091470000932F0000972F000290427F00922A7F00942A7F00962A7F0C99237F00247F00263F0526"
midi$ = midi$ & "0000230000240007942A000090420000922A0000962A000C90477F00922F7F00942F7F00962F7F00992A7F052A001391487F"
midi$ = midi$ & "0093307F0095307F0097307F0099237F00247F04942F0000962F000090470000922F00019923000024000695300000914800"
midi$ = midi$ & "00973000009330000190487F0092307F0094307F0096307F0830000090480000923000009430000490487F0092307F009430"
midi$ = midi$ & "7F0096307F00992A7F052A000F9430000090480000923000009630000490487F0092307F0094307F0096307F0099237F0024"
midi$ = midi$ & "7F00263F052600002300002400089430000090480000923000009630000B90487F0092307F0094307F0096307F00992A7F05"
midi$ = midi$ & "2A001391477F00932F7F00952F7F00972F7F0099237F00247F0194300000963000009048000092300004992300002400132A"
midi$ = midi$ & "7F052A0006932F000091470000972F0000952F000190427F00922A7F00942A7F00962A7F0C99237F00247F00263F05260000"
midi$ = midi$ & "230000240013913B7F0093237F0095237F0097237F00992A7F01942A0000962A000090420000922A0004992A0013237F0024"
midi$ = midi$ & "7F05240000230012932300009723000095230000913B0001992A7F052A001390487F0092307F0094307F0096307F0099237F"
midi$ = midi$ & "00247F00263F052600002300002400019430000090480000923000009630000690487F0092307F0094307F0096307F063000"
midi$ = midi$ & "0090480000923000009430000690487F0092307F0094307F0096307F00992A7F052A001391477F00932F7F00952F7F00972F"
midi$ = midi$ & "7F0099237F00247F0524000023000196300000904800009430000092300012992A7F052A0007903B7F0092237F0094237F00"
midi$ = midi$ & "96237F02952F0000972F000091470000932F000A99237F00247F00263F052600002300002400109423000096230000922300"
midi$ = midi$ & "00903B0003477F00922F7F00942F7F00962F7F00992A7F052A001391487F0093307F0095307F0097307F0099237F00247F05"
midi$ = midi$ & "240000230003962F000090470000942F0000922F00039730000091480000933000009530000190487F0092307F0094307F00"
midi$ = midi$ & "96307F0830000090480000923000009430000490487F0092307F0094307F0096307F00992A7F052A00049430000090480000"
midi$ = midi$ & "923000009630000F90487F0092307F0094307F0096307F0099237F00247F00263F0526000023000024000894300000904800"
midi$ = midi$ & "00923000009630000B90487F0092307F0094307F0096307F00992A7F052A001391477F00932F7F00952F7F00972F7F009923"
midi$ = midi$ & "7F00247F0394300000963000009048000092300002992300002400132A7F052A0002932F000091470000972F0000952F0005"
midi$ = midi$ & "90427F00922A7F00942A7F00962A7F0C99237F00247F00263F05260000230000240010942A000090420000922A0000962A00"
midi$ = midi$ & "03903B7F0092237F0094237F0096237F00992A7F052A0013237F00247F052400002300132A7F052A000A94230000903B0000"
midi$ = midi$ & "922300009623000990487F0092307F0094307F0096307F0099237F00247F00263F0526000023000024000194300000904800"
midi$ = midi$ & "00923000009630000690487F0092307F0094307F0096307F0530000090480000923000009430000790487F0092307F009430"
midi$ = midi$ & "7F0096307F00992A7F052A000B9430000090480000923000009630000890487F0092307F0094307F0096307F083000009048"
midi$ = midi$ & "0000923000009430000490487F0092307F0094307F0096307F0830000090480000923000009430000490487F0092307F0094"
midi$ = midi$ & "307F0096307F1030000090480000923000009430000890487F0092307F0094307F0096307F08300000904800009230000094"
midi$ = midi$ & "30000490487F0092307F0094307F0096307F0830000090480000923000009430000490487F0092307F0094307F0096307F10"
midi$ = midi$ & "30000090480000923000009430000890487F0092307F0094307F0096307F0830000090480000923000009430000490487F00"
midi$ = midi$ & "92307F0094307F0096307F0830000090480000923000009430000490487F0092307F0094307F0096307F1030000090480000"
midi$ = midi$ & "923000009430000890487F0092307F0094307F0096307F0830000090480000923000009430000490487F0092307F0094307F"
midi$ = midi$ & "0096307F0830000090480000923000009430000490487F0092307F0094307F0096307F103000009048000092300000943000"
midi$ = midi$ & "0890477F00922F7F00942F7F00962F7F0099237F00247F052400002300132A7F052A000791427F00932A7F00952A7F00972A"
midi$ = midi$ & "7F05962F0000942F000090470000922F000799237F00247F00263F05260000230000240013903B7F0092237F0094237F0096"
midi$ = midi$ & "237F00992A7F03952A000091420000972A0000932A0002992A0013237F00247F0524000023000D9223000096230000942300"
midi$ = midi$ & "00903B0006992A7F052A001390487F0092307F0094307F0096307F0099237F00247F00263F05260000230000240001943000"
midi$ = midi$ & "0090480000923000009630000690487F0092307F0094307F0096307F0530000090480000923000009430000790487F009230"
midi$ = midi$ & "7F0094307F0096307F00992A7F052A001391477F00932F7F00952F7F00972F7F0099237F00247F0494300000963000009048"
midi$ = midi$ & "000092300001992300002400132A7F052A0000932F000091470000972F0000952F000790427F00922A7F00942A7F00962A7F"
midi$ = midi$ & "0C99237F00247F00263F05260000230000240007942A000090420000922A0000962A000C90477F00922F7F00942F7F00962F"
midi$ = midi$ & "7F00992A7F052A0008942F000090470000922F0000962F000B90487F0092307F0094307F0096307F0099237F00247F052400"
midi$ = midi$ & "002300049430000090480000923000009630000390487F0092307F0094307F0096307F083000009048000092300000943000"
midi$ = midi$ & "0490487F0092307F0094307F0096307F00992A7F052A00049430000090480000923000009630000F90487F0092307F009430"
midi$ = midi$ & "7F0096307F0099237F00247F00263F052600002300002400059430000090480000923000009630000290487F0092307F0094"
midi$ = midi$ & "307F0096307F0830000090480000923000009430000490487F0092307F0094307F0096307F00992A7F052A00139430000090"
midi$ = midi$ & "480000923000009630000090477F00922F7F00942F7F00962F7F0099237F00247F052400002300132A7F052A0004962F0000"
midi$ = midi$ & "90470000922F0000942F000390427F00922A7F00942A7F00962A7F0C99237F00247F00263F05260000230000240012942A00"
midi$ = midi$ & "0090420000922A0000962A0001903B7F0092237F0094237F0096237F00992A7F052A0013237F00247F052400002300129623"
midi$ = midi$ & "0000903B00009223000094230001992A7F052A001390487F0092307F0094307F0096307F0099237F00247F00263F05260000"
midi$ = midi$ & "230000923000009430000090480000992400009630000790487F0092307F0094307F0096307F053000009048000092300000"
midi$ = midi$ & "9430000790487F0092307F0094307F0096307F00992A7F052A001391477F00932F7F00952F7F00972F7F0099237F00247F05"
midi$ = midi$ & "24000023000296300000904800009430000092300011992A7F052A0005952F000091470000932F0000972F000290427F0092"
midi$ = midi$ & "2A7F00942A7F00962A7F0C99237F00247F00263F05260000230000240007942A000090420000922A0000962A000C90477F00"
midi$ = midi$ & "922F7F00942F7F00962F7F00992A7F052A001391487F0093307F0095307F0097307F0099237F00247F04942F0000962F0000"
midi$ = midi$ & "90470000922F0001992300002400069530000091480000973000009330000190487F0092307F0094307F0096307F08300000"
midi$ = midi$ & "90480000923000009430000490487F0092307F0094307F0096307F00992A7F052A000F943000009048000092300000963000"
midi$ = midi$ & "0490487F0092307F0094307F0096307F0099237F00247F00263F052600002300002400089430000090480000923000009630"
midi$ = midi$ & "000B90487F0092307F0094307F0096307F00992A7F052A001494300000904800009230000096300000FF2F00"
DelFile "C:\Windows\temp\file.mid"
'Удалили чтоб не получилось что дописываем...
midi$ = Hex2Str(midi$)
'Декодировали
Call SaveToFile(midi$, "C:\Windows\temp\file.mid"
'Сохранили
'И запели...
mciSendString "OPEN C:\Windows\temp\file.mid TYPE SEQUENCER ALIAS file", 0&, 0, 0
mciSendString "PLAY file FROM 0", 0&, 0, 0
mciSendString "CLOSE ANIMATION", 0&, 0, 0
Me.Caption = "Satisfaction !!!"
End Sub
Private Sub SaveToFile(Data$, PathFile
As String)
'Сохранение переменной в файл
On Error GoTo e
n = FreeFile
Open PathFile
For Binary As #n
Put n, , Data$
Close #n
Exit Sub
e:
MsgBox Err.Description, vbCritical, "
Error: " & Err.Number
End Sub
Public Function Hex2Str(str$)
As String
'Декодирование из хекса
For i = 1
To Len(str$)
Step 2
s$ = Val("&H" & (
Mid(str$, i, 2)))
Hex2Str = Hex2Str & Chr(s$)
Next i
End Function
Public Sub DelFile(File
As String)
On Error Resume Next
Kill File$
End Sub
Private Sub Form_QueryUnload(Cancel
As Integer, UnloadMode
As Integer)
mciSendString& "STOP file", 0&, 0, 0
mciSendString& "CLOSE ANIMATION", 0&, 0, 0
End Sub