VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Begin VB.Form frmExtraMidi 
   AutoRedraw      =   -1  'True
   Caption         =   "AutoGuitar"
   ClientHeight    =   5865
   ClientLeft      =   165
   ClientTop       =   855
   ClientWidth     =   9780
   LinkTopic       =   "Form1"
   ScaleHeight     =   5865
   ScaleWidth      =   9780
   StartUpPosition =   3  '系統預設值
   WindowState     =   2  '最大化
   Begin VB.CommandButton cmdFocus 
      Height          =   255
      Left            =   8940
      TabIndex        =   1
      Top             =   -450
      Width           =   315
   End
   Begin VB.Frame fraSet 
      Height          =   555
      Left            =   2160
      TabIndex        =   2
      Top             =   0
      Width           =   8775
      Begin VB.ComboBox cmbDev 
         BackColor       =   &H00FFFFFF&
         BeginProperty Font 
            Name            =   "新細明體"
            Size            =   9.75
            Charset         =   136
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   315
         Left            =   1800
         Style           =   2  '單純下拉式
         TabIndex        =   3
         Top             =   165
         Width           =   2835
      End
      Begin VB.ComboBox cmbSound 
         BackColor       =   &H00FFFFFF&
         BeginProperty Font 
            Name            =   "新細明體"
            Size            =   9.75
            Charset         =   136
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   315
         ItemData        =   "frmExtraMidi.frx":0000
         Left            =   6000
         List            =   "frmExtraMidi.frx":0184
         Style           =   2  '單純下拉式
         TabIndex        =   4
         Top             =   165
         Width           =   1815
      End
      Begin VB.Label lbl 
         Caption         =   "Midi 設備︰"
         BeginProperty Font 
            Name            =   "新細明體"
            Size            =   9.75
            Charset         =   136
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   255
         Index           =   0
         Left            =   780
         TabIndex        =   5
         Top             =   240
         Width           =   1095
      End
      Begin VB.Label lbl 
         Caption         =   "演奏樂器︰"
         BeginProperty Font 
            Name            =   "新細明體"
            Size            =   9.75
            Charset         =   136
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000000&
         Height          =   255
         Index           =   1
         Left            =   4980
         TabIndex        =   6
         Top             =   240
         Width           =   1035
      End
   End
   Begin VB.Timer Timer1 
      Left            =   120
      Top             =   1560
   End
   Begin VB.TextBox memText 
      Height          =   3495
      Left            =   600
      MultiLine       =   -1  'True
      ScrollBars      =   3  '兩者皆有
      TabIndex        =   0
      Top             =   960
      Width           =   10575
   End
   Begin MSComDlg.CommonDialog CmDialog1 
      Left            =   360
      Top             =   2520
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.Shape Round6 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   15
      Left            =   9480
      Shape           =   3  '圓形
      Top             =   5520
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round6 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   14
      Left            =   9000
      Shape           =   3  '圓形
      Top             =   5520
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round6 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   13
      Left            =   8520
      Shape           =   3  '圓形
      Top             =   5520
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round6 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   12
      Left            =   8040
      Shape           =   3  '圓形
      Top             =   5520
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round6 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   11
      Left            =   7440
      Shape           =   3  '圓形
      Top             =   5520
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round6 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   10
      Left            =   6840
      Shape           =   3  '圓形
      Top             =   5520
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round6 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   9
      Left            =   6240
      Shape           =   3  '圓形
      Top             =   5520
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round6 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   8
      Left            =   5640
      Shape           =   3  '圓形
      Top             =   5520
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round6 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   7
      Left            =   5040
      Shape           =   3  '圓形
      Top             =   5520
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round6 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   6
      Left            =   4440
      Shape           =   3  '圓形
      Top             =   5520
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round6 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   5
      Left            =   3840
      Shape           =   3  '圓形
      Top             =   5520
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round6 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   4
      Left            =   3240
      Shape           =   3  '圓形
      Top             =   5520
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round6 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   3
      Left            =   2640
      Shape           =   3  '圓形
      Top             =   5520
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round6 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   2
      Left            =   2040
      Shape           =   3  '圓形
      Top             =   5520
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round6 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   1
      Left            =   1440
      Shape           =   3  '圓形
      Top             =   5520
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round5 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   15
      Left            =   9480
      Shape           =   3  '圓形
      Top             =   5760
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round5 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   14
      Left            =   9000
      Shape           =   3  '圓形
      Top             =   5760
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round5 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   13
      Left            =   8520
      Shape           =   3  '圓形
      Top             =   5760
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round5 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   12
      Left            =   8040
      Shape           =   3  '圓形
      Top             =   5760
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round5 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   11
      Left            =   7440
      Shape           =   3  '圓形
      Top             =   5760
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round5 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   10
      Left            =   6840
      Shape           =   3  '圓形
      Top             =   5760
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round5 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   9
      Left            =   6240
      Shape           =   3  '圓形
      Top             =   5760
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round5 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   8
      Left            =   5640
      Shape           =   3  '圓形
      Top             =   5760
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round5 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   7
      Left            =   5040
      Shape           =   3  '圓形
      Top             =   5760
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round5 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   6
      Left            =   4440
      Shape           =   3  '圓形
      Top             =   5760
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round5 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   5
      Left            =   3840
      Shape           =   3  '圓形
      Top             =   5760
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round5 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   4
      Left            =   3240
      Shape           =   3  '圓形
      Top             =   5760
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round5 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   3
      Left            =   2640
      Shape           =   3  '圓形
      Top             =   5760
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round5 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   2
      Left            =   2040
      Shape           =   3  '圓形
      Top             =   5760
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round5 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   1
      Left            =   1440
      Shape           =   3  '圓形
      Top             =   5760
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round4 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   15
      Left            =   9480
      Shape           =   3  '圓形
      Top             =   6000
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round4 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   14
      Left            =   9000
      Shape           =   3  '圓形
      Top             =   6000
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round4 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   13
      Left            =   8520
      Shape           =   3  '圓形
      Top             =   6000
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round4 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   12
      Left            =   8040
      Shape           =   3  '圓形
      Top             =   6000
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round4 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   11
      Left            =   7440
      Shape           =   3  '圓形
      Top             =   6000
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round4 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   10
      Left            =   6840
      Shape           =   3  '圓形
      Top             =   6000
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round4 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   9
      Left            =   6240
      Shape           =   3  '圓形
      Top             =   6000
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round4 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   8
      Left            =   5640
      Shape           =   3  '圓形
      Top             =   6000
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round4 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   7
      Left            =   5040
      Shape           =   3  '圓形
      Top             =   6000
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round4 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   6
      Left            =   4440
      Shape           =   3  '圓形
      Top             =   6000
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round4 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   5
      Left            =   3840
      Shape           =   3  '圓形
      Top             =   6000
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round4 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   4
      Left            =   3240
      Shape           =   3  '圓形
      Top             =   6000
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round4 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   3
      Left            =   2640
      Shape           =   3  '圓形
      Top             =   6000
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round4 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   2
      Left            =   2040
      Shape           =   3  '圓形
      Top             =   6000
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round4 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   1
      Left            =   1440
      Shape           =   3  '圓形
      Top             =   6000
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round3 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   15
      Left            =   9480
      Shape           =   3  '圓形
      Top             =   6240
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round3 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   14
      Left            =   9000
      Shape           =   3  '圓形
      Top             =   6240
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round3 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   13
      Left            =   8520
      Shape           =   3  '圓形
      Top             =   6240
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round3 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   12
      Left            =   8040
      Shape           =   3  '圓形
      Top             =   6240
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round3 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   11
      Left            =   7440
      Shape           =   3  '圓形
      Top             =   6240
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round3 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   10
      Left            =   6840
      Shape           =   3  '圓形
      Top             =   6240
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round3 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   9
      Left            =   6240
      Shape           =   3  '圓形
      Top             =   6240
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round3 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   8
      Left            =   5640
      Shape           =   3  '圓形
      Top             =   6240
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round3 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   7
      Left            =   5040
      Shape           =   3  '圓形
      Top             =   6240
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round3 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   6
      Left            =   4440
      Shape           =   3  '圓形
      Top             =   6240
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round3 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   5
      Left            =   3840
      Shape           =   3  '圓形
      Top             =   6240
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round3 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   4
      Left            =   3240
      Shape           =   3  '圓形
      Top             =   6240
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round3 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   3
      Left            =   2640
      Shape           =   3  '圓形
      Top             =   6240
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round3 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   2
      Left            =   2040
      Shape           =   3  '圓形
      Top             =   6240
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round3 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   1
      Left            =   1440
      Shape           =   3  '圓形
      Top             =   6240
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round2 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   15
      Left            =   9480
      Shape           =   3  '圓形
      Top             =   6480
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round2 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   14
      Left            =   9000
      Shape           =   3  '圓形
      Top             =   6480
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round2 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   13
      Left            =   8520
      Shape           =   3  '圓形
      Top             =   6480
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round2 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   12
      Left            =   8040
      Shape           =   3  '圓形
      Top             =   6480
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round2 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   11
      Left            =   7440
      Shape           =   3  '圓形
      Top             =   6480
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round2 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   10
      Left            =   6840
      Shape           =   3  '圓形
      Top             =   6480
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round2 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   9
      Left            =   6240
      Shape           =   3  '圓形
      Top             =   6480
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round2 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   8
      Left            =   5640
      Shape           =   3  '圓形
      Top             =   6480
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round2 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   7
      Left            =   5040
      Shape           =   3  '圓形
      Top             =   6480
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round2 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   6
      Left            =   4440
      Shape           =   3  '圓形
      Top             =   6480
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round2 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   5
      Left            =   3840
      Shape           =   3  '圓形
      Top             =   6480
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round2 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   4
      Left            =   3240
      Shape           =   3  '圓形
      Top             =   6480
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round2 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   3
      Left            =   2640
      Shape           =   3  '圓形
      Top             =   6480
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round2 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   2
      Left            =   2040
      Shape           =   3  '圓形
      Top             =   6480
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round2 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   1
      Left            =   1440
      Shape           =   3  '圓形
      Top             =   6480
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round1 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   15
      Left            =   9480
      Shape           =   3  '圓形
      Top             =   6720
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round1 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   14
      Left            =   9000
      Shape           =   3  '圓形
      Top             =   6720
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round1 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   13
      Left            =   8520
      Shape           =   3  '圓形
      Top             =   6720
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round1 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   12
      Left            =   8040
      Shape           =   3  '圓形
      Top             =   6720
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round1 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   11
      Left            =   7440
      Shape           =   3  '圓形
      Top             =   6720
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round1 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   10
      Left            =   6840
      Shape           =   3  '圓形
      Top             =   6720
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round1 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   9
      Left            =   6240
      Shape           =   3  '圓形
      Top             =   6720
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round1 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   8
      Left            =   5640
      Shape           =   3  '圓形
      Top             =   6720
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round1 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   7
      Left            =   5040
      Shape           =   3  '圓形
      Top             =   6720
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round1 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   6
      Left            =   4440
      Shape           =   3  '圓形
      Top             =   6720
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round1 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   5
      Left            =   3840
      Shape           =   3  '圓形
      Top             =   6720
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round1 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   4
      Left            =   3240
      Shape           =   3  '圓形
      Top             =   6720
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round1 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   3
      Left            =   2640
      Shape           =   3  '圓形
      Top             =   6720
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round1 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   2
      Left            =   2040
      Shape           =   3  '圓形
      Top             =   6720
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Round1 
      FillColor       =   &H00FF0000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   1
      Left            =   1440
      Shape           =   3  '圓形
      Top             =   6720
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Line Line5 
      X1              =   1200
      X2              =   9840
      Y1              =   6600
      Y2              =   6600
   End
   Begin VB.Label Label30 
      Alignment       =   2  '置中對齊
      Height          =   375
      Left            =   3000
      TabIndex        =   29
      Top             =   4680
      Width           =   5175
   End
   Begin VB.Label Label29 
      Caption         =   "6"
      Height          =   255
      Left            =   11280
      TabIndex        =   28
      Top             =   5520
      Width           =   255
   End
   Begin VB.Label Label28 
      Caption         =   "5"
      Height          =   255
      Left            =   11280
      TabIndex        =   27
      Top             =   5760
      Width           =   255
   End
   Begin VB.Label Label27 
      Caption         =   "4"
      Height          =   255
      Left            =   11280
      TabIndex        =   26
      Top             =   6000
      Width           =   255
   End
   Begin VB.Label Label26 
      Caption         =   "3"
      Height          =   255
      Left            =   11280
      TabIndex        =   25
      Top             =   6240
      Width           =   135
   End
   Begin VB.Label Label25 
      Caption         =   "2"
      Height          =   255
      Left            =   11280
      TabIndex        =   24
      Top             =   6480
      Width           =   255
   End
   Begin VB.Label Label24 
      Caption         =   "1"
      Height          =   255
      Left            =   11280
      TabIndex        =   23
      Top             =   6720
      Width           =   255
   End
   Begin VB.Label Label23 
      Caption         =   "5"
      Height          =   255
      Left            =   720
      TabIndex        =   22
      Top             =   5760
      Width           =   135
   End
   Begin VB.Label Label22 
      Caption         =   "4"
      Height          =   255
      Left            =   720
      TabIndex        =   21
      Top             =   6000
      Width           =   135
   End
   Begin VB.Label Label21 
      Caption         =   "3"
      Height          =   255
      Left            =   720
      TabIndex        =   20
      Top             =   6240
      Width           =   135
   End
   Begin VB.Label Label20 
      Caption         =   "2"
      Height          =   255
      Left            =   720
      TabIndex        =   19
      Top             =   6480
      Width           =   135
   End
   Begin VB.Shape Shape_r 
      FillColor       =   &H00008000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   6
      Left            =   10800
      Shape           =   3  '圓形
      Top             =   5520
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Shape_r 
      FillColor       =   &H00008000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   5
      Left            =   10800
      Shape           =   3  '圓形
      Top             =   5760
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Shape_r 
      FillColor       =   &H00008000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   4
      Left            =   10800
      Shape           =   3  '圓形
      Top             =   6000
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Shape_r 
      FillColor       =   &H00008000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   3
      Left            =   10800
      Shape           =   3  '圓形
      Top             =   6240
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Shape_r 
      FillColor       =   &H00008000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   2
      Left            =   10800
      Shape           =   3  '圓形
      Top             =   6480
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Shape_r 
      FillColor       =   &H00008000&
      FillStyle       =   0  '實心
      Height          =   255
      Index           =   1
      Left            =   10800
      Shape           =   3  '圓形
      Top             =   6720
      Visible         =   0   'False
      Width           =   255
   End
   Begin VB.Shape Shape17 
      Height          =   2175
      Left            =   10200
      Shape           =   3  '圓形
      Top             =   5160
      Width           =   1455
   End
   Begin VB.Line Line12 
      BorderStyle     =   4  '破折線-點線
      X1              =   9960
      X2              =   10560
      Y1              =   6840
      Y2              =   6840
   End
   Begin VB.Line Line11 
      BorderStyle     =   4  '破折線-點線
      X1              =   9960
      X2              =   10560
      Y1              =   6600
      Y2              =   6600
   End
   Begin VB.Line Line10 
      BorderStyle     =   4  '破折線-點線
      X1              =   9960
      X2              =   10560
      Y1              =   6360
      Y2              =   6360
   End
   Begin VB.Line Line9 
      BorderStyle     =   4  '破折線-點線
      X1              =   9960
      X2              =   10560
      Y1              =   6120
      Y2              =   6120
   End
   Begin VB.Line Line8 
      BorderStyle     =   4  '破折線-點線
      X1              =   9960
      X2              =   10680
      Y1              =   5880
      Y2              =   5880
   End
   Begin VB.Line Line7 
      BorderStyle     =   4  '破折線-點線
      X1              =   9960
      X2              =   10680
      Y1              =   5640
      Y2              =   5640
   End
   Begin VB.Label Label18 
      Caption         =   "15"
      Height          =   255
      Left            =   9480
      TabIndex        =   18
      Top             =   7080
      Width           =   255
   End
   Begin VB.Label Label17 
      Caption         =   "14"
      Height          =   255
      Left            =   9000
      TabIndex        =   17
      Top             =   7080
      Width           =   375
   End
   Begin VB.Label Label16 
      Caption         =   "13"
      Height          =   255
      Left            =   8520
      TabIndex        =   16
      Top             =   7080
      Width           =   255
   End
   Begin VB.Label Label15 
      Caption         =   "6"
      Height          =   255
      Left            =   720
      TabIndex        =   15
      Top             =   5520
      Width           =   135
   End
   Begin VB.Label Label14 
      Caption         =   "1"
      Height          =   255
      Left            =   720
      TabIndex        =   14
      Top             =   6720
      Width           =   135
   End
   Begin VB.Label Label13 
      Caption         =   "12"
      Height          =   255
      Left            =   7920
      TabIndex        =   13
      Top             =   7080
      Width           =   255
   End
   Begin VB.Label Label12 
      Caption         =   "11"
      Height          =   255
      Left            =   7440
      TabIndex        =   12
      Top             =   7080
      Width           =   255
   End
   Begin VB.Label Label11 
      Caption         =   "10"
      BeginProperty Font 
         Name            =   "新細明體"
         Size            =   9
         Charset         =   136
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000C0&
      Height          =   255
      Left            =   6720
      TabIndex        =   11
      Top             =   7080
      Width           =   375
   End
   Begin VB.Label Label10 
      Caption         =   "9"
      Height          =   255
      Left            =   6240
      TabIndex        =   10
      Top             =   7080
      Width           =   135
   End
   Begin VB.Label Label9 
      Caption         =   "8"
      Height          =   255
      Left            =   5640
      TabIndex        =   9
      Top             =   7080
      Width           =   255
   End
   Begin VB.Label Label8 
      Caption         =   "7"
      BeginProperty Font 
         Name            =   "新細明體"
         Size            =   9
         Charset         =   136
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000C0&
      Height          =   135
      Left            =   5040
      TabIndex        =   8
      Top             =   7080
      Width           =   255
   End
   Begin VB.Label Label7 
      Caption         =   "6"
      Height          =   255
      Left            =   4440
      TabIndex        =   7
      Top             =   7080
      Width           =   255
   End
   Begin VB.Label Label6 
      Caption         =   "5"
      BeginProperty Font 
         Name            =   "新細明體"
         Size            =   9
         Charset         =   136
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000C0&
      Height          =   255
      Left            =   3840
      TabIndex        =   30
      Top             =   7080
      Width           =   255
   End
   Begin VB.Label Label5 
      Caption         =   "4"
      Height          =   255
      Left            =   3240
      TabIndex        =   31
      Top             =   7080
      Width           =   255
   End
   Begin VB.Label Label4 
      Caption         =   "3"
      Height          =   375
      Left            =   2520
      TabIndex        =   32
      Top             =   7080
      Width           =   255
   End
   Begin VB.Label Label3 
      Caption         =   "2"
      Height          =   255
      Left            =   2040
      TabIndex        =   33
      Top             =   7080
      Width           =   255
   End
   Begin VB.Label Label2 
      Caption         =   "1"
      Height          =   255
      Left            =   1440
      TabIndex        =   34
      Top             =   7080
      Width           =   135
   End
   Begin VB.Shape Shape16 
      Height          =   1455
      Left            =   9720
      Top             =   5520
      Width           =   135
   End
   Begin VB.Shape Shape15 
      Height          =   1455
      Left            =   9240
      Top             =   5520
      Width           =   135
   End
   Begin VB.Shape Shape14 
      Height          =   1455
      Left            =   8760
      Top             =   5520
      Width           =   135
   End
   Begin VB.Shape Shape13 
      Height          =   1455
      Left            =   8280
      Top             =   5520
      Width           =   135
   End
   Begin VB.Shape Shape12 
      Height          =   1455
      Left            =   7680
      Top             =   5520
      Width           =   135
   End
   Begin VB.Shape Shape11 
      Height          =   1455
      Left            =   7080
      Top             =   5520
      Width           =   135
   End
   Begin VB.Shape Shape10 
      Height          =   1455
      Left            =   6480
      Top             =   5520
      Width           =   135
   End
   Begin VB.Shape Shape9 
      Height          =   1455
      Left            =   5880
      Top             =   5520
      Width           =   135
   End
   Begin VB.Shape Shape8 
      Height          =   1455
      Left            =   5280
      Top             =   5520
      Width           =   135
   End
   Begin VB.Shape Shape7 
      Height          =   1455
      Left            =   4680
      Top             =   5520
      Width           =   135
   End
   Begin VB.Shape Shape6 
      Height          =   1455
      Left            =   4080
      Top             =   5520
      Width           =   135
   End
   Begin VB.Shape Shape5 
      Height          =   1455
      Left            =   3480
      Top             =   5520
      Width           =   135
   End
   Begin VB.Shape Shape4 
      Height          =   1455
      Left            =   2880
      Top             =   5520
      Width           =   135
   End
   Begin VB.Shape Shape3 
      Height          =   1455
      Left            =   2280
      Top             =   5520
      Width           =   135
   End
   Begin VB.Shape Shape2 
      Height          =   1455
      Index           =   0
      Left            =   1680
      Top             =   5520
      Width           =   135
   End
   Begin VB.Line Line6 
      X1              =   1200
      X2              =   9840
      Y1              =   6840
      Y2              =   6840
   End
   Begin VB.Line Line4 
      X1              =   1200
      X2              =   9840
      Y1              =   6360
      Y2              =   6360
   End
   Begin VB.Line Line3 
      X1              =   1200
      X2              =   9840
      Y1              =   6120
      Y2              =   6120
   End
   Begin VB.Line Line2 
      X1              =   1200
      X2              =   9840
      Y1              =   5880
      Y2              =   5880
   End
   Begin VB.Line Line1 
      X1              =   1200
      X2              =   9840
      Y1              =   5640
      Y2              =   5640
   End
   Begin VB.Shape Shape1 
      Height          =   1455
      Left            =   960
      Top             =   5520
      Width           =   255
   End
   Begin VB.Label Label1 
      Alignment       =   2  '置中對齊
      Height          =   495
      Left            =   600
      TabIndex        =   35
      Top             =   600
      Width           =   10335
   End
   Begin VB.Menu memFile 
      Caption         =   "檔案(&F)"
      Begin VB.Menu memOpen 
         Caption         =   "開啟樂曲檔案(&M)"
      End
      Begin VB.Menu memNew 
         Caption         =   "建立新樂曲檔案 (檔案內容清除)"
      End
      Begin VB.Menu memLine 
         Caption         =   "-"
      End
      Begin VB.Menu mem_OpenDemo 
         Caption         =   "開啟示範樂曲"
         Begin VB.Menu memDemo 
            Caption         =   "C大調小行板"
            Checked         =   -1  'True
            Index           =   1
         End
         Begin VB.Menu memDemo 
            Caption         =   "憶兒時"
            Checked         =   -1  'True
            Index           =   2
         End
         Begin VB.Menu memDemo 
            Caption         =   "愛的羅曼史"
            Checked         =   -1  'True
            Index           =   3
         End
      End
      Begin VB.Menu memLine5 
         Caption         =   "-"
      End
      Begin VB.Menu memSave 
         Caption         =   "儲存檔案"
      End
      Begin VB.Menu memSave_another 
         Caption         =   "另存新檔"
      End
      Begin VB.Menu memClose 
         Caption         =   "關閉檔案"
      End
      Begin VB.Menu memLine2 
         Caption         =   "-"
      End
      Begin VB.Menu memPrint 
         Caption         =   "列印"
      End
      Begin VB.Menu memLine3 
         Caption         =   "-"
      End
      Begin VB.Menu memExit 
         Caption         =   "結束並離開(&X)"
      End
   End
   Begin VB.Menu execute 
      Caption         =   "執行(&R)"
      Begin VB.Menu exePlay 
         Caption         =   "撥放樂曲(軟體模擬)"
      End
      Begin VB.Menu exeHard 
         Caption         =   "撥放樂曲(連結外界硬體，自動吉他演奏)"
      End
      Begin VB.Menu exeLine 
         Caption         =   "-"
      End
      Begin VB.Menu exeOutput 
         Caption         =   "輸出控制碼檔案"
      End
   End
   Begin VB.Menu sysSay 
      Caption         =   "說明(&H)"
      Begin VB.Menu sysAbout 
         Caption         =   "關於本系統(&A)"
         Shortcut        =   ^A
      End
      Begin VB.Menu sysVersion 
         Caption         =   "版權說明"
      End
      Begin VB.Menu sysLine 
         Caption         =   "-"
      End
      Begin VB.Menu sysTech 
         Caption         =   "技術支援"
      End
      Begin VB.Menu sysLine2 
         Caption         =   "-"
      End
      Begin VB.Menu sysBook 
         Caption         =   "參考書目"
      End
   End
