首页 > 其他分享 >VB版本电子琴简谱播放器代码QZQ-2024-8-30

VB版本电子琴简谱播放器代码QZQ-2024-8-30

时间:2024-08-30 09:50:32浏览次数:14  
标签:Combo1 VB QZQ AddItem Combo2 CurrentY Print 电子琴 PicA

Option Explicit

Private Declare Sub Sleep Lib “kernel32” (ByVal dwMilliseconds As Long)

Private Const sColr = &H4000&

Dim mm As Variant '不再使用 New sMidi,而是使用 Variant 类型,可以存储不同类型的数据

Private Declare Function midiOutClose Lib “winmm.dll” (ByVal hMidiOut As Long) As Long
Private Declare Function midiOutOpen Lib “winmm.dll” (lphMidiOut As Long, ByVal uDeviceID As Long, ByVal dwCallback As Long, ByVal dwInstance As Long, ByVal dwFlags As Long) As Long
Private Declare Function midiOutShortMsg Lib “winmm.dll” (ByVal hMidiOut As Long, ByVal dwMsg As Long) As Long

Private Rc As Long
Private Hmidi As Long
Private StopMidimsg

Private Const CurDevice = 0
Private Const Channel = 0
Private Const Volume = 100

Private mvarsType As Integer

'0 Acoustic Grand Piano 大钢琴(声学钢琴)
'1 Bright Acoustic Piano 明亮的钢琴
'2 Electric Grand Piano 电钢琴
'3 Honky-tonk Piano 酒吧钢琴
'4 Rhodes Piano 柔和的电钢琴
'5 Chorused Piano 加合唱效果的电钢琴
'6 Harpsichord 羽管键琴(拨弦古钢琴)
'7 Clavichord 科拉维科特琴(击弦古钢琴)
'色彩打击乐器
'8 Celesta 钢片琴
'9 Glockenspiel 钟琴
'10 Music box 八音盒
'11 Vibraphone 颤音琴
'12 Marimba 马林巴
'13 Xylophone 木琴
'14 Tubular Bells 管钟
'15 Dulcimer 大扬琴
'风琴
'16 Hammond Organ 击杆风琴
'17 Percussive Organ 打击式风琴
'18 Rock Organ 摇滚风琴
'19 Church Organ 教堂风琴
'20 Reed Organ 簧管风琴
'21 Accordian 手风琴
'22 Harmonica 口琴
'23 Tango Accordian 探戈手风琴
'吉他
'24 Acoustic Guitar (nylon) 尼龙弦吉他
'25 Acoustic Guitar (steel) 钢弦吉他
'26 Electric Guitar (jazz) 爵士电吉他
'27 Electric Guitar (clean) 清音电吉他
'28 Electric Guitar (muted) 闷音电吉他
'29 Overdriven Guitar 加驱动效果的电吉他
'30 Distortion Guitar 加失真效果的电吉他
'31 Guitar Harmonics 吉他和音
'贝司
'32 Acoustic Bass 大贝司(声学贝司)
'33 Electric Bass(finger) 电贝司(指弹)
'34 Electric Bass (pick) 电贝司(拨片)
'35 Fretless Bass 无品贝司
'36 Slap Bass 1 掌击Bass 1
'37 Slap Bass 2 掌击Bass 2
'38 Synth Bass 1 电子合成Bass 1
'39 Synth Bass 2 电子合成Bass 2
'弦乐
'40 Violin 小提琴
'41 Viola 中提琴
'42 Cello 大提琴
'43 Contrabass 低音大提琴
'44 Tremolo Strings 弦乐群颤音音色
'45 Pizzicato Strings 弦乐群拨弦音色
'46 Orchestral Harp 竖琴
'47 Timpani 定音鼓
'合奏/合唱
'48 String Ensemble 1 弦乐合奏音色1
'49 String Ensemble 2 弦乐合奏音色2
'50 Synth Strings 1 合成弦乐合奏音色1
'51 Synth Strings 2 合成弦乐合奏音色2
'52 Choir Aahs 人声合唱“啊”
'53 Voice Oohs 人声“嘟”
'54 Synth Voice 合成人声
'55 Orchestra Hit 管弦乐敲击齐奏
'铜管
'56 Trumpet 小号
'57 Trombone 长号
'58 Tuba 大号
'59 Muted Trumpet 加弱音器小号
'60 French Horn 法国号(圆号)
'61 Brass Section 铜管组(铜管乐器合奏音色)
'62 Synth Brass 1 合成铜管音色1
'63 Synth Brass 2 合成铜管音色2
'簧管
'64 Soprano Sax 高音萨克斯风
'65 Alto Sax 次中音萨克斯风
'66 Tenor Sax 中音萨克斯风
'67 Baritone Sax 低音萨克斯风
'68 Oboe 双簧管
'69 English Horn 英国管
'70 Bassoon 巴松(大管)
'71 Clarinet 单簧管(黑管)
'笛
'72 Piccolo 短笛
'73 Flute 长笛
'74 Recorder 竖笛
'75 Pan Flute 排箫
'76 Bottle Blow [中文名称暂缺]
'77 Shakuhachi 日本尺八
'78 Whistle 口哨声
'79 Ocarina 奥卡雷那
'合成主音
'80 Lead 1 (square) 合成主音1(方波)
'81 Lead 2 (sawtooth) 合成主音2(锯齿波)
'82 Lead 3 (caliope lead) 合成主音3
'83 Lead 4 (chiff lead) 合成主音4
'84 Lead 5 (charang) 合成主音5
'85 Lead 6 (voice) 合成主音6(人声)
'86 Lead 7 (fifths) 合成主音7(平行五度)
'87 Lead 8 (bass+lead) 合成主音8(贝司加主音)
'合成音色
'88 Pad 1 (new age) 合成音色1(新世纪)
'89 Pad 2 (warm) 合成音色2 (温暖)
'90 Pad 3 (polysynth) 合成音色3
'91 Pad 4 (choir) 合成音色4 (合唱)
'92 Pad 5 (bowed) 合成音色5
'93 Pad 6 (metallic) 合成音色6 (金属声)
'94 Pad 7 (halo) 合成音色7 (光环)
'95 Pad 8 (sweep) 合成音色8
'合成效果
'96 FX 1 (rain) 合成效果 1 雨声
'97 FX 2 (soundtrack) 合成效果 2 音轨
'98 FX 3 (crystal) 合成效果 3 水晶
'99 FX 4 (atmosphere) 合成效果 4 大气
'100 FX 5 (brightness) 合成效果 5 明亮
'101 FX 6 (goblins) 合成效果 6 鬼怪
'102 FX 7 (echoes) 合成效果 7 回声
'103 FX 8 (sci-fi) 合成效果 8 科幻
'民间乐器
'104 Sitar 西塔尔(印度)
'105 Banjo 班卓琴(美洲)
'106 Shamisen 三昧线(日本)
'107 Koto 十三弦筝(日本)
'108 Kalimba 卡林巴
'109 Bagpipe 风笛
'110 Fiddle 民族提琴
'111 Shanai 山奈
'打击乐器
'112 Tinkle Bell 叮当铃
'113 Agogo [中文名称暂缺]
'114 Steel Drums 钢鼓
'115 Woodblock 木鱼
'116 Taiko Drum 太鼓
'117 Melodic Tom 通通鼓
'118 Synth Drum 合成鼓
'119 Reverse Cymbal 铜钹
'Sound Effects 声音效果
'120 Guitar Fret Noise 吉他换把杂音
'121 Breath Noise 呼吸声
'122 Seashore 海浪声
'123 Bird Tweet 鸟鸣
'124 Telephone Ring 电话铃
'125 Helicopter 直升机
'126 Applause 鼓掌声
'127 Gunshot

