Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 11th November 2011
Braincode's Avatar
Braincode Braincode is offline
Ceriwis Addicted
 
Join Date: Nov 2011
Posts: 4,638
Rep Power: 20
Braincode mempunyai hidup yang Normal
Default [ask] bagaimana cara membuat midi file dengan vb.net 2003

hi all, I need help. I make code to create midi file with vb.net 2003. it's work but when i play it with windows media player can't play it although it has the same ascii data with the real midi.

thx for the help.

hi semua, aq butuh bantuan, aq buat code untuk membuat midi file dengan vb.net 2003. hasilnya keluar midi tp tidak bisa diplay di winamp ato player yg lain.

bagamana kah cara membuat file midi y?

ini code nya


Code:

Dim writer As StreamWriter = New StreamWriter("Doremi.mid")
Dim hexData(1000000) As String
For x = 0 To 3
If x = 0 Then
hexData(x) = "4D54686400000006000000010080"
ElseIf x = 1 Then
hexData(x) = "4D54726B0000002E"
ElseIf x = 2 Then
hexData(x) = "00C1180091376000903C6081003C00003E6081003E00004060 0091370000913960810090400000913900"
ElseIf x = 3 Then
hexData(x) = "00FF2F00"
End If
writer.Write(Frm.hex2ascii(hexData(x)))
Next
writer.Close()



Public Function hex2ascii(ByVal hextext As String) As String
Dim Panjang As Integer
Dim num, value As String
For Panjang = 1 To Len(hextext) Step 2
num = Mid(hextext, Panjang, 2)
value = value & Chr(Val("&h" & num))
'y += 1
Next
Return value
End Function

aq membuat code dengan mci api tp eror

sistem overflow exception, arithmetic resulted in overflow, yg salah bagian mana y?


Code:

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 Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim play As Integer
play = mciSendString("open C:\Windows\Media\flourish.mid type sequencer alias passport", 0, 0, 0)
play = mciSendString("play passport", 0, 0, 0)
End Sub

terima kasih atas bantuannya..



Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 09:01 AM.


no new posts