End
Attribute VB_Name = "frmExtraMidi"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private oldKey As Long, oldKeyDemo As Long

Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Private Declare Function GetTickCount Lib "kernel32" () As Long

Dim Over As Boolean   '是否中途終止程式的執行？

Dim X1 As Long
Dim X2 As Long
Dim TAB_sound(1 To 6, 0 To 15)  As Integer '六弦15把位(含空把位)
Dim midi_string_note(1 To 6, 0 To 15)  As Long '六弦15把位 的 Mide Note
Dim midi_old_string(1 To 6) As Integer '紀錄上一個 midi 按弦(Channel)，1表 Yes, 0表 No
Dim midi_old_note(1 To 6) As Long '紀錄上一個 midi 按弦(Channel)，的 keynote 值
Dim Pos As Integer '目前把位位置
Dim Tab_rel_left(1 To 6, 1 To 5) As Integer '左手五指壓弦狀況，相對的
Dim Tbase As Long '基本時間單位
Dim T_times As Long '倍數(對 基本時間單位 而言)
Dim T_delay As Long  'Tbase * T_times
Dim Stopp As Boolean

Dim Fname As String  '讀入的樂曲檔名
Dim Music As String  '讀入的樂曲內容
Dim Mp As Integer 'Music String Pointer
Dim Mp_C As String 'Mp 所抓到的字元
Dim Music_Len As Integer
Dim Ctrl_out As String
Dim Demo_num As Integer