Private Property Let sType(ByVal New_Data As Integer)
If Not IsNumeric(New_Data) Then New_Data = 0
If New_Data < 0 Then New_Data = 0
If New_Data > 127 Then New_Data = 127
mvarsType = New_Data
midiOutShortMsg Hmidi, mvarsType * &H100 + &HC0
End Property

Private Property Get sType() As Integer
sType = mvarsType
End Property

Private Function MidOpen() As Long
Call midiOutClose(Hmidi)
Rc = midiOutOpen(Hmidi, CurDevice, 0, 0, 0)
If (Rc <> 0) Then
Call midiOutClose(Hmidi)
End If
midiOutShortMsg Hmidi, &HC0
MidOpen = Rc
End Function

Private Sub MidStop()
Call midiOutShortMsg(Hmidi, StopMidimsg)
End Sub

Private Sub MidClose()
Call midiOutClose(Hmidi)
End Sub

Private Sub outNum(ByVal sNum As Integer)
If Not IsNumeric(sNum) Then Exit Sub
If sNum < 0 Then sNum = 0
If sNum > 127 Then sNum = 127
StopMidimsg = &H80 + ((sNum) * &H100) + Channel
Call midiOutShortMsg(Hmidi, &H90 + ((sNum) * &H100) + (Volume * &H10000) + Channel)
End Sub

Private Sub CmdQuit_Click()
Unload FrmMain
Set FrmMain = Nothing
End
End Sub

Private Sub Form_Load()

Call fill_sound_list1

Call fill_sound_list2

