toddswint1
New Member
- Joined
- Jan 31, 2014
- Messages
- 8
Hello,
I am building a tool to dynamically and graphically illustrate a guitar scale on a guitar fretboard.
I am trying to achieve the following: On worksheet change event, 1) show image and play sound SIMULTANEOUSLY, and 2) pause for a predefined number of seconds before executing next procedure.
When I run the code below, I hear the tone immediately but the image display is delayed.
How can this rudimentary code be modified to achieve the objective? Your help is much appreciated! Todd
‘ Public Declare PtrSafe Function sndPlaySound32 Lib "winmm.dll" Alias "sndPlaySoundA" _
‘ (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
‘ Sub Speed_Crawl()
' Pause for Crawl selection
‘ Application.Wait (Now + TimeValue("00:00:4"))
‘ End Sub
‘ Sub PLAY_PASS_1_HIGH_E_Fret1()
'
‘ Dim MyPath As String
‘ MyPath = Application.ActiveWorkbook.Path
' LOW E/FRET 1
' MARKER FINGER - NULL
‘ If Range("G259").Value = "" Then
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Pinky").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Index").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Ring").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Middle").Visible = False
‘ End If
' MARKER FINGER - PINKY
‘ If Range("G259").Value = "P" Then
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Pinky").Visible = True
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Index").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Ring").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Middle").Visible = False
‘ End If
' MARKER FINGER - INDEX
‘ If Range("G259").Value = "I" Then
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Pinky").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Index").Visible = True
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Ring").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Middle").Visible = False
‘ End If
' MARKER FINGER - RING
‘ If Range("G259").Value = "R" Then
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Pinky").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Index").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Ring").Visible = True
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Middle").Visible = False
‘ End If
' MARKER FINGER - MIDDLE
‘ If Range("G259").Value = "M" Then
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Pinky").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Index").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Ring").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Middle").Visible = True
‘ End If
‘
' PLAY TONE
' Determine Clean or Heavy Tone
‘ If Range("S69").Value = "CLN" And Range("G259").Value <> "" Then
‘ Application.Run "SoundFile_High_E"
‘ End If
‘ If Range("S69").Value = "HVY" And Range("G259").Value <> "" Then
‘ Application.Run "SoundFile_High_E"
‘ End If
‘ DELAY NEXT PROCEDURE
‘ Call Speed_Crawl
‘ End Sub
I am building a tool to dynamically and graphically illustrate a guitar scale on a guitar fretboard.
I am trying to achieve the following: On worksheet change event, 1) show image and play sound SIMULTANEOUSLY, and 2) pause for a predefined number of seconds before executing next procedure.
When I run the code below, I hear the tone immediately but the image display is delayed.
How can this rudimentary code be modified to achieve the objective? Your help is much appreciated! Todd
‘ Public Declare PtrSafe Function sndPlaySound32 Lib "winmm.dll" Alias "sndPlaySoundA" _
‘ (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
‘ Sub Speed_Crawl()
' Pause for Crawl selection
‘ Application.Wait (Now + TimeValue("00:00:4"))
‘ End Sub
‘ Sub PLAY_PASS_1_HIGH_E_Fret1()
'
‘ Dim MyPath As String
‘ MyPath = Application.ActiveWorkbook.Path
' LOW E/FRET 1
' MARKER FINGER - NULL
‘ If Range("G259").Value = "" Then
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Pinky").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Index").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Ring").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Middle").Visible = False
‘ End If
' MARKER FINGER - PINKY
‘ If Range("G259").Value = "P" Then
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Pinky").Visible = True
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Index").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Ring").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Middle").Visible = False
‘ End If
' MARKER FINGER - INDEX
‘ If Range("G259").Value = "I" Then
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Pinky").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Index").Visible = True
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Ring").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Middle").Visible = False
‘ End If
' MARKER FINGER - RING
‘ If Range("G259").Value = "R" Then
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Pinky").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Index").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Ring").Visible = True
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Middle").Visible = False
‘ End If
' MARKER FINGER - MIDDLE
‘ If Range("G259").Value = "M" Then
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Pinky").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Index").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Ring").Visible = False
‘ ActiveSheet.Shapes("Dot_LowE1_Finger_Middle").Visible = True
‘ End If
‘
' PLAY TONE
' Determine Clean or Heavy Tone
‘ If Range("S69").Value = "CLN" And Range("G259").Value <> "" Then
‘ Application.Run "SoundFile_High_E"
‘ End If
‘ If Range("S69").Value = "HVY" And Range("G259").Value <> "" Then
‘ Application.Run "SoundFile_High_E"
‘ End If
‘ DELAY NEXT PROCEDURE
‘ Call Speed_Crawl
‘ End Sub