Private Sub Command1_Click()
    keyOn 6, 12 + 0, velocityBase
    DoEvents
    Sleep 500
    keyOff 6, 12 + 0
    
    
End Sub

Private Sub Form_Click()

'Picture1.Picture = LoadPicture("d:\guitar_2004\Ver2\MOON.ICO")
'Image6(0).Picture = LoadPicture(App.Path & "\MOON.ICO")
'App.Path& "\MOON.ICO")

End Sub
Private Sub Form_Activate()
  cmdFocus.SetFocus
End Sub

Private Sub Form_DblClick()
'Image6(0).Picture = LoadPicture("")

End Sub

Private Sub Form_Load()
Dim bar(0 To 20)  As Double
Dim m, pi, s, e, f As Double
Dim sx, sy, i As Integer

AutoRedraw = True

Label1.Caption = "歡迎您進入 AutoGuitar 系統！    您可以在以下文書盒，編修樂曲檔內容"
memDemo(1).Checked = 0
memDemo(2).Checked = 0
memDemo(3).Checked = 0
Demo_num = 1
Label30.Caption = "古典吉他按弦撥弦即時動畫"

pi = 3.141593
s = 90 * pi / 180
e = pi    'e = 180 * pi / 180
Circle (9480, 5520), 1080, , s, e
f = 270 * pi / 180
Circle (9480, 6960), 1080, , e, f