PicA(12).CurrentX = 120
PicA(12).CurrentY = 2460
PicA(12).Print “F”
PicA(12).ForeColor = &HFF0000
PicA(12).CurrentX = 60
PicA(12).CurrentY = 2100
PicA(12).Print 1
PicA(14).CurrentX = 120
PicA(14).CurrentY = 2460
PicA(14).Print “G”
PicA(14).ForeColor = &HFF0000
PicA(14).CurrentX = 60
PicA(14).CurrentY = 2100
PicA(14).Print 2
PicA(16).CurrentX = 120
PicA(16).CurrentY = 2460
PicA(16).Print “H”
PicA(16).ForeColor = &HFF0000
PicA(16).CurrentX = 60
PicA(16).CurrentY = 2100
PicA(16).Print 3
PicA(17).CurrentX = 120
PicA(17).CurrentY = 2460
PicA(17).Print “J”
PicA(17).ForeColor = &HFF0000
PicA(17).CurrentX = 60
PicA(17).CurrentY = 2100
PicA(17).Print 4
PicA(19).CurrentX = 120
PicA(19).CurrentY = 2460
PicA(19).Print “K”
PicA(19).ForeColor = &HFF0000
PicA(19).CurrentX = 60
PicA(19).CurrentY = 2100
PicA(19).Print 5
PicA(21).CurrentX = 120
PicA(21).CurrentY = 2460
PicA(21).Print “L”
PicA(21).ForeColor = &HFF0000
PicA(21).CurrentX = 60
PicA(21).CurrentY = 2100
PicA(21).Print 6
PicA(23).CurrentX = 135
PicA(23).CurrentY = 2445
PicA(23).Print “;”
PicA(23).ForeColor = &HFF0000
PicA(23).CurrentX = 60
PicA(23).CurrentY = 2100
PicA(23).Print 7
PicA(11).CurrentX = 120
PicA(11).CurrentY = 2460
PicA(11).Print “D”
PicA(11).ForeColor = &HFF0000
PicA(11).CurrentX = 60
PicA(11).CurrentY = 2100
PicA(11).Print 7
PicA(11).CurrentX = 150
PicA(11).CurrentY = 2190
PicA(11).Print “.”
PicA(9).CurrentX = 120
PicA(9).CurrentY = 2460
PicA(9).Print “S”
PicA(9).ForeColor = &HFF0000
PicA(9).CurrentX = 60
PicA(9).CurrentY = 2100
PicA(9).Print 6
PicA(9).CurrentX = 150
PicA(9).CurrentY = 2190
PicA(9).Print “.”
PicA(7).CurrentX = 120
PicA(7).CurrentY = 2460
PicA(7).Print “A”
PicA(7).ForeColor = &HFF0000
PicA(7).CurrentX = 60
PicA(7).CurrentY = 2100
PicA(7).Print 5
PicA(7).CurrentX = 150
PicA(7).CurrentY = 2190
PicA(7).Print “.”
PicA(5).CurrentX = 120
PicA(5).CurrentY = 2460
PicA(5).Print “R”
PicA(5).ForeColor = &HFF0000
PicA(5).CurrentX = 60
PicA(5).CurrentY = 2100
PicA(5).Print 4
PicA(5).CurrentX = 150
PicA(5).CurrentY = 2190
PicA(5).Print “.”
PicA(4).CurrentX = 120
PicA(4).CurrentY = 2460
PicA(4).Print “E”
PicA(4).ForeColor = &HFF0000
PicA(4).CurrentX = 60
PicA(4).CurrentY = 2100
PicA(4).Print 3
PicA(4).CurrentX = 150
PicA(4).CurrentY = 2190
PicA(4).Print “.”
PicA(2).CurrentX = 90
PicA(2).CurrentY = 2460
PicA(2).Print “W”
PicA(2).ForeColor = &HFF0000
PicA(2).CurrentX = 60
PicA(2).CurrentY = 2100
PicA(2).Print 2
PicA(2).CurrentX = 150
PicA(2).CurrentY = 2190
PicA(2).Print “.”
PicA(0).CurrentX = 120
PicA(0).CurrentY = 2460
PicA(0).Print “Q”
PicA(0).ForeColor = &HFF0000
PicA(0).CurrentX = 60
PicA(0).CurrentY = 2100
PicA(0).Print 1
PicA(0).CurrentX = 150
PicA(0).CurrentY = 2190
PicA(0).Print “.”
PicA(24).CurrentX = 120
PicA(24).CurrentY = 2520
PicA(24).Print “”“”
PicA(24).ForeColor = &HFF0000
PicA(24).CurrentX = 60
PicA(24).CurrentY = 2100
PicA(24).Print 1
PicA(24).CurrentX = 150
PicA(24).CurrentY = 1890
PicA(24).Print “.”
PicA(26).CurrentX = 120
PicA(26).CurrentY = 2460
PicA(26).Print “U”
PicA(26).ForeColor = &HFF0000
PicA(26).CurrentX = 60
PicA(26).CurrentY = 2100
PicA(26).Print 2
PicA(26).CurrentX = 150
PicA(26).CurrentY = 1890
PicA(26).Print “.”
PicA(28).CurrentX = 120
PicA(28).CurrentY = 2460
PicA(28).Print “I”
PicA(28).ForeColor = &HFF0000
PicA(28).CurrentX = 60
PicA(28).CurrentY = 2100
PicA(28).Print 3
PicA(28).CurrentX = 150
PicA(28).CurrentY = 1890
PicA(28).Print “.”
PicA(29).CurrentX = 120
PicA(29).CurrentY = 2460
PicA(29).Print “O”
PicA(29).ForeColor = &HFF0000
PicA(29).CurrentX = 60
PicA(29).CurrentY = 2100
PicA(29).Print 4
PicA(29).CurrentX = 150
PicA(29).CurrentY = 1890
PicA(29).Print “.”
PicA(31).CurrentX = 120
PicA(31).CurrentY = 2460
PicA(31).Print “P”
PicA(31).ForeColor = &HFF0000
PicA(31).CurrentX = 60
PicA(31).CurrentY = 2100
PicA(31).Print 5
PicA(31).CurrentX = 150
PicA(31).CurrentY = 1890
PicA(31).Print “.”
PicA(33).CurrentX = 135
PicA(33).CurrentY = 2445
PicA(33).Print “[”
PicA(33).ForeColor = &HFF0000
PicA(33).CurrentX = 60
PicA(33).CurrentY = 2100
PicA(33).Print 6
PicA(33).CurrentX = 150
PicA(33).CurrentY = 1890
PicA(33).Print “.”
PicA(35).CurrentX = 135
PicA(35).CurrentY = 2445
PicA(35).Print “]”
PicA(35).ForeColor = &HFF0000
PicA(35).CurrentX = 60
PicA(35).CurrentY = 2100
PicA(35).Print 7
PicA(35).CurrentX = 150
PicA(35).CurrentY = 1890
PicA(35).Print “.”

