Private Sub Command1_Click() Dim absolutetime As Long Dim inbyte As Byte Dim t As Integer Dim plustrigger As Boolean Dim plustriggertime As Long Dim oldinbyte As Byte Dim preread As Byte Dim timebetweentrigger As Long Dim differenz As Long Open _ "D:\programmierung\vb\din_sync\220bpm_cubasis.wav" _ For Binary Access Read As #1 Open _ "D:\programmierung\vb\din_sync\dispersion_cubasis.txt" _ For Output As #2 absolutetime = 0 For t = 1 To 44 Get #1, , preread 'Print preread Next t plustrigger = False oldinbyte = 0 Do While Not EOF(1) oldinbyte = inbyte Get #1, , inbyte absolutetime = absolutetime + 1 differenz = CLng(inbyte) - CLng(oldinbyte) If differenz > 10 Then plustrigger = True timebetweentrigger = absolutetime - plustriggertime plustriggertime = absolutetime If timebetweentrigger > 2 Then Print #2, timebetweentrigger Print inbyte End If Loop Close #1 Close #2 End Sub