Home > Software engineering >  Using VB to do electronic organ to suspend play file
Using VB to do electronic organ to suspend play file

Time:09-20

 Private Sub open_Click () 
Dim As String b
Dim ch (16) As an Integer
Dim Channel As Integer
Dim Temp As String
Dim ChannelNo As Integer
Dim MusicNo As Integer
Dim filename As String
Dim I, j As Long
For j=1 To 16
For I=1 To 3000
Delay (j, I)=1
Next I
Next j
Me.Com monDialog1. ShowOpen
If Me.Com monDialog1. Filename="" Then Exit Sub
Filename=Me.Com monDialog1. Filename
If Dir (filename)="" Then
MsgBox "can't find the file
"The Exit Sub
End the If
The Open filename For Input As # 1

The Do While Not EOF (1)
Input the # 1, b
If InStr (UCase (b), "CHANNEL") & lt;> 0 Then
Temp=Trim (Mid (b, 9, 10))
ChannelNo=Val (Mid (Temp, 1, InStr (Temp, "")))
MusicNo=Val (Mid (Temp, InStr (Temp, ""), 10))
Call midi_outshort (& amp; HB0 + ChannelNo, 0, 0)
Call midi_outshort (& amp; HC0 + ChannelNo, MusicNo, 0)

The Else
The Channel=Val (Mid (b, 14, 2))
Ch (Channel)=ch (Channel) + 1
Sound (Channel, ch (Channel))=Mid (b, 1, 10)
Delay (Channel, ch (Channel))=Val (Mid (b, 11, 3))
End the If
Loop
Close # 1
End Sub

Private Sub play_Click ()
Dim s As String
Dim As Integer I
Dim j As Integer
Dim As Integer k
'the Timer1. Enabled=True
For I=1 To 16
Playch (I)=1
PlaySound (I)=((I, 1)
PlayDelay (I)=Delay (I, 1)
For j=1 To 10
S=Mid (PlaySound (I), j, 1)
If the s & lt;> "" And s & lt;> "" Then StartNote NoteFromkey (Asc (s)), I
Next j
Next I
Call PlaySoundTimer

Private Sub PlaySoundTimer ()
Dim As Integer I
Dim As Integer k
Dim j As Integer
Dim s As String
Flag=True
The Do While flag
K=0
For I=1 To 16
'k=k + PlayDelay (Playch (I))
K=k + PlayDelay (I)
If k=- 16 Then
Flag=False
The Exit Sub
End the If
Next I
For I=1 To 16
If PlayDelay (I) & lt;> 1 Then
If PlayDelay (I)=0 Then
'shut down on a set of
'StopNote NoteFromKey (Asc (Mid (PlaySound (I), 1, 1))), I
For j=1 To 10
S=Mid (PlaySound (I), j, 1)
If the s & lt;> "" And s & lt;> "" Then StopNote NoteFromkey (Asc (s)), I
Next j
Playch (I)=Playch (I) + 1
PlaySound (I)=((I, Playch (I))
PlayDelay (I)=Delay (I, Playch (I))
'open the next set of
'StartNote NoteFromKey (Asc (Mid (PlaySound (I), 1, 1)))
For j=1 To 10
S=Mid (PlaySound (I), j, 1)
If the s & lt;> "" And s & lt;> "" Then StartNote NoteFromkey (Asc (s)), I
Next j

The Else
PlayDelay (I)=PlayDelay (I) - 1
End the If
End the If
Next I
DoEvents
Sleep (DelayTimer)
DoEvents
Loop
End Sub

Private Sub stop_Click ()
Timer1. Enabled=False
Flag=False
DoEvents
If flag=False Then
End the If
End Sub

Want to use the pause command to stop the process of vocal

CodePudding user response:

A heap of broken code, and can not run!
Also not clear the specific what problem, have a fart to use!

CodePudding user response:

Paste the code on the screen describes a problem later released

CodePudding user response:

A good way to tell you, the defect of using vb, you want to suspend them pop up a msgbox

CodePudding user response:

reference 1st floor Chen8013 response:
posted a heap of broken code, and can not run!
Also not clear the specific what problem, have a fart to use!



Ha ha, just look at the beginning, it is this feeling!
  • Related