PicA(1).CurrentX = 105
PicA(1).CurrentY = 1320
PicA(1).Print “1”
PicA(3).CurrentX = 120
PicA(3).CurrentY = 1320
PicA(3).Print “2”
PicA(6).CurrentX = 105
PicA(6).CurrentY = 1320
PicA(6).Print “Z”
PicA(8).CurrentX = 105
PicA(8).CurrentY = 1320
PicA(8).Print “X”
PicA(10).CurrentX = 105
PicA(10).CurrentY = 1320
PicA(10).Print “C”
PicA(13).CurrentX = 105
PicA(13).CurrentY = 1320
PicA(13).Print “V”
PicA(15).CurrentX = 105
PicA(15).CurrentY = 1320
PicA(15).Print “B”
PicA(18).CurrentX = 105
PicA(18).CurrentY = 1320
PicA(18).Print “N”
PicA(20).CurrentX = 105
PicA(20).CurrentY = 1320
PicA(20).Print “M”
PicA(22).CurrentX = 150
PicA(22).CurrentY = 1275
PicA(22).Print “,”
PicA(25).CurrentX = 150
PicA(25).CurrentY = 1305
PicA(25).Print “.”
PicA(27).CurrentX = 120
PicA(27).CurrentY = 1320
PicA(27).Print “/”
PicA(30).CurrentX = 120
PicA(30).CurrentY = 1320
PicA(30).Print “8”
PicA(32).CurrentX = 120
PicA(32).CurrentY = 1320
PicA(32).Print “9”
PicA(34).CurrentX = 120
PicA(34).CurrentY = 1320
PicA(34).Print “0”
MidOpen

End Sub

Private Sub Form_Unload(Cancel As Integer)
MidStop
MidClose
Set mm = Nothing
End Sub

Private Sub PicA_Click(Index As Integer)
outNum (Index + 48)
End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case 81: Call PicA_Click(0)
Case 49: Call PicA_Click(1)
Case 87: Call PicA_Click(2)
Case 50: Call PicA_Click(3)
Case 69: Call PicA_Click(4)
Case 82: Call PicA_Click(5)
Case 90: Call PicA_Click(6)
Case 65: Call PicA_Click(7)
Case 88: Call PicA_Click(8)
Case 83: Call PicA_Click(9)
Case 67: Call PicA_Click(10)
Case 68: Call PicA_Click(11)
Case 70: Call PicA_Click(12)
Case 86: Call PicA_Click(13)
Case 71: Call PicA_Click(14)
Case 66: Call PicA_Click(15)
Case 72: Call PicA_Click(16)
Case 74: Call PicA_Click(17)
Case 78: Call PicA_Click(18)
Case 75: Call PicA_Click(19)
Case 77: Call PicA_Click(20)
Case 76: Call PicA_Click(21)
Case 188: Call PicA_Click(22)
Case 186: Call PicA_Click(23)
Case 222: Call PicA_Click(24)
Case 190: Call PicA_Click(25)
Case 85: Call PicA_Click(26)
Case 191: Call PicA_Click(27)
Case 73: Call PicA_Click(28)
Case 79: Call PicA_Click(29)
Case 56: Call PicA_Click(30)
Case 80: Call PicA_Click(31)
Case 57: Call PicA_Click(32)
Case 219: Call PicA_Click(33)
Case 48: Call PicA_Click(34)
Case 221: Call PicA_Click(35)
End Select
End Sub

Private Sub Command1_Click()
Dim s1 As String
Dim s2 As String
Dim i As Integer
Dim instrument1 As Integer
Dim instrument2 As Integer
Dim note1 As String
Dim note2 As String