'MIDI Initialization
  If App.PrevInstance Then
    MsgBox "ExtraMidi 這套 Midi 電子琴軟體，已經被開啟！", , "注意事項"
    End
  End If

  On Error Resume Next
  'Dim i As Integer
  fraSet.Move (Me.ScaleWidth - fraSet.Width) / 2
  midiDevToList cmbDev
  cmbDev.ListIndex = 0

  ' 加入以下這行的程式碼即可
  'midiChangeDev cmbDev.ItemData(cmbDev.ListIndex)

  '=========================
  ' 你也可以加入下面的 cmbDev_Click 函數
  ' 因為執行 cmbDev.ListIndex = 0 會再跳去執行 cmbDev_Click
  ' 這時也會執行 midiChangeDev 這一函數
  '=========================

  cmbSound.ListIndex = 0
  
  '=========================
  ' 你也可以加入下面的 cmbSound_Click 函數
  ' 這樣你才可以改變演奏的樂器
  '=========================
  
  
  '基本（標準）音調，預設為 C 調
  noteBase = 36
  '基本速度，相對控制了播放音量與播放時間
  velocityBase = 127

End Sub

Private Sub Form_Unload(Cancel As Integer)
  midiClose
  'End
End Sub

Private Sub memNew_Click()
Music = ""
memText.Text = ""
Label1.Caption = "** 您可以在以下文書盒，編修新的樂曲檔內容 **"
End Sub

