toddswint1
New Member
- Joined
- Jan 31, 2014
- Messages
- 8
Hello,
I am working on a project to dynamically and graphically illustrate a guitar scale on a fretboard and am having an issue that I was hoping one of you could help me with.
In the following sub-procedure I wanted to 1) show an image and play a sound SIMULTANEOUSLY, and 2) pause for predefined number of seconds before executing the next procedure. The idea is to simulate the fingers crawling up the fretboard.
Instead, the code plays the tone immediately and then lags probably for 4 seconds before loading the image corresponding to that tone.
Is there a way to re-order my highly rudimentary code or to completely rewrite it to achieve the desired result of synchronizing the playing of the tone with the displaying of the image? Your help is appreciated!
‘ 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 working on a project to dynamically and graphically illustrate a guitar scale on a fretboard and am having an issue that I was hoping one of you could help me with.
In the following sub-procedure I wanted to 1) show an image and play a sound SIMULTANEOUSLY, and 2) pause for predefined number of seconds before executing the next procedure. The idea is to simulate the fingers crawling up the fretboard.
Instead, the code plays the tone immediately and then lags probably for 4 seconds before loading the image corresponding to that tone.
Is there a way to re-order my highly rudimentary code or to completely rewrite it to achieve the desired result of synchronizing the playing of the tone with the displaying of the image? Your help is appreciated!
‘ 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