instrument1 = 0
   instrument2 = 0
   
   
   
   
   
   s1 = Text1(0).Text
   s2 = Text2(1).Text '假设第二个文本框的名称为 Text1(1)


  For i = 1 To Len(s1) Or Len(s2) '取两个字符串长度中的较大值作为循环次数
       If i <= Len(s1) Then
           note1 = Mid(s1, i, 1)
       Else
           note1 = "" '如果第一个字符串结束了,设置为空字符串
       End If
       
       If i <= Len(s2) Then
           note2 = Mid(s2, i, 1)
       Else
           note2 = "" '如果第二个字符串结束了,设置为空字符串
       End If
       
       Dim midiNote1 As Integer
       Dim midiNote2 As Integer
                Select Case note1
          Case "-"
        midiNote1 = 0
 
     Case "1...."
        midiNote1 = 1
     Case "2...."
        midiNote1 = 2
     Case "3...."
        midiNote1 = 3
     Case "4...."
        midiNote1 = 4
     Case "5...."
        midiNote1 = 5
     Case "6...."
        midiNote1 = 6
     Case "7...."
        midiNote1 = 7
     Case "1..."
        midiNote1 = 8
     Case "2..."
        midiNote1 = 9
     Case "3..."
        midiNote1 = 10
     Case "4..."
        midiNote1 = 11

     Case "5..."
        midiNote1 = 12


     Case "6..."
        midiNote1 = 13

     Case "7..."
        midiNote1 = 14

    Case "1.."
        midiNote1 = 15


     Case "2.."
        midiNote1 = 16

     Case "3.."
        midiNote1 = 17

    Case "4.."
        midiNote1 = 18


     Case "5.."
        midiNote1 = 19

     Case "6.."
        midiNote1 = 20

 Case "7.."
        midiNote1 = 21


    Case "1."
        midiNote1 = 22


     Case "2."
        midiNote1 = 23

     Case "3."
        midiNote1 = 24

    Case "4."
        midiNote1 = 25


     Case "5."
        midiNote1 = 26

     Case "6."
        midiNote1 = 27

 Case "7."
        midiNote1 = 28




    Case "1"
        midiNote1 = 29


     Case "2"
        midiNote1 = 30

     Case "3"
        midiNote1 = 31

    Case "4"
        midiNote1 = 32


     Case "5"
        midiNote1 = 33

     Case "6"
        midiNote1 = 34

 Case "7"
        midiNote1 = 35




    Case "1'"
        midiNote1 = 36


     Case "2'"
        midiNote1 = 37

     Case "3'"
        midiNote1 = 38

    Case "4'"
        midiNote1 = 39


     Case "5'"
        midiNote1 = 40

     Case "6'"
        midiNote1 = 41

 Case "7'"
        midiNote1 = 42




    Case "1''"
        midiNote1 = 43


     Case "2''"
        midiNote1 = 44

     Case "3''"
        midiNote1 = 45

    Case "4''"
        midiNote1 = 46


     Case "5''"
        midiNote1 = 47

     Case "6''"
        midiNote1 = 48

 Case "7''"
        midiNote1 = 49


    Case "1'''"
        midiNote1 = 50


     Case "2'''"
        midiNote1 = 51

     Case "3'''"
        midiNote1 = 52

    Case "4'''"
        midiNote1 = 53


     Case "5'''"
        midiNote1 = 54

     Case "6'''"
        midiNote1 = 55

 Case "7'''"
        midiNote1 = 56


    Case "1''''"
        midiNote1 = 57


     Case "2''''"
        midiNote1 = 58

     Case "3''''"
        midiNote1 = 59

    Case "4''''"
        midiNote1 = 60


     Case "5''''"
        midiNote1 = 61

     Case "6''''"
        midiNote1 = 62

 Case "7''''"
        midiNote1 = 63
           Case Else
               midiNote1 = 0
       End Select
       
       Select Case note2
            Case "-"
        midiNote2 = 0
     Case "1...."
        midiNote2 = 1
     Case "2...."
        midiNote2 = 2
     Case "3...."
        midiNote2 = 3
     Case "4...."
        midiNote2 = 4
     Case "5...."
        midiNote2 = 5
     Case "6...."
        midiNote2 = 6
     Case "7...."
        midiNote2 = 7
     Case "1..."
        midiNote2 = 8
     Case "2..."
        midiNote2 = 9
     Case "3..."
        midiNote2 = 10
     Case "4..."
        midiNote2 = 11

     Case "5..."
        midiNote2 = 12


     Case "6..."
        midiNote2 = 13

     Case "7..."
        midiNote2 = 14

    Case "1.."
        midiNote2 = 15


     Case "2.."
        midiNote2 = 16

     Case "3.."
        midiNote2 = 17

    Case "4.."
        midiNote2 = 18


     Case "5.."
        midiNote2 = 19

     Case "6.."
        midiNote2 = 20

 Case "7.."
        midiNote2 = 21


    Case "1."
        midiNote2 = 22


     Case "2."
        midiNote2 = 23

     Case "3."
        midiNote2 = 24

    Case "4."
        midiNote2 = 25


     Case "5."
        midiNote2 = 26

     Case "6."
        midiNote2 = 27

 Case "7."
        midiNote2 = 28




    Case "1"
        midiNote2 = 29


     Case "2"
        midiNote2 = 30

     Case "3"
        midiNote2 = 31

    Case "4"
        midiNote2 = 32


     Case "5"
        midiNote2 = 33

     Case "6"
        midiNote2 = 34

 Case "7"
        midiNote2 = 35




    Case "1'"
        midiNote2 = 36


     Case "2'"
        midiNote2 = 37

     Case "3'"
        midiNote2 = 38

    Case "4'"
        midiNote2 = 39


     Case "5'"
        midiNote2 = 40

     Case "6'"
        midiNote2 = 41

 Case "7'"
        midiNote2 = 42




    Case "1''"
        midiNote2 = 43


     Case "2''"
        midiNote2 = 44

     Case "3''"
        midiNote2 = 45

    Case "4''"
        midiNote2 = 46


     Case "5''"
        midiNote2 = 47

     Case "6''"
        midiNote2 = 48

 Case "7''"
        midiNote2 = 49


    Case "1'''"
        midiNote2 = 50


     Case "2'''"
        midiNote2 = 51

     Case "3'''"
        midiNote2 = 52

    Case "4'''"
        midiNote2 = 53


     Case "5'''"
        midiNote2 = 54

     Case "6'''"
        midiNote2 = 55

 Case "7'''"
        midiNote2 = 56


    Case "1''''"
        midiNote2 = 57


     Case "2''''"
        midiNote2 = 58

     Case "3''''"
        midiNote2 = 59

    Case "4''''"
        midiNote2 = 60


     Case "5''''"
        midiNote2 = 61

     Case "6''''"
        midiNote2 = 62

 Case "7''''"
        midiNote2 = 63



        Case Else
               midiNote2 = 0
       End Select
       
      
   If midiNote1 > 0 Then
           Call PicA_Click(midiNote1)
           '设置第一个音符的音色
           sType = Combo1.ListIndex
       End If
       
       If midiNote2 > 0 Then
           Call PicA_Click(midiNote2)
           '设置第二个音符的音色
           sType = Combo2.ListIndex
       End If
       
       Sleep 200
   Next

End Sub