Private Sub memClose_Click()
Music = ""
memText.Text = ""
Label1.Caption = "** 您可以在以下文書盒，編修新的樂曲檔內容 **"
End Sub


Private Sub memOpen_Click()
Dim Lstr As String

On Error GoTo ErrHandler     ' 按取消鈕則跳至ErrHandler
CmDialog1.Filter = "Text files(*.txt) | *.txt"
CmDialog1.FilterIndex = 1
CmDialog1.Action = 1             ' 開啟舊檔對話方塊
Label1.Caption = CmDialog1.FileName
Fname = CmDialog1.FileName
Open CmDialog1.FileName For Input As #1    ' 開檔
While Not EOF(1)                 ' 讀檔
  Line Input #1, Lstr
  'memText.Text = memText.Text + Lstr + Chr(13) + Chr(10)
  memText.Text = memText.Text + Lstr + Chr(13) + Chr(10)
  'Music = Music + Lstr + Chr(13) + Chr(10)
Wend
'Debug.Print Music
Close #1                         ' 關檔
ErrHandler:
    Exit Sub
End Sub



Private Sub memSave_Click()
If (Fname = "") Then
 Call memSave_another_Click
Else
 Open Fname For Output As #1   ' 開檔供寫入
 Print #1, memText.Text
 Close #1
 MsgBox "檔案已儲存完畢！" + "(" + Fname + ")"
End If
End Sub

Private Sub memSave_another_Click()

On Error GoTo ErrHandler     ' 按取消鈕則跳至ErrHandler
CmDialog1.Filter = "Text files(*.txt) | *.txt"
CmDialog1.FilterIndex = 1
CmDialog1.Action = 2            ' 開啟舊檔對話方塊 (此處是 2，不是 1 哦！)
Label1.Caption = CmDialog1.FileName
Fname = CmDialog1.FileName
Open CmDialog1.FileName For Output As #1    ' 開檔
Print #1, memText.Text
Close #1                         ' 關檔
ErrHandler:
    Exit Sub
End Sub

Private Sub memPrint_Click()
Dim i As Integer
CmDialog1.CancelError = True
On Error GoTo ErrHandler     ' 按取消鈕則跳至ErrHandler
CmDialog1.Action = 5             ' 開啟列印對話方塊
For i = 1 To CmDialog1.Copies    ' 列印
    Printer.Print memText.Text
Next i
Printer.EndDoc
ErrHandler:
    Exit Sub
End Sub

Private Sub memDemo_Click(index As Integer)
 Dim demo(1 To 3)  As String
 Dim temp1 As String
 Dim temp2 As String

  memDemo(Demo_num).Checked = 0
  Demo_num = index
  memDemo(index).Checked = -1
  
  temp1 = "SINTRO" & Chr(13) & Chr(10) & "這是在「卡爾卡西吉他教本」中的一首「C大調小行板」" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "這首曲子或許能勾起許多吉他演奏者，過去初學時的許多回憶哦！" & Chr(13) & Chr(10) & "INTRO B0170T01P01" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "L3251   R35R4R35R4 l3251R35R4R35R4  L3353R35R4R35R4 l3353L3251R35R4R35R4" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "            l3251L23R26R4R26R4  l23L61R36R4R36R4  l61L13R15R4R15R4 T04 l13L2351R25" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "T01l23L32   R35R4R35R4 l3251R35R4R35R4  L3353R35R4R35R4 l3353L3251R35R4R35R4" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "            l3251L23R26R4R26R4  l23L61R36R4R36R4  l61L13R15R4R15R4 T04 l13L2351R25" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "T01l23R56R4R56R4 l51L5361R56R4R56R4 l5361L52R56R4R56R4 l52L5361R56R4R56R4" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "           l5361L5162R56R3R56R3 l5162L63R56R3R56R3 l63L5162R56R3R56R3 T04 l5162L63R456" & Chr(13) & Chr(10) & Chr(13) & Chr(10)
  temp2 = "T01 l63 L3251 R35R4R35R4 l3251R35R4R35R4  L3353R35R4R35R4 l3353L3251R35R4R35R4" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "            l3251L23R26R4R26R4  l23L61R36R4R36R4  l61L13R15R4R15R4 T04 l13L233251R2345 l233251" & Chr(13) & Chr(10) & "E"
  demo(1) = temp1 + temp2

  demo(2) = "未完成！ 施工中！"
    temp1 = "S INTRO" & Chr(13) & Chr(10) & "愛的羅曼史（西班牙民謠） ∼" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "最著名的吉他獨奏曲之一。1952年法國影片《禁忌的遊戲》的導演力邀西班牙吉他演奏家耶佩斯" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "為影片作曲。耶佩斯別出心裁，只採用一把吉它為整部影片配曲，並由他自己一人演奏。" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "其主題曲就是《愛的羅曼史》，是耶佩斯根據西班牙民歌改編的。" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "INTRO B0170P04T01L64R16R5R4R6R5R4R6R5R4 R16R5R4l64L62R6R5R4 P02R6R5R4" & Chr(13) & Chr(10) & Chr(13) & Chr(10)
    temp2 = "R16R5R4 l62L61R6R5R4 l61R6R5R4 P03 R16R5R4 L61R6R5R4 L65l61R6R5R4" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "P08 R16R5R4 R6R5R4 R6R5R4         R16R5R4 l65L63R6R5R4 l63P05L64R6R5R4" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "L41516163R26R5R4 l64R6R5R4 l63R6R5R4   R26R5R4 L63R6R5R4 L64R6R5R4" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "l6163645141 P07 L61115142413121 R16R5R4 L62R6R5R4 l62R6R5R4    L65R16R5R4 l65L62R6R5R4 l62R6R5R4" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "l11213141425161 P04 L64R16R5R4 L62l64R6R5R4 P02R6R5R4   R16R5R4 l62L61R6R5R4 l61R6R5R4" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "L614121R26R5R4 R6R5R4 R6R5R4        R26R5R4 L62R6R5R4 l62R6R5R4 D" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "l6141L31R36R5R4 R26R5R4 L12R16R5R4 l312112 R1456  P01 E"
  demo(3) = temp1 + temp2
    
  Select Case index
    Case 1
       Fname = "C:\demo1.txt"
    Case 2
       Fname = "C:\demo2.txt"
    Case 3
       Fname = "C:\demo3.txt"
  End Select
  
  memText.Text = demo(index)
  Label1.Caption = "** 您可以利用「另存新檔」，儲存此示範樂曲。若直接儲存，系統自動儲存至 " + Fname + " **"