Private Sub fill_sound_list1()

    Combo1.AddItem "大钢琴(声学钢琴)0"
    Combo1.AddItem "明亮的钢琴1"
    Combo1.AddItem "电钢琴2"
    Combo1.AddItem "酒吧钢琴3"
    Combo1.AddItem "柔和的电钢琴4"
    Combo1.AddItem "加合唱效果的电钢琴5"
    Combo1.AddItem "羽管键琴(拨弦古钢琴)6"
    Combo1.AddItem "科拉维科特琴(击弦古钢琴)7"
    Combo1.AddItem "钢片琴8"
    Combo1.AddItem "钟琴9"
    Combo1.AddItem "八音盒10"
    Combo1.AddItem "颤音琴11"
    Combo1.AddItem "马林巴12"
    Combo1.AddItem "木琴13"
    Combo1.AddItem "管钟14"
    Combo1.AddItem "大扬琴15"
    Combo1.AddItem "击杆风琴16"
    Combo1.AddItem "打击式风琴17"
    Combo1.AddItem "摇滚风琴18"
    Combo1.AddItem "教堂风琴19"
    Combo1.AddItem "簧管风琴20"
    Combo1.AddItem "手风琴21"
    Combo1.AddItem "口琴22"
    Combo1.AddItem "探戈手风琴23"
    Combo1.AddItem "尼龙弦吉他24"
    Combo1.AddItem "钢弦吉他25"
    Combo1.AddItem "爵士电吉他26"
    Combo1.AddItem "清音电吉他27"
    Combo1.AddItem "闷音电吉他28"
    Combo1.AddItem "加驱动效果的电吉他29"
    Combo1.AddItem "加失真效果的电吉他30"
    Combo1.AddItem "吉他和音31"
    Combo1.AddItem "大贝司(声学贝司)32"
    Combo1.AddItem "电贝司(指弹)33"
    Combo1.AddItem "电贝司(拨片)34"
    Combo1.AddItem "无品贝司35"
    Combo1.AddItem "掌击贝司136"
    Combo1.AddItem "掌击贝司237"
    Combo1.AddItem "电子合成贝司138"
    Combo1.AddItem "电子合成贝司239"
    Combo1.AddItem "小提琴40"
    Combo1.AddItem "中提琴41"
    Combo1.AddItem "大提琴42"
    Combo1.AddItem "低音大提琴43"
    Combo1.AddItem "弦乐群颤音音色44"
    Combo1.AddItem "弦乐群拨弦音色45"
    Combo1.AddItem "竖琴46"
    Combo1.AddItem "定音鼓47"
    Combo1.AddItem "弦乐合奏音色148"
    Combo1.AddItem "弦乐合奏音色249"
    Combo1.AddItem "合成弦乐合奏音色150"
    Combo1.AddItem "合成弦乐合奏音色251"
    Combo1.AddItem "人声合唱啊52"
    Combo1.AddItem "人声嘟53"
    Combo1.AddItem "合成人声54"
    Combo1.AddItem "管弦乐敲击齐奏55"
    Combo1.AddItem "小号56"
    Combo1.AddItem "长号57"
    Combo1.AddItem "大号58"
    Combo1.AddItem "加弱音器小号59"
    Combo1.AddItem "法国号(圆号)60"
    Combo1.AddItem "铜管组(铜管乐器合奏音色)61"
    Combo1.AddItem "合成铜管音色162"
    Combo1.AddItem "合成铜管音色263"
    Combo1.AddItem "高音萨克斯风64"
    Combo1.AddItem "次中音萨克斯风65"
    Combo1.AddItem "中音萨克斯风66"
    Combo1.AddItem "低音萨克斯风67"
    Combo1.AddItem "双簧管68"
    Combo1.AddItem "英国管69"
    Combo1.AddItem "巴松(大管)70"
    Combo1.AddItem "单簧管(黑管)71"
    Combo1.AddItem "短笛72"
    Combo1.AddItem "长笛73"
    Combo1.AddItem "竖笛74"
    Combo1.AddItem "排箫75"
    Combo1.AddItem "吹瓶声76"
    Combo1.AddItem "日本尺八77"
    Combo1.AddItem "口哨声78"
    Combo1.AddItem "奥卡雷那79"
    Combo1.AddItem "合成主音1(方波)80"
    Combo1.AddItem "合成主音2(锯齿波)81"
    Combo1.AddItem "合成主音382"
    Combo1.AddItem "合成主音483"
    Combo1.AddItem "合成主音584"
    Combo1.AddItem "合成主音6(人声)85"
    Combo1.AddItem "合成主音7(平行五度)86"
    Combo1.AddItem "合成主音8(贝司加主音)87"
    Combo1.AddItem "合成音色1(新世纪)88"
    Combo1.AddItem "合成音色2(温暖)89"
    Combo1.AddItem "合成音色390"
    Combo1.AddItem "合成音色4(合唱)91"
    Combo1.AddItem "合成音色592"
    Combo1.AddItem "合成音色6(金属声)93"
    Combo1.AddItem "合成音色7(光环)94"
    Combo1.AddItem "合成音色895"
    Combo1.AddItem "合成效果1雨声96"
    Combo1.AddItem "合成效果2音轨97"
    Combo1.AddItem "合成效果3水晶98"
    Combo1.AddItem "合成效果4大气99"
    Combo1.AddItem "合成效果5明亮100"
    Combo1.AddItem "合成效果6鬼怪101"
    Combo1.AddItem "合成效果7回声102"
    Combo1.AddItem "合成效果8科幻103"
    Combo1.AddItem "西塔尔(印度)104"
    Combo1.AddItem "班卓琴(美洲)105"
    Combo1.AddItem "三昧线(日本)106"
    Combo1.AddItem "十三弦筝(日本)107"
    Combo1.AddItem "卡林巴108"
    Combo1.AddItem "风笛109"
    Combo1.AddItem "民族提琴110"
    Combo1.AddItem "唢呐111"
    Combo1.AddItem "叮当铃112"
    Combo1.AddItem "阿哥哥鼓113"
    Combo1.AddItem "钢鼓114"
    Combo1.AddItem "木鱼115"
    Combo1.AddItem "太鼓116"
    Combo1.AddItem "古高音鼓117"
    Combo1.AddItem "合成鼓118"
    Combo1.AddItem "铜钹119"
    Combo1.AddItem "磨弦120"
    Combo1.AddItem "呼吸声121"
    Combo1.AddItem "海浪声122"
    Combo1.AddItem "鸟鸣123"
    Combo1.AddItem "电话铃124"
    Combo1.AddItem "直升机125"
    Combo1.AddItem "鼓掌声126"
    Combo1.AddItem "枪声127"

Combo1.ListIndex = 0

End Sub

Private Sub fill_sound_list2()
Combo2.AddItem “大钢琴(声学钢琴)0”
Combo2.AddItem “明亮的钢琴1”
Combo2.AddItem “电钢琴2”
Combo2.AddItem “酒吧钢琴3”
Combo2.AddItem “柔和的电钢琴4”
Combo2.AddItem “加合唱效果的电钢琴5”
Combo2.AddItem “羽管键琴(拨弦古钢琴)6”
Combo2.AddItem “科拉维科特琴(击弦古钢琴)7”
Combo2.AddItem “钢片琴8”
Combo2.AddItem “钟琴9”
Combo2.AddItem “八音盒10”
Combo2.AddItem “颤音琴11”
Combo2.AddItem “马林巴12”
Combo2.AddItem “木琴13”
Combo2.AddItem “管钟14”
Combo2.AddItem “大扬琴15”
Combo2.AddItem “击杆风琴16”
Combo2.AddItem “打击式风琴17”
Combo2.AddItem “摇滚风琴18”
Combo2.AddItem “教堂风琴19”
Combo2.AddItem “簧管风琴20”
Combo2.AddItem “手风琴21”
Combo2.AddItem “口琴22”
Combo2.AddItem “探戈手风琴23”
Combo2.AddItem “尼龙弦吉他24”
Combo2.AddItem “钢弦吉他25”
Combo2.AddItem “爵士电吉他26”
Combo2.AddItem “清音电吉他27”
Combo2.AddItem “闷音电吉他28”
Combo2.AddItem “加驱动效果的电吉他29”
Combo2.AddItem “加失真效果的电吉他30”
Combo2.AddItem “吉他和音31”
Combo2.AddItem “大贝司(声学贝司)32”
Combo2.AddItem “电贝司(指弹)33”
Combo2.AddItem “电贝司(拨片)34”
Combo2.AddItem “无品贝司35”
Combo2.AddItem “掌击贝司136”
Combo2.AddItem “掌击贝司237”
Combo2.AddItem “电子合成贝司138”
Combo2.AddItem “电子合成贝司239”
Combo2.AddItem “小提琴40”
Combo2.AddItem “中提琴41”
Combo2.AddItem “大提琴42”
Combo2.AddItem “低音大提琴43”
Combo2.AddItem “弦乐群颤音音色44”
Combo2.AddItem “弦乐群拨弦音色45”
Combo2.AddItem “竖琴46”
Combo2.AddItem “定音鼓47”
Combo2.AddItem “弦乐合奏音色148”
Combo2.AddItem “弦乐合奏音色249”
Combo2.AddItem “合成弦乐合奏音色150”
Combo2.AddItem “合成弦乐合奏音色251”
Combo2.AddItem “人声合唱啊52”
Combo2.AddItem “人声嘟53”
Combo2.AddItem “合成人声54”
Combo2.AddItem “管弦乐敲击齐奏55”
Combo2.AddItem “小号56”
Combo2.AddItem “长号57”
Combo2.AddItem “大号58”
Combo2.AddItem “加弱音器小号59”
Combo2.AddItem “法国号(圆号)60”
Combo2.AddItem “铜管组(铜管乐器合奏音色)61”
Combo2.AddItem “合成铜管音色162”
Combo2.AddItem “合成铜管音色263”
Combo2.AddItem “高音萨克斯风64”
Combo2.AddItem “次中音萨克斯风65”
Combo2.AddItem “中音萨克斯风66”
Combo2.AddItem “低音萨克斯风67”
Combo2.AddItem “双簧管68”
Combo2.AddItem “英国管69”
Combo2.AddItem “巴松(大管)70”
Combo2.AddItem “单簧管(黑管)71”
Combo2.AddItem “短笛72”
Combo2.AddItem “长笛73”
Combo2.AddItem “竖笛74”
Combo2.AddItem “排箫75”
Combo2.AddItem “吹瓶声76”
Combo2.AddItem “日本尺八77”
Combo2.AddItem “口哨声78”
Combo2.AddItem “奥卡雷那79”
Combo2.AddItem “合成主音1(方波)80”
Combo2.AddItem “合成主音2(锯齿波)81”
Combo2.AddItem “合成主音382”
Combo2.AddItem “合成主音483”
Combo2.AddItem “合成主音584”
Combo2.AddItem “合成主音6(人声)85”
Combo2.AddItem “合成主音7(平行五度)86”
Combo2.AddItem “合成主音8(贝司加主音)87”
Combo2.AddItem “合成音色1(新世纪)88”
Combo2.AddItem “合成音色2(温暖)89”
Combo2.AddItem “合成音色390”
Combo2.AddItem “合成音色4(合唱)91”
Combo2.AddItem “合成音色592”
Combo2.AddItem “合成音色6(金属声)93”
Combo2.AddItem “合成音色7(光环)94”
Combo2.AddItem “合成音色895”
Combo2.AddItem “合成效果1雨声96”
Combo2.AddItem “合成效果2音轨97”
Combo2.AddItem “合成效果3水晶98”
Combo2.AddItem “合成效果4大气99”
Combo2.AddItem “合成效果5明亮100”
Combo2.AddItem “合成效果6鬼怪101”
Combo2.AddItem “合成效果7回声102”
Combo2.AddItem “合成效果8科幻103”
Combo2.AddItem “西塔尔(印度)104”
Combo2.AddItem “班卓琴(美洲)105”
Combo2.AddItem “三昧线(日本)106”
Combo2.AddItem “十三弦筝(日本)107”
Combo2.AddItem “卡林巴108”
Combo2.AddItem “风笛109”
Combo2.AddItem “民族提琴110”
Combo2.AddItem “唢呐111”
Combo2.AddItem “叮当铃112”
Combo2.AddItem “阿哥哥鼓113”
Combo2.AddItem “钢鼓114”
Combo2.AddItem “木鱼115”
Combo2.AddItem “太鼓116”
Combo2.AddItem “古高音鼓117”
Combo2.AddItem “合成鼓118”
Combo2.AddItem “铜钹119”
Combo2.AddItem “磨弦120”
Combo2.AddItem “呼吸声121”
Combo2.AddItem “海浪声122”
Combo2.AddItem “鸟鸣123”
Combo2.AddItem “电话铃124”
Combo2.AddItem “直升机125”
Combo2.AddItem “鼓掌声126”
Combo2.AddItem “枪声127”