End Sub

Private Sub memExit_Click()
End
End Sub


Private Sub exeOutput_Click()
If (Ctrl_out = "") Then
   MsgBox "** 您必須先「撥放樂曲」，然後才可以輸出吉他演奏控制說明檔！ **"
 Else
   On Error GoTo ErrHandler     ' 按取消鈕則跳至ErrHandler
   CmDialog1.Filter = "Text files(*.txt) | *.txt"
   CmDialog1.FilterIndex = 1
   CmDialog1.Action = 2            ' 開啟舊檔對話方塊 (此處是 2，不是 1 哦！)
   'Label1.Caption = CmDialog1.FileName
   Fname = CmDialog1.FileName
   Open CmDialog1.FileName For Output As #1    ' 開檔
   Print #1, Ctrl_out
   Close #1                         ' 關檔
ErrHandler:
    Exit Sub
End If

End Sub

Private Sub exePlay_Click()

Music = memText.Text
Call Play_music
End Sub

Private Sub exeHard_Click()
   MsgBox "Under Construction!"
End Sub


Sub Play_music()
Dim i As Integer
Dim nl As Long

If (Music = "") Then
   MsgBox "** 目前樂曲內容為空的，無法撥放！ **"
 Else
  Call initialize

  Mp = 1
  Over = False
    '由於 Music = Music + Lstr + Chr(13) + Chr(10) 這行指令，故
    '欲最後控制碼 E ，在最後第三個 (影響以下指令)
 If ((Mid(Music, 1, 1) = "S") And ((Mid(Music, Music_Len - 2, 1) = "E") Or (Mid(Music, Music_Len, 1) = "E"))) Then
   Mp = Mp + 1
   Mp_C = Mid(Music, Mp, 1)
   While ((Mp_C <> "E") And (Over = False))   '若Over=True，亦中斷執行
    Select Case Mp_C
     Case "B"
       Call B_handle
     Case "P"
       Call P_handle
     Case "T"
       Call T_handle
     Case "L"
       Call L_handle
     Case "l"
       Call ll_handle

     Case "R"
       Call R_handle
     Case "D"
       Call D_handle
     Case "I"
       Call I_handle

     Case Else
        Mp = Mp + 1
    End Select
    Mp_C = Mid(Music, Mp, 1)  '抓下一個要處理的命令字元 (以上Case 中，最後 Mp記得加1 )

   Wend
      
   For nl = 1 To 6 Step 1
     Shape_r(nl).Visible = False      '右手撥弦圖像全部清除
     'OFF 之前的和絃音
     If (midi_old_string(nl) = 1) Then keyOff nl, midi_old_note(nl)
       midi_old_string(nl) = 0
   Next nl
   Label30.Caption = "演奏完畢！ 謝謝！"

   Else
     MsgBox "This is an illegal data file format!! (Start Code「S」 or Stop Code 「E」 Error)"
   End If
End If
End Sub



Private Sub sysAbout_Click()
Dim msg As String
'msg = Chr(10) & "南台科技大學電機系 自動吉他演奏系統" & Chr(10) & Chr(10) & Chr(10)
msg = Chr(10) & "       自動吉他演奏系統" & Chr(10) & Chr(10) & Chr(10)
msg = msg + "          科技與藝術對話" & Chr(10) & Chr(10)
msg = msg + "          共譜美好的樂章" & Chr(10) & Chr(10) & Chr(10) & Chr(10)
msg = msg + "            妙音 2005. 8."
MsgBox msg
End Sub


Private Sub sysBook_Click()
Dim msg As String
msg = Chr(10) & ">> 感謝以下書籍作者，寫出這麼好的著作，嘉惠讀者，衷心感激！" & Chr(10) & Chr(10) & Chr(10)
msg = msg + "* 新觀念的 Visual Basic 6.0 教本  王國榮 著  旗標 1999" & Chr(10) & Chr(10)
msg = msg + "* 精通 Visual Basic 6.0  洪錦魁 著  文魁  1999" & Chr(10) & Chr(10)
msg = msg + "* Visual Basic 遊戲設計實務  位元文化編著  文魁" & Chr(10) & Chr(10)
msg = msg + "* Visual Basic 6.0 Windows API 講座  王國榮 著  旗標" & Chr(10) & Chr(10)
msg = msg + "* 卡爾卡西吉他教本  溝淵浩五郎 編著  美樂出版社" & Chr(10) & Chr(10)
msg = msg + "* 古典吉他大教本(上)(下)  郭清界 張少華 編著  天同出版社" & Chr(10) & Chr(10)
msg = msg + Chr(10) & Chr(10)
msg = msg + ">> 感謝 交大 吳文成 教授，Midi 演奏程式指導，衷心感激！ " & Chr(10) & Chr(10)

msg = msg + Chr(10) & Chr(10)
msg = msg + "                                          妙音 2005. 8."
MsgBox msg

End Sub

Private Sub sysTech_Click()
Frm_tech.Show 1
End Sub

Private Sub sysVersion_Click()
Dim msg As String
msg = Chr(10) & "自動吉他演奏系統" & Chr(10) & Chr(10) & Chr(10)
msg = msg + "     No  CopyRight" & Chr(10) & Chr(10)
msg = msg + "    歡迎 Copy 流通" & Chr(10) & Chr(10) & Chr(10) & Chr(10)
msg = msg + "      妙音 2005. 8."
MsgBox msg
End Sub

Sub initialize()

Dim i, j As Integer
Dim Lstr As String

Pos = 1
Tbase = 170

'TAB_sound 吉他音頻初值化
TAB_sound(1, 0) = 139: TAB_sound(1, 1) = 148: TAB_sound(1, 2) = 157: TAB_sound(1, 3) = 166: TAB_sound(1, 4) = 176: TAB_sound(1, 5) = 186: TAB_sound(1, 6) = 198: TAB_sound(1, 7) = 209: TAB_sound(1, 8) = 220: TAB_sound(1, 9) = 235: TAB_sound(1, 10) = 247: TAB_sound(1, 11) = 262: TAB_sound(1, 12) = 277: TAB_sound(1, 13) = 294: TAB_sound(1, 14) = 312: TAB_sound(1, 15) = 330

TAB_sound(2, 0) = 186: TAB_sound(2, 1) = 198: TAB_sound(2, 2) = 209: TAB_sound(2, 3) = 220: TAB_sound(2, 4) = 235: TAB_sound(2, 5) = 247: TAB_sound(2, 6) = 262: TAB_sound(2, 7) = 277: TAB_sound(2, 8) = 294: TAB_sound(2, 9) = 312: TAB_sound(2, 10) = 330: TAB_sound(2, 11) = 350: TAB_sound(2, 12) = 370: TAB_sound(2, 13) = 393: TAB_sound(2, 14) = 416: TAB_sound(2, 15) = 440

TAB_sound(3, 0) = 247: TAB_sound(3, 1) = 262: TAB_sound(3, 2) = 277: TAB_sound(3, 3) = 294: TAB_sound(3, 4) = 312: TAB_sound(3, 5) = 330: TAB_sound(3, 6) = 350: TAB_sound(3, 7) = 370: TAB_sound(3, 8) = 393: TAB_sound(3, 9) = 416: TAB_sound(3, 10) = 440: TAB_sound(3, 11) = 467: TAB_sound(3, 12) = 494: TAB_sound(3, 13) = 524: TAB_sound(3, 14) = 554: TAB_sound(3, 15) = 587

TAB_sound(4, 0) = 330: TAB_sound(4, 1) = 350: TAB_sound(4, 2) = 370: TAB_sound(4, 3) = 393: TAB_sound(4, 4) = 416: TAB_sound(4, 5) = 440: TAB_sound(4, 6) = 467: TAB_sound(4, 7) = 494: TAB_sound(4, 8) = 524: TAB_sound(4, 9) = 554: TAB_sound(4, 10) = 587: TAB_sound(4, 11) = 623: TAB_sound(4, 12) = 659: TAB_sound(4, 13) = 699: TAB_sound(4, 14) = 740: TAB_sound(4, 15) = 786

TAB_sound(5, 0) = 416: TAB_sound(5, 1) = 440: TAB_sound(5, 2) = 467: TAB_sound(5, 3) = 494: TAB_sound(5, 4) = 524: TAB_sound(5, 5) = 554: TAB_sound(5, 6) = 587: TAB_sound(5, 7) = 623: TAB_sound(5, 8) = 659: TAB_sound(5, 9) = 699: TAB_sound(5, 10) = 740: TAB_sound(5, 11) = 786: TAB_sound(5, 12) = 831: TAB_sound(5, 13) = 880: TAB_sound(5, 14) = 934: TAB_sound(5, 15) = 988

TAB_sound(6, 0) = 554: TAB_sound(6, 1) = 587: TAB_sound(6, 2) = 623: TAB_sound(6, 3) = 659: TAB_sound(6, 4) = 699: TAB_sound(6, 5) = 740: TAB_sound(6, 6) = 786: TAB_sound(6, 7) = 831: TAB_sound(6, 8) = 880: TAB_sound(6, 9) = 934: TAB_sound(6, 10) = 988: TAB_sound(6, 11) = 1048: TAB_sound(6, 12) = 1108: TAB_sound(6, 13) = 1174: TAB_sound(6, 14) = 1246: TAB_sound(6, 15) = 1318

'吉他六弦 Midi Note 初始化
midi_string_note(1, 0) = 16: midi_string_note(2, 0) = 21: midi_string_note(3, 0) = 26: midi_string_note(4, 0) = 31: midi_string_note(5, 0) = 35: midi_string_note(6, 0) = 40
For i = 1 To 15
  midi_string_note(1, i) = midi_string_note(1, i - 1) + 1
  midi_string_note(2, i) = midi_string_note(2, i - 1) + 1
  midi_string_note(3, i) = midi_string_note(3, i - 1) + 1
  midi_string_note(4, i) = midi_string_note(4, i - 1) + 1
  midi_string_note(5, i) = midi_string_note(5, i - 1) + 1
  midi_string_note(6, i) = midi_string_note(6, i - 1) + 1
Next i

'Tab_rel_left 初值化 (全部清為0)
For i = 1 To 6
  midi_old_string(i) = 0
  For j = 1 To 5
   Tab_rel_left(i, j) = 0
  Next j
Next i

'Open App.Path & "\romance.txt" For Input As #1   ' 開檔供讀取 ( App.Path 是目前路徑)
'While Not EOF(1)
'    Line Input #1, Lstr          ' 讀檔
'    Music = Music + Lstr         '+ Chr(13) + Chr(10) 略去
'Wend
'Close #1                         ' 關檔
     'Music = "SP04L64R16T1R5R4R6R5R4R6R5R4 R16R5R4l64L62R6R5R4 P02R6R5R4 E"

Music_Len = Len(Music)

'MsgBox "Music_Len" & Music_Len
Debug.Print "Hello! Start Debug!!"           '可執行中印出執行結果，利於 Debug
Ctrl_out = "  自動吉他輸出控制文件檔  by Tang   2004" & Chr(13) & Chr(10) & Chr(13) & Chr(10)
                'Chr(13)是換行字元啦！ 可是必須再加上 Chr(13) ，在 記事本 中，才會換行
                '若只有 Chr(13)，必須 copy 到 WORD ，才會換行
Ctrl_out = Ctrl_out & "注意(1)：以下右手撥弦動作之間，若無時間間隔，表示一起撥" & Chr(13) & Chr(10)
Ctrl_out = Ctrl_out & "注意(2)：音效模擬右手撥弦聲音，多弦一起撥時，只發出最高琴弦的音" & Chr(13) & Chr(10) & Chr(13) & Chr(10)
Ctrl_out = Ctrl_out & "移到第" & Pos & "把位" & Chr(13) & Chr(10)

End Sub

Sub P_handle()   '移動把位控制，連續抓兩個字元來判斷把位即可
Dim Pos_C As String
Dim i, j, Pos_old As Integer

Pos_old = Pos
Pos_C = Mid(Music, Mp + 1, 2)
Pos = Val(Pos_C)       '兩位字元轉成數字
Ctrl_out = Ctrl_out & Chr(13) & Chr(10) & "移到第" & Pos & "把位" & Chr(13) & Chr(10)      '「此處要寫控制硬體程式」

If (Pos_old <> Pos) Then
  For i = 1 To 6
   For j = 1 To 5
     If (Tab_rel_left(i, j) = 1) Then
      Select Case i
        Case 1
          Round1(Pos_old + j - 1).Visible = False
          Round1(Pos + j - 1).Visible = True
        Case 2
          Round2(Pos_old + j - 1).Visible = False
          Round2(Pos + j - 1).Visible = True
        Case 3
          Round3(Pos_old + j - 1).Visible = False
          Round3(Pos + j - 1).Visible = True
        Case 4
          Round4(Pos_old + j - 1).Visible = False
          Round4(Pos + j - 1).Visible = True
        Case 5
          Round5(Pos_old + j - 1).Visible = False
          Round5(Pos + j - 1).Visible = True
        Case 6
          Round6(Pos_old + j - 1).Visible = False
          Round6(Pos + j - 1).Visible = True
      End Select
     End If
   Next j
  Next i
End If

Mp = Mp + 3            'Mp 移到下3個
End Sub

Sub B_handle()   '移動把位控制，連續抓兩個字元來判斷把位即可
Dim tb As String
tb = Mid(Music, Mp + 1, 4)
Tbase = Val(tb)       '四位字元轉成數字
Mp = Mp + 5            'Mp 移到下5個
End Sub

Sub L_handle()  '左手壓弦處理
Dim relative_p As String
Dim string_no As String
Dim a, b As Integer

Mp = Mp + 1
Do
string_no = Mid(Music, Mp, 1)
a = Val(string_no)
relative_p = Mid(Music, Mp + 1, 1)
b = Val(relative_p)
Tab_rel_left(a, b) = 1 '壓弦點為1，未壓點為0，此處為壓弦
Ctrl_out = Ctrl_out & "左手指壓下第" & a & "條弦，第" & (Pos + b - 1) & "(" & b & ")把位處" & Chr(13) & Chr(10)
                                                             '「此處要寫控制硬體程式」