Combo2.ListIndex = 10

End Sub

标签:Combo1,VB,QZQ,AddItem,Combo2,CurrentY,Print,电子琴,PicA
From: https://blog.csdn.net/qq_32257509/article/details/141709492

相关文章

  • VB版本MIDI钢琴简谱播放器全代码QZQ-2024-8-30
    PrivateDeclareFunctionGetKeyState%Lib“user32”(ByValnVirtKeyAsLong)PrivateDeclareSubSleepLib“kernel32”(ByValdwMillisecondsAsLong)PrivatesuduAsIntegerPrivateConstVK_LBUTTON&=&H1PrivateisOgainAsBoolean'是否重复按键Pri......
  • VBA技术资料MF195:屏蔽工作表中的粘贴输入
    我给VBA的定义:VBA是个人小型自动化处理的有效工具。利用好了,可以大大提高自己的工作效率,而且可以提高数据的准确度。“VBA语言攻”提供的教程一共九套,分为初级、中级、高级三大部分,教程是对VBA的系统讲解,从简单的入门、到入门后的提高、到数据库、到字典、到WordVBA的应用、到高级......
  • 【VBA】通常関数
    Start'ログ出力1(引数)PublicSubLogInfo1(strAsString)CallLogInfo2(Now,str)EndSub'ログ出力2(引数)PublicSubLogInfo2(keyAsString,valueAsString)CallLogInfo3(key,value,":")EndSub'ログ出力3(引数)PublicSubLogInfo3(key......
  • VBA学习(60):补充:Excel VBA 选择输入/TreeView控件/在工作表中如何顺利使用TreeView控
    上一篇文章我们分享了一例通过TreeView控件,实现会计科目的选择输入的方法,(ExcelVBA选择输入/TreeView控件):然而,当今天我打开它准备发送给索要示例文件的小伙伴的时候,咦,这是什么鬼?再进入设计模式:TreeView1这个控件,它在啊在代码窗口查看:名称怎么变成了TreeView41?难......
  • catvod、TVBox源的格式解析及合并多个源的内容(Python脚本)
    文章目录TVBox官网核心代码分析源内容的结构定义源内容的主体结构解析直播的结构解析ApiConfig其他处理代码核心类分析完整代码参考合并多个catvod、TVBox源的内容(Python脚本)可用catvod、TVBox源参考(最新接口)更新:解决Spider参数覆盖问题TVBox官网TVBox项目索引:htt......
  • VBA学习(50):实现一键对所有工作表进行排序
    要按名称对工作表进行排序,我们可以逐张选定某工作表,按住鼠标将该工作表拖放在所需的位置,从而实现工作表排序的效果。但如果工作表较多,手动拖放进行工作表排序,显然不是最有效率的方式。为此,我们可以借助于VBA实现按工作表名称,一键对所有工作表进行升序或降序排列。对工作表进......
  • QT+OpenGL 使用VAO、VBO、EBO结合绘制一个正方形
    一、概述需求:绘制一个正方形,可以控制正方形的颜色、可以切换正方形为线框模式/填充模式绘制流程:1.定义一个顶点着色器和片元着色器shader2.Qt创建一个Widget并继承QOpenGLWidget、QOpenGLFunctions,并重写initializeGL()、resizeGL(w,h)、pai......
  • OpenGL中的VAO、VBO、EBO
    一、概述目的:简单介绍一下VAO、VBO、EBO,使用他们能提高opengl的渲染效率VAO:顶点数组对象(VertexArrayObject)VAO就相当于一个管理者的角色,在GPU中创建一个VAO对象用于管理VBO、EBO。VBO和EBO创建绑定好后会自动挂到VAO下。VBO:顶点缓冲对象(VertexBuffe......
  • vb6 链接MySLQ 数据库过程记录
    1必须安装mysql 驱动 vb6是32位 所以必须到mysql 网站下载32位ODBC 驱动2vb6必须添加引用 见代码3总结 主要是版本一定去下载32位mysql ODBC驱动来安装PrivateSubCommand1_Click()'‘需要添加ado'菜单"工程"->"引用"找MicrosoftActiveXDataObject........
  • RISC-V全志D1sCVBS套件文章汇总
    RISC-V全志D1sCVBS套件提示此开发板的任何问题都可以在我们的论坛交流讨论 https://forums.100ask.net/c/10-category/75-category/75文章目录汇总 文章共计4章,下面是章节汇总:第0章_RISC-V全志D1sCVBS套件第1章_快速启动第2章_安装并配置开发环境第3章_Tina-SDK开......