'Round O/P (按弦模擬圖像輸出)
Select Case a
   Case 1
      Round1(Pos + b - 1).Visible = True
      'Image1(Pos + b - 1).Picture = LoadPicture(App.Path & "\MOON.ICO")
   Case 2
      Round2(Pos + b - 1).Visible = True
       'Image2(Pos + b - 1).Picture = LoadPicture(App.Path & "\MOON.ICO")
   Case 3
      Round3(Pos + b - 1).Visible = True
   Case 4
      Round4(Pos + b - 1).Visible = True
   Case 5
      Round5(Pos + b - 1).Visible = True
   Case 6
      Round6(Pos + b - 1).Visible = True
End Select

Mp = Mp + 2
Loop Until ((Asc(Mid(Music, Mp, 1)) < 48) Or (Asc(Mid(Music, Mp, 1)) > 57))  '直到遇到控制碼(0~9以外)
End Sub

Sub ll_handle() '左手放弦處理
Dim relative_p As String
Dim string_no As String
Dim a, b As Integer

Mp = Mp + 1
Do
string_no = Mid(Music, Mp, 1)
a = Val(string_no)
relative_p = Mid(Music, Mp + 1, 1)
b = Val(relative_p)
Tab_rel_left(a, b) = 0 '壓弦點為1，未壓點為0，此處為放開
Ctrl_out = Ctrl_out & "左手指放開第" & a & "條弦，第" & (Pos + b - 1) & "(" & b & ")把位處" & Chr(13) & Chr(10)
                                                             '「此處要寫控制硬體程式」
Select Case a
   Case 1
      Round1(Pos + b - 1).Visible = False
       '     Image1(Pos + b - 1).Picture = LoadPicture("")
   Case 2
      Round2(Pos + b - 1).Visible = False
   Case 3
      Round3(Pos + b - 1).Visible = False
   Case 4
      Round4(Pos + b - 1).Visible = False
   Case 5
      Round5(Pos + b - 1).Visible = False
   Case 6
      Round6(Pos + b - 1).Visible = False
End Select
                                                             
Mp = Mp + 2
Loop Until ((Asc(Mid(Music, Mp, 1)) < 48) Or (Asc(Mid(Music, Mp, 1)) > 57))  '直到遇到控制碼(0~9以外)
End Sub

Sub T_handle()  'Delay Time 處理，解法與 P 控制碼類似
Dim timess As String

timess = Mid(Music, Mp + 1, 2)
T_times = Val(timess)       '兩位字元轉成數字
T_delay = Tbase * T_times
'Ctrl_out = Ctrl_out & "T=" & T_delay & Chr(13) & Chr(10)
Mp = Mp + 3            'Mp 移到下3個
End Sub

Sub R_handle()

Dim string_no As String
Dim a, i, j, mark As Integer
Dim WaitTime, nl As Long


For nl = 1 To 6 Step 1
  Shape_r(nl).Visible = False
  'OFF 之前的和絃音
  If (midi_old_string(nl) = 1) Then keyOff nl, midi_old_note(nl)
  midi_old_string(nl) = 0
  
Next nl

Mp = Mp + 1
'**********************************************************************
Do
string_no = Mid(Music, Mp, 1)
nl = Val(string_no)
Ctrl_out = Ctrl_out & "右手撥第" & nl & "條弦" & Chr(13) & Chr(10)  '「此處要寫控制硬體程式」

Shape_r(nl).Visible = True           '右手撥弦圖像顯示

mark = 0
For j = 1 To 5
  If (Tab_rel_left(nl, j) = 1) Then   '找到最右的壓弦點，這才是發音點
    mark = j
  End If
Next j
If (mark = 0) Then
   'X1 = Beep(TAB_sound(a, 0), T_delay)    '空弦
   midi_old_string(nl) = 1
   midi_old_note(nl) = midi_string_note(nl, 0)
   'keyOn nl, midi_string_note(nl, 0), velocityBase
   'DoEvents  ' 讓CPU 能做其他事
   'Sleep T_delay
Else
      'X1 = Beep(TAB_sound(a, Pos + mark - 1), T_delay)
      midi_old_string(nl) = 1
      midi_old_note(nl) = midi_string_note(nl, Pos + mark - 1)
      'keyOn nl, midi_string_note(nl, Pos + mark - 1), velocityBase
      'DoEvents
      'Sleep T_delay
      'Debug.Print "TAB_sound" & a & "+" & (Pos + mark - 1)
End If
                                                             
Mp = Mp + 1
Loop Until ((Asc(Mid(Music, Mp, 1)) < 48) Or (Asc(Mid(Music, Mp, 1)) > 57))  '直到遇到控制碼(0~9以外)

'*************************************************************

'合音一次撥放
For nl = 1 To 6 Step 1
   If (midi_old_string(nl) = 1) Then keyOn nl, midi_old_note(nl), velocityBase
Next nl

DoEvents  ' 讓CPU 能做其他事
Sleep T_delay

' 以下這一段 Delay 粉重要(即使只有1ms)，若無它，動畫無法顯示
'WaitTime = GetTickCount()
'WaitTime = WaitTime + 1
'Delay11 WaitTime

Ctrl_out = Ctrl_out & "時間間隔： " & T_delay & "ms" & Chr(13) & Chr(10)

End Sub

Sub D_handle()    'Debug 左手壓弦目前狀態
  Dim i, j As Integer
  
  For i = 6 To 1 Step -1     ' "Step -1" 不可省哦！
    For j = 1 To 5
      Ctrl_out = Ctrl_out & Tab_rel_left(i, j)
    Next j
    Ctrl_out = Ctrl_out & Chr(13) & Chr(10)
  Next i
  Mp = Mp + 1

End Sub

Sub I_handle()    '樂曲簡介
Dim temp As String
Dim mpp As Integer

If (Mid(Music, Mp, 5) = "INTRO") Then
   mpp = InStr(Mp + 5, Music, "INTRO")
   Debug.Print "mpp=" & mpp
   If (mpp = 0) Then              '找不到第二個 INTRO
       MsgBox "This is an illegal data file format!! (「I」 Code Error)"
   End If
   
   Mp = mpp + 5
Else
  MsgBox "This is an illegal data file format!! (「I」 Code Error)"
  Mp = Mp + 1
End If

End Sub

Public Sub Delay11(NextTime As Long)
  Do While GetTickCount() < NextTime
    DoEvents
  Loop
End Sub


'===============================
' 以下為可以添加的函數
'===============================

'以指定參數改變 Midi 輸出設備
Private Sub cmbDev_Click()
  midiChangeDev cmbDev.ItemData(cmbDev.ListIndex)
  '  cmbSound_Click
End Sub


'以指定參數，改變演奏樂器
Private Sub cmbSound_Click()
  Dim channel As Long
  
  '同時改變通道 0 到 8 的演奏樂器
  For channel = 0 To 8
    midiChangeSound channel, cmbSound.ListIndex
  Next
  '當然你也可以指派不同的演奏樂器，給不同的通道（Channel）
End Sub

