home *** CD-ROM | disk | FTP | other *** search
/ Multimédia la Compil' 2 / Sybex_Multimedia_La_Compil_2.iso / cooltool / piano / piano2.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-04-21  |  48.2 KB  |  1,419 lines

  1. VERSION 2.00
  2. Begin Form Piano 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   0  'None
  5.    Caption         =   "MIDI CoolTools - Piano"
  6.    Height          =   2355
  7.    Icon            =   PIANO2.FRX:0000
  8.    Left            =   45
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    ScaleHeight     =   1665
  12.    ScaleWidth      =   9330
  13.    Top             =   1530
  14.    Width           =   9450
  15.    Begin Frame Frame1 
  16.       BackColor       =   &H00C0C0C0&
  17.       Height          =   915
  18.       Left            =   -30
  19.       TabIndex        =   8
  20.       Top             =   0
  21.       Width           =   9375
  22.       Begin ComboBox ComboPatch 
  23.          BackColor       =   &H00000000&
  24.          FontBold        =   0   'False
  25.          FontItalic      =   0   'False
  26.          FontName        =   "MS Sans Serif"
  27.          FontSize        =   8.25
  28.          FontStrikethru  =   0   'False
  29.          FontUnderline   =   0   'False
  30.          ForeColor       =   &H0000FF00&
  31.          Height          =   300
  32.          Left            =   5460
  33.          Style           =   2  'Dropdown List
  34.          TabIndex        =   5
  35.          Top             =   510
  36.          Width           =   2295
  37.       End
  38.       Begin Knob KnobPan 
  39.          BackColor       =   &H00C0C0C0&
  40.          BevelWidth      =   2
  41.          BorderWidth     =   0
  42.          FontBold        =   0   'False
  43.          FontItalic      =   0   'False
  44.          FontName        =   "Small Fonts"
  45.          FontSize        =   5.25
  46.          FontStrikethru  =   0   'False
  47.          FontUnderline   =   0   'False
  48.          Height          =   600
  49.          Indicator       =   1  'Line
  50.          IndicatorColor  =   &H000000FF&
  51.          IndicatorWidth  =   0
  52.          KnobColor       =   &H00C0C0C0&
  53.          KnobStyle       =   3  'Textured
  54.          Left            =   8160
  55.          LinkControl     =   ""
  56.          LinkProperty    =   ""
  57.          Max             =   127
  58.          Min             =   0
  59.          Radius          =   240
  60.          TickCaptionColor=   &H00000000&
  61.          TickCaptions    =   PIANO2.FRX:0302
  62.          TickColor       =   &H00000000&
  63.          TickCount       =   0
  64.          TickGap         =   1
  65.          TickLength      =   4
  66.          TickWidth       =   1
  67.          Top             =   300
  68.          Value           =   1
  69.          Width           =   855
  70.       End
  71.       Begin HSlider HSliderMIDIChannel 
  72.          BackColor       =   &H00C0C0C0&
  73.          BevelInner      =   0  'None
  74.          BevelOuter      =   0  'None
  75.          BevelWidth      =   1
  76.          BorderWidth     =   1
  77.          Gap             =   3
  78.          Height          =   315
  79.          LargeChange     =   2
  80.          Left            =   90
  81.          LinkControl     =   ""
  82.          LinkProperty    =   ""
  83.          Max             =   15
  84.          Min             =   0
  85.          ThumbHeight     =   245
  86.          ThumbStyle      =   1  'Pointed Up
  87.          ThumbWidth      =   200
  88.          TickColor       =   &H00000000&
  89.          TickCount       =   16
  90.          TickLength      =   4
  91.          TickMarks       =   1  'Top
  92.          TickWidth       =   1
  93.          Top             =   570
  94.          TrackBevel      =   1  'Raised
  95.          TrackWidth      =   3
  96.          Value           =   1
  97.          Width           =   1665
  98.       End
  99.       Begin HSlider HSliderVolume 
  100.          BackColor       =   &H00C0C0C0&
  101.          BevelInner      =   0  'None
  102.          BevelOuter      =   0  'None
  103.          BevelWidth      =   1
  104.          BorderWidth     =   1
  105.          Gap             =   3
  106.          Height          =   315
  107.          LargeChange     =   2
  108.          Left            =   2160
  109.          LinkControl     =   ""
  110.          LinkProperty    =   ""
  111.          Max             =   127
  112.          Min             =   0
  113.          ThumbHeight     =   245
  114.          ThumbStyle      =   3  'Lined
  115.          ThumbWidth      =   320
  116.          TickColor       =   &H00000000&
  117.          TickCount       =   5
  118.          TickLength      =   4
  119.          TickMarks       =   0  'No Tick Marks
  120.          TickWidth       =   1
  121.          Top             =   570
  122.          TrackBevel      =   1  'Raised
  123.          TrackWidth      =   3
  124.          Value           =   1
  125.          Width           =   1275
  126.       End
  127.       Begin HSlider HSliderOctave 
  128.          BackColor       =   &H00C0C0C0&
  129.          BevelInner      =   0  'None
  130.          BevelOuter      =   0  'None
  131.          BevelWidth      =   1
  132.          BorderWidth     =   1
  133.          Gap             =   3
  134.          Height          =   315
  135.          LargeChange     =   2
  136.          Left            =   3900
  137.          LinkControl     =   ""
  138.          LinkProperty    =   ""
  139.          Max             =   3
  140.          Min             =   0
  141.          ThumbHeight     =   245
  142.          ThumbStyle      =   1  'Pointed Up
  143.          ThumbWidth      =   200
  144.          TickColor       =   &H00000000&
  145.          TickCount       =   4
  146.          TickLength      =   4
  147.          TickMarks       =   1  'Top
  148.          TickWidth       =   1
  149.          Top             =   570
  150.          TrackBevel      =   1  'Raised
  151.          TrackWidth      =   3
  152.          Value           =   1
  153.          Width           =   1185
  154.       End
  155.       Begin Label Label5 
  156.          BackColor       =   &H00C0C0C0&
  157.          Caption         =   "L - Pan - R"
  158.          Height          =   255
  159.          Left            =   8130
  160.          TabIndex        =   9
  161.          Top             =   120
  162.          Width           =   1005
  163.       End
  164.       Begin Label MidiChannelOutLabel 
  165.          Alignment       =   2  'Center
  166.          BackColor       =   &H00000000&
  167.          Caption         =   "1"
  168.          FontBold        =   0   'False
  169.          FontItalic      =   0   'False
  170.          FontName        =   "MS Sans Serif"
  171.          FontSize        =   9.75
  172.          FontStrikethru  =   0   'False
  173.          FontUnderline   =   0   'False
  174.          ForeColor       =   &H0000FF00&
  175.          Height          =   255
  176.          Left            =   1350
  177.          TabIndex        =   0
  178.          Top             =   270
  179.          Width           =   405
  180.       End
  181.       Begin Label Label1 
  182.          BackColor       =   &H00C0C0C0&
  183.          Caption         =   "MIDI Channel"
  184.          Height          =   255
  185.          Left            =   120
  186.          TabIndex        =   1
  187.          Top             =   270
  188.          Width           =   1215
  189.       End
  190.       Begin Label Label2 
  191.          BackColor       =   &H00C0C0C0&
  192.          Caption         =   "Volume"
  193.          Height          =   255
  194.          Left            =   2160
  195.          TabIndex        =   2
  196.          Top             =   270
  197.          Width           =   675
  198.       End
  199.       Begin Label Label3 
  200.          BackColor       =   &H00C0C0C0&
  201.          Caption         =   "Octave"
  202.          Height          =   255
  203.          Left            =   3930
  204.          TabIndex        =   3
  205.          Top             =   270
  206.          Width           =   645
  207.       End
  208.       Begin Label LabelVolume 
  209.          Alignment       =   2  'Center
  210.          BackColor       =   &H00000000&
  211.          Caption         =   "100"
  212.          FontBold        =   0   'False
  213.          FontItalic      =   0   'False
  214.          FontName        =   "MS Sans Serif"
  215.          FontSize        =   9.75
  216.          FontStrikethru  =   0   'False
  217.          FontUnderline   =   0   'False
  218.          ForeColor       =   &H0000FF00&
  219.          Height          =   255
  220.          Left            =   2820
  221.          TabIndex        =   4
  222.          Top             =   270
  223.          Width           =   585
  224.       End
  225.       Begin Label Label4 
  226.          BackColor       =   &H00C0C0C0&
  227.          Caption         =   "Patch"
  228.          Height          =   255
  229.          Left            =   5460
  230.          TabIndex        =   6
  231.          Top             =   270
  232.          Width           =   645
  233.       End
  234.       Begin Label LabelOctave 
  235.          Alignment       =   2  'Center
  236.          BackColor       =   &H00000000&
  237.          Caption         =   "0"
  238.          FontBold        =   0   'False
  239.          FontItalic      =   0   'False
  240.          FontName        =   "MS Sans Serif"
  241.          FontSize        =   9.75
  242.          FontStrikethru  =   0   'False
  243.          FontUnderline   =   0   'False
  244.          ForeColor       =   &H0000FF00&
  245.          Height          =   255
  246.          Left            =   4560
  247.          TabIndex        =   7
  248.          Top             =   270
  249.          Width           =   405
  250.       End
  251.    End
  252.    Begin MIDIOutput MIDIOutput1 
  253.       DeviceID        =   0
  254.       Left            =   420
  255.       Top             =   2490
  256.       VolumeLeft      =   0
  257.       VolumeRight     =   0
  258.    End
  259.    Begin MIDIInput MIDIInput1 
  260.       DeviceID        =   0
  261.       Left            =   -60
  262.       MaxSysexSize    =   0
  263.       MessageEventEnable=   -1  'True
  264.       Top             =   2340
  265.    End
  266.    Begin Frame Frame3 
  267.       BackColor       =   &H00C0C0C0&
  268.       DragMode        =   1  'Automatic
  269.       Height          =   885
  270.       Left            =   60
  271.       MousePointer    =   1  'Arrow
  272.       TabIndex        =   10
  273.       Top             =   810
  274.       Width           =   9165
  275.       Begin Frame PianoKey 
  276.          BackColor       =   &H00000000&
  277.          DragMode        =   1  'Automatic
  278.          ForeColor       =   &H00000000&
  279.          Height          =   555
  280.          Index           =   63
  281.          Left            =   8800
  282.          MousePointer    =   10  'Up Arrow
  283.          TabIndex        =   74
  284.          Top             =   30
  285.          Width           =   165
  286.       End
  287.       Begin Frame PianoKey 
  288.          BackColor       =   &H00000000&
  289.          DragMode        =   1  'Automatic
  290.          ForeColor       =   &H00000000&
  291.          Height          =   555
  292.          Index           =   61
  293.          Left            =   8560
  294.          MousePointer    =   10  'Up Arrow
  295.          TabIndex        =   73
  296.          Top             =   30
  297.          Width           =   165
  298.       End
  299.       Begin Frame PianoKey 
  300.          BackColor       =   &H00000000&
  301.          DragMode        =   1  'Automatic
  302.          ForeColor       =   &H00000000&
  303.          Height          =   555
  304.          Index           =   58
  305.          Left            =   8080
  306.          MousePointer    =   10  'Up Arrow
  307.          TabIndex        =   72
  308.          Top             =   30
  309.          Width           =   165
  310.       End
  311.       Begin Frame PianoKey 
  312.          BackColor       =   &H00000000&
  313.          DragMode        =   1  'Automatic
  314.          ForeColor       =   &H00000000&
  315.          Height          =   555
  316.          Index           =   56
  317.          Left            =   7840
  318.          MousePointer    =   10  'Up Arrow
  319.          TabIndex        =   71
  320.          Top             =   30
  321.          Width           =   165
  322.       End
  323.       Begin Frame PianoKey 
  324.          BackColor       =   &H00000000&
  325.          DragMode        =   1  'Automatic
  326.          ForeColor       =   &H00000000&
  327.          Height          =   555
  328.          Index           =   54
  329.          Left            =   7600
  330.          MousePointer    =   10  'Up Arrow
  331.          TabIndex        =   70
  332.          Top             =   30
  333.          Width           =   165
  334.       End
  335.       Begin Frame PianoKey 
  336.          BackColor       =   &H00000000&
  337.          DragMode        =   1  'Automatic
  338.          ForeColor       =   &H00000000&
  339.          Height          =   555
  340.          Index           =   51
  341.          Left            =   7120
  342.          MousePointer    =   10  'Up Arrow
  343.          TabIndex        =   69
  344.          Top             =   30
  345.          Width           =   165
  346.       End
  347.       Begin Frame PianoKey 
  348.          BackColor       =   &H00000000&
  349.          DragMode        =   1  'Automatic
  350.          ForeColor       =   &H00000000&
  351.          Height          =   555
  352.          Index           =   49
  353.          Left            =   6880
  354.          MousePointer    =   10  'Up Arrow
  355.          TabIndex        =   68
  356.          Top             =   30
  357.          Width           =   165
  358.       End
  359.       Begin Frame PianoKey 
  360.          BackColor       =   &H00000000&
  361.          DragMode        =   1  'Automatic
  362.          ForeColor       =   &H00000000&
  363.          Height          =   555
  364.          Index           =   46
  365.          Left            =   6400
  366.          MousePointer    =   10  'Up Arrow
  367.          TabIndex        =   67
  368.          Top             =   30
  369.          Width           =   165
  370.       End
  371.       Begin Frame PianoKey 
  372.          BackColor       =   &H00000000&
  373.          DragMode        =   1  'Automatic
  374.          ForeColor       =   &H00000000&
  375.          Height          =   555
  376.          Index           =   44
  377.          Left            =   6160
  378.          MousePointer    =   10  'Up Arrow
  379.          TabIndex        =   66
  380.          Top             =   30
  381.          Width           =   165
  382.       End
  383.       Begin Frame PianoKey 
  384.          BackColor       =   &H00000000&
  385.          DragMode        =   1  'Automatic
  386.          ForeColor       =   &H00000000&
  387.          Height          =   555
  388.          Index           =   42
  389.          Left            =   5920
  390.          MousePointer    =   10  'Up Arrow
  391.          TabIndex        =   65
  392.          Top             =   30
  393.          Width           =   165
  394.       End
  395.       Begin Frame PianoKey 
  396.          BackColor       =   &H00000000&
  397.          DragMode        =   1  'Automatic
  398.          ForeColor       =   &H00000000&
  399.          Height          =   555
  400.          Index           =   39
  401.          Left            =   5440
  402.          MousePointer    =   10  'Up Arrow
  403.          TabIndex        =   64
  404.          Top             =   30
  405.          Width           =   165
  406.       End
  407.       Begin Frame PianoKey 
  408.          BackColor       =   &H00000000&
  409.          DragMode        =   1  'Automatic
  410.          ForeColor       =   &H00000000&
  411.          Height          =   555
  412.          Index           =   37
  413.          Left            =   5200
  414.          MousePointer    =   10  'Up Arrow
  415.          TabIndex        =   63
  416.          Top             =   30
  417.          Width           =   165
  418.       End
  419.       Begin Frame PianoKey 
  420.          BackColor       =   &H00000000&
  421.          DragMode        =   1  'Automatic
  422.          ForeColor       =   &H00000000&
  423.          Height          =   555
  424.          Index           =   34
  425.          Left            =   4720
  426.          MousePointer    =   10  'Up Arrow
  427.          TabIndex        =   62
  428.          Top             =   30
  429.          Width           =   165
  430.       End
  431.       Begin Frame PianoKey 
  432.          BackColor       =   &H00000000&
  433.          DragMode        =   1  'Automatic
  434.          ForeColor       =   &H00000000&
  435.          Height          =   555
  436.          Index           =   32
  437.          Left            =   4480
  438.          MousePointer    =   10  'Up Arrow
  439.          TabIndex        =   61
  440.          Top             =   30
  441.          Width           =   165
  442.       End
  443.       Begin Frame PianoKey 
  444.          BackColor       =   &H00000000&
  445.          DragMode        =   1  'Automatic
  446.          ForeColor       =   &H00000000&
  447.          Height          =   555
  448.          Index           =   30
  449.          Left            =   4240
  450.          MousePointer    =   10  'Up Arrow
  451.          TabIndex        =   60
  452.          Top             =   30
  453.          Width           =   165
  454.       End
  455.       Begin Frame PianoKey 
  456.          BackColor       =   &H00000000&
  457.          DragMode        =   1  'Automatic
  458.          ForeColor       =   &H00000000&
  459.          Height          =   555
  460.          Index           =   27
  461.          Left            =   3760
  462.          MousePointer    =   10  'Up Arrow
  463.          TabIndex        =   59
  464.          Top             =   30
  465.          Width           =   165
  466.       End
  467.       Begin Frame PianoKey 
  468.          BackColor       =   &H00000000&
  469.          DragMode        =   1  'Automatic
  470.          ForeColor       =   &H00000000&
  471.          Height          =   555
  472.          Index           =   25
  473.          Left            =   3520
  474.          MousePointer    =   10  'Up Arrow
  475.          TabIndex        =   58
  476.          Top             =   30
  477.          Width           =   165
  478.       End
  479.       Begin Frame PianoKey 
  480.          BackColor       =   &H00000000&
  481.          DragMode        =   1  'Automatic
  482.          ForeColor       =   &H00000000&
  483.          Height          =   555
  484.          Index           =   22
  485.          Left            =   3040
  486.          MousePointer    =   10  'Up Arrow
  487.          TabIndex        =   57
  488.          Top             =   30
  489.          Width           =   165
  490.       End
  491.       Begin Frame PianoKey 
  492.          BackColor       =   &H00000000&
  493.          DragMode        =   1  'Automatic
  494.          ForeColor       =   &H00000000&
  495.          Height          =   555
  496.          Index           =   20
  497.          Left            =   2800
  498.          MousePointer    =   10  'Up Arrow
  499.          TabIndex        =   56
  500.          Top             =   30
  501.          Width           =   165
  502.       End
  503.       Begin Frame PianoKey 
  504.          BackColor       =   &H00000000&
  505.          DragMode        =   1  'Automatic
  506.          ForeColor       =   &H00000000&
  507.          Height          =   555
  508.          Index           =   18
  509.          Left            =   2560
  510.          MousePointer    =   10  'Up Arrow
  511.          TabIndex        =   55
  512.          Top             =   30
  513.          Width           =   165
  514.       End
  515.       Begin Frame PianoKey 
  516.          BackColor       =   &H00000000&
  517.          DragMode        =   1  'Automatic
  518.          ForeColor       =   &H00000000&
  519.          Height          =   555
  520.          Index           =   15
  521.          Left            =   2080
  522.          MousePointer    =   10  'Up Arrow
  523.          TabIndex        =   54
  524.          Top             =   30
  525.          Width           =   165
  526.       End
  527.       Begin Frame PianoKey 
  528.          BackColor       =   &H00000000&
  529.          DragMode        =   1  'Automatic
  530.          ForeColor       =   &H00000000&
  531.          Height          =   555
  532.          Index           =   13
  533.          Left            =   1840
  534.          MousePointer    =   10  'Up Arrow
  535.          TabIndex        =   53
  536.          Top             =   30
  537.          Width           =   165
  538.       End
  539.       Begin Frame PianoKey 
  540.          BackColor       =   &H00000000&
  541.          DragMode        =   1  'Automatic
  542.          ForeColor       =   &H00000000&
  543.          Height          =   555
  544.          Index           =   10
  545.          Left            =   1360
  546.          MousePointer    =   10  'Up Arrow
  547.          TabIndex        =   52
  548.          Top             =   30
  549.          Width           =   165
  550.       End
  551.       Begin Frame PianoKey 
  552.          BackColor       =   &H00000000&
  553.          DragMode        =   1  'Automatic
  554.          ForeColor       =   &H00000000&
  555.          Height          =   555
  556.          Index           =   8
  557.          Left            =   1120
  558.          MousePointer    =   10  'Up Arrow
  559.          TabIndex        =   51
  560.          Top             =   30
  561.          Width           =   165
  562.       End
  563.       Begin Frame PianoKey 
  564.          BackColor       =   &H00000000&
  565.          DragMode        =   1  'Automatic
  566.          ForeColor       =   &H00000000&
  567.          Height          =   555
  568.          Index           =   6
  569.          Left            =   880
  570.          MousePointer    =   10  'Up Arrow
  571.          TabIndex        =   50
  572.          Top             =   30
  573.          Width           =   165
  574.       End
  575.       Begin Frame PianoKey 
  576.          BackColor       =   &H00000000&
  577.          DragMode        =   1  'Automatic
  578.          ForeColor       =   &H00000000&
  579.          Height          =   555
  580.          Index           =   3
  581.          Left            =   400
  582.          MousePointer    =   10  'Up Arrow
  583.          TabIndex        =   49
  584.          Top             =   30
  585.          Width           =   165
  586.       End
  587.       Begin Frame PianoKey 
  588.          BackColor       =   &H00000000&
  589.          ForeColor       =   &H00000000&
  590.          Height          =   555
  591.          Index           =   1
  592.          Left            =   160
  593.          MousePointer    =   10  'Up Arrow
  594.          TabIndex        =   48
  595.          Top             =   30
  596.          Width           =   165
  597.       End
  598.       Begin Frame PianoKey 
  599.          DragMode        =   1  'Automatic
  600.          Height          =   855
  601.          Index           =   64
  602.          Left            =   8880
  603.          MousePointer    =   10  'Up Arrow
  604.          TabIndex        =   47
  605.          Top             =   0
  606.          Width           =   255
  607.       End
  608.       Begin Frame PianoKey 
  609.          DragMode        =   1  'Automatic
  610.          Height          =   855
  611.          Index           =   62
  612.          Left            =   8640
  613.          MousePointer    =   10  'Up Arrow
  614.          TabIndex        =   46
  615.          Top             =   0
  616.          Width           =   255
  617.       End
  618.       Begin Frame PianoKey 
  619.          DragMode        =   1  'Automatic
  620.          Height          =   855
  621.          Index           =   60
  622.          Left            =   8400
  623.          MousePointer    =   10  'Up Arrow
  624.          TabIndex        =   45
  625.          Top             =   0
  626.          Width           =   255
  627.       End
  628.       Begin Frame PianoKey 
  629.          DragMode        =   1  'Automatic
  630.          Height          =   855
  631.          Index           =   59
  632.          Left            =   8160
  633.          MousePointer    =   10  'Up Arrow
  634.          TabIndex        =   44
  635.          Top             =   0
  636.          Width           =   255
  637.       End
  638.       Begin Frame PianoKey 
  639.          DragMode        =   1  'Automatic
  640.          Height          =   855
  641.          Index           =   57
  642.          Left            =   7920
  643.          MousePointer    =   10  'Up Arrow
  644.          TabIndex        =   43
  645.          Top             =   0
  646.          Width           =   255
  647.       End
  648.       Begin Frame PianoKey 
  649.          DragMode        =   1  'Automatic
  650.          Height          =   855
  651.          Index           =   55
  652.          Left            =   7680
  653.          MousePointer    =   10  'Up Arrow
  654.          TabIndex        =   42
  655.          Top             =   0
  656.          Width           =   255
  657.       End
  658.       Begin Frame PianoKey 
  659.          DragMode        =   1  'Automatic
  660.          Height          =   855
  661.          Index           =   53
  662.          Left            =   7440
  663.          MousePointer    =   10  'Up Arrow
  664.          TabIndex        =   41
  665.          Top             =   0
  666.          Width           =   255
  667.       End
  668.       Begin Frame PianoKey 
  669.          DragMode        =   1  'Automatic
  670.          Height          =   855
  671.          Index           =   52
  672.          Left            =   7200
  673.          MousePointer    =   10  'Up Arrow
  674.          TabIndex        =   40
  675.          Top             =   0
  676.          Width           =   255
  677.       End
  678.       Begin Frame PianoKey 
  679.          DragMode        =   1  'Automatic
  680.          Height          =   855
  681.          Index           =   50
  682.          Left            =   6960
  683.          MousePointer    =   10  'Up Arrow
  684.          TabIndex        =   39
  685.          Top             =   0
  686.          Width           =   255
  687.       End
  688.       Begin Frame PianoKey 
  689.          DragMode        =   1  'Automatic
  690.          Height          =   855
  691.          Index           =   48
  692.          Left            =   6720
  693.          MousePointer    =   10  'Up Arrow
  694.          TabIndex        =   38
  695.          Top             =   0
  696.          Width           =   255
  697.       End
  698.       Begin Frame PianoKey 
  699.          DragMode        =   1  'Automatic
  700.          Height          =   855
  701.          Index           =   47
  702.          Left            =   6480
  703.          MousePointer    =   10  'Up Arrow
  704.          TabIndex        =   37
  705.          Top             =   0
  706.          Width           =   255
  707.       End
  708.       Begin Frame PianoKey 
  709.          DragMode        =   1  'Automatic
  710.          Height          =   855
  711.          Index           =   45
  712.          Left            =   6240
  713.          MousePointer    =   10  'Up Arrow
  714.          TabIndex        =   36
  715.          Top             =   0
  716.          Width           =   255
  717.       End
  718.       Begin Frame PianoKey 
  719.          DragMode        =   1  'Automatic
  720.          Height          =   855
  721.          Index           =   43
  722.          Left            =   6000
  723.          MousePointer    =   10  'Up Arrow
  724.          TabIndex        =   35
  725.          Top             =   0
  726.          Width           =   255
  727.       End
  728.       Begin Frame PianoKey 
  729.          DragMode        =   1  'Automatic
  730.          Height          =   855
  731.          Index           =   41
  732.          Left            =   5760
  733.          MousePointer    =   10  'Up Arrow
  734.          TabIndex        =   34
  735.          Top             =   0
  736.          Width           =   255
  737.       End
  738.       Begin Frame PianoKey 
  739.          DragMode        =   1  'Automatic
  740.          Height          =   855
  741.          Index           =   40
  742.          Left            =   5520
  743.          MousePointer    =   10  'Up Arrow
  744.          TabIndex        =   33
  745.          Top             =   0
  746.          Width           =   255
  747.       End
  748.       Begin Frame PianoKey 
  749.          DragMode        =   1  'Automatic
  750.          Height          =   855
  751.          Index           =   38
  752.          Left            =   5280
  753.          MousePointer    =   10  'Up Arrow
  754.          TabIndex        =   32
  755.          Top             =   0
  756.          Width           =   255
  757.       End
  758.       Begin Frame PianoKey 
  759.          DragMode        =   1  'Automatic
  760.          Height          =   855
  761.          Index           =   36
  762.          Left            =   5040
  763.          MousePointer    =   10  'Up Arrow
  764.          TabIndex        =   31
  765.          Top             =   0
  766.          Width           =   255
  767.       End
  768.       Begin Frame PianoKey 
  769.          DragMode        =   1  'Automatic
  770.          Height          =   855
  771.          Index           =   35
  772.          Left            =   4800
  773.          MousePointer    =   10  'Up Arrow
  774.          TabIndex        =   30
  775.          Top             =   0
  776.          Width           =   255
  777.       End
  778.       Begin Frame PianoKey 
  779.          DragMode        =   1  'Automatic
  780.          Height          =   855
  781.          Index           =   33
  782.          Left            =   4560
  783.          MousePointer    =   10  'Up Arrow
  784.          TabIndex        =   29
  785.          Top             =   0
  786.          Width           =   255
  787.       End
  788.       Begin Frame PianoKey 
  789.          DragMode        =   1  'Automatic
  790.          Height          =   855
  791.          Index           =   31
  792.          Left            =   4320
  793.          MousePointer    =   10  'Up Arrow
  794.          TabIndex        =   28
  795.          Top             =   0
  796.          Width           =   255
  797.       End
  798.       Begin Frame PianoKey 
  799.          DragMode        =   1  'Automatic
  800.          Height          =   855
  801.          Index           =   29
  802.          Left            =   4080
  803.          MousePointer    =   10  'Up Arrow
  804.          TabIndex        =   27
  805.          Top             =   0
  806.          Width           =   255
  807.       End
  808.       Begin Frame PianoKey 
  809.          DragMode        =   1  'Automatic
  810.          Height          =   855
  811.          Index           =   28
  812.          Left            =   3840
  813.          MousePointer    =   10  'Up Arrow
  814.          TabIndex        =   26
  815.          Top             =   0
  816.          Width           =   255
  817.       End
  818.       Begin Frame PianoKey 
  819.          DragMode        =   1  'Automatic
  820.          Height          =   855
  821.          Index           =   26
  822.          Left            =   3600
  823.          MousePointer    =   10  'Up Arrow
  824.          TabIndex        =   25
  825.          Top             =   0
  826.          Width           =   255
  827.       End
  828.       Begin Frame PianoKey 
  829.          DragMode        =   1  'Automatic
  830.          Height          =   855
  831.          Index           =   24
  832.          Left            =   3360
  833.          MousePointer    =   10  'Up Arrow
  834.          TabIndex        =   24
  835.          Top             =   0
  836.          Width           =   255
  837.       End
  838.       Begin Frame PianoKey 
  839.          DragMode        =   1  'Automatic
  840.          Height          =   855
  841.          Index           =   23
  842.          Left            =   3120
  843.          MousePointer    =   10  'Up Arrow
  844.          TabIndex        =   23
  845.          Top             =   0
  846.          Width           =   255
  847.       End
  848.       Begin Frame PianoKey 
  849.          DragMode        =   1  'Automatic
  850.          Height          =   855
  851.          Index           =   21
  852.          Left            =   2880
  853.          MousePointer    =   10  'Up Arrow
  854.          TabIndex        =   22
  855.          Top             =   0
  856.          Width           =   255
  857.       End
  858.       Begin Frame PianoKey 
  859.          DragMode        =   1  'Automatic
  860.          Height          =   855
  861.          Index           =   19
  862.          Left            =   2640
  863.          MousePointer    =   10  'Up Arrow
  864.          TabIndex        =   21
  865.          Top             =   0
  866.          Width           =   255
  867.       End
  868.       Begin Frame PianoKey 
  869.          DragMode        =   1  'Automatic
  870.          Height          =   855
  871.          Index           =   17
  872.          Left            =   2400
  873.          MousePointer    =   10  'Up Arrow
  874.          TabIndex        =   20
  875.          Top             =   0
  876.          Width           =   255
  877.       End
  878.       Begin Frame PianoKey 
  879.          DragMode        =   1  'Automatic
  880.          Height          =   855
  881.          Index           =   16
  882.          Left            =   2160
  883.          MousePointer    =   10  'Up Arrow
  884.          TabIndex        =   19
  885.          Top             =   0
  886.          Width           =   255
  887.       End
  888.       Begin Frame PianoKey 
  889.          DragMode        =   1  'Automatic
  890.          Height          =   855
  891.          Index           =   14
  892.          Left            =   1920
  893.          MousePointer    =   10  'Up Arrow
  894.          TabIndex        =   18
  895.          Top             =   0
  896.          Width           =   255
  897.       End
  898.       Begin Frame PianoKey 
  899.          DragMode        =   1  'Automatic
  900.          Height          =   855
  901.          Index           =   12
  902.          Left            =   1680
  903.          MousePointer    =   10  'Up Arrow
  904.          TabIndex        =   17
  905.          Top             =   0
  906.          Width           =   255
  907.       End
  908.       Begin Frame PianoKey 
  909.          DragMode        =   1  'Automatic
  910.          Height          =   855
  911.          Index           =   11
  912.          Left            =   1440
  913.          MousePointer    =   10  'Up Arrow
  914.          TabIndex        =   16
  915.          Top             =   0
  916.          Width           =   255
  917.       End
  918.       Begin Frame PianoKey 
  919.          DragMode        =   1  'Automatic
  920.          Height          =   855
  921.          Index           =   9
  922.          Left            =   1200
  923.          MousePointer    =   10  'Up Arrow
  924.          TabIndex        =   15
  925.          Top             =   0
  926.          Width           =   255
  927.       End
  928.       Begin Frame PianoKey 
  929.          DragMode        =   1  'Automatic
  930.          Height          =   855
  931.          Index           =   7
  932.          Left            =   960
  933.          MousePointer    =   10  'Up Arrow
  934.          TabIndex        =   14
  935.          Top             =   0
  936.          Width           =   255
  937.       End
  938.       Begin Frame PianoKey 
  939.          DragMode        =   1  'Automatic
  940.          Height          =   855
  941.          Index           =   5
  942.          Left            =   720
  943.          MousePointer    =   10  'Up Arrow
  944.          TabIndex        =   13
  945.          Top             =   0
  946.          Width           =   255
  947.       End
  948.       Begin Frame PianoKey 
  949.          DragMode        =   1  'Automatic
  950.          Height          =   855
  951.          Index           =   4
  952.          Left            =   480
  953.          MousePointer    =   10  'Up Arrow
  954.          TabIndex        =   12
  955.          Top             =   0
  956.          Width           =   255
  957.       End
  958.       Begin Frame PianoKey 
  959.          BackColor       =   &H00FFFFFF&
  960.          DragIcon        =   PIANO2.FRX:0504
  961.          DragMode        =   1  'Automatic
  962.          Height          =   855
  963.          Index           =   0
  964.          Left            =   0
  965.          MousePointer    =   10  'Up Arrow
  966.          TabIndex        =   11
  967.          Top             =   0
  968.          Width           =   255
  969.       End
  970.       Begin Frame PianoKey 
  971.          BackColor       =   &H00FFFFFF&
  972.          DragMode        =   1  'Automatic
  973.          Height          =   855
  974.          Index           =   2
  975.          Left            =   210
  976.          MousePointer    =   10  'Up Arrow
  977.          TabIndex        =   75
  978.          Top             =   0
  979.          Width           =   285
  980.       End
  981.    End
  982.    Begin Menu File 
  983.       Caption         =   "&File"
  984.       Begin Menu Exit 
  985.          Caption         =   "E&xit"
  986.       End
  987.    End
  988.    Begin Menu MIDI 
  989.       Caption         =   "&MIDI"
  990.       Begin Menu MIDISetup 
  991.          Caption         =   "MIDI &Setup..."
  992.       End
  993.    End
  994. Option Explicit
  995. Dim NoteCatchCount As Integer
  996. Dim NoteOnCatcher(1024) As Integer
  997. ' While recording this variable contains the recording
  998. ' start time
  999. Dim startTime As Long
  1000. ' Index into notes array
  1001. Dim note As Integer
  1002. Sub ComboPatch_Click ()
  1003.     ' Sets the Patch for the current Midi Channel Out
  1004.     MidiPatch(MidiChannelOut) = ComboPatch.ListIndex
  1005.     'Patch Midi Out routine
  1006.     MIDIOutput1.Message = PROGRAM_CHANGE + MidiChannelOut
  1007.     MIDIOutput1.Data1 = MidiPatch(MidiChannelOut)
  1008.     MIDIOutput1.Data2 = 0
  1009.     MIDIOutput1.Time = 0
  1010.     MIDIOutput1.Action = MIDIOUT_SEND
  1011. End Sub
  1012. Sub Exit_Click ()
  1013.     ' Stop the MIDI In
  1014.     MIDIInput1.Action = MIDIIN_STOP
  1015.     ' Close MIDI In
  1016.     MIDIInput1.Action = MIDIIN_CLOSE
  1017.     ' Close MIDI Out
  1018.     MIDIOutput1.Action = MIDIOUT_CLOSE
  1019.     End
  1020. End Sub
  1021. Sub Form_Load ()
  1022.     Dim n As Integer
  1023.     Screen.MousePointer = 11
  1024.     Piano.Left = 0
  1025.     Piano.Top = 0
  1026.     ' General MIDI patches
  1027.     ComboPatch.AddItem "Acoustic Grand Piano"
  1028.     ComboPatch.AddItem "Bright Acoustic Piano"
  1029.     ComboPatch.AddItem "Electric Grand Piano"
  1030.     ComboPatch.AddItem "Honkytonk Piano"
  1031.     ComboPatch.AddItem "Rhodes Piano"
  1032.     ComboPatch.AddItem "Chorus Piano"
  1033.     ComboPatch.AddItem "Harpsichord"
  1034.     ComboPatch.AddItem "Clavinet"
  1035.     ComboPatch.AddItem "Celesta"
  1036.     ComboPatch.AddItem "Glockenspiel"
  1037.     ComboPatch.AddItem "Music Box"
  1038.     ComboPatch.AddItem "Vibraphone"
  1039.     ComboPatch.AddItem "Marimba"
  1040.     ComboPatch.AddItem "Xylophone"
  1041.     ComboPatch.AddItem "Tubular Bells"
  1042.     ComboPatch.AddItem "Dulcimer"
  1043.     ComboPatch.AddItem "Hammond Organ"
  1044.     ComboPatch.AddItem "Percuss. Organ"
  1045.     ComboPatch.AddItem "Rock Organ"
  1046.     ComboPatch.AddItem "Church Organ"
  1047.     ComboPatch.AddItem "Reed Organ"
  1048.     ComboPatch.AddItem "Accordion"
  1049.     ComboPatch.AddItem "Harmonica"
  1050.     ComboPatch.AddItem "Tango Accordion"
  1051.     ComboPatch.AddItem "Acoustic Guitar (nylon)"
  1052.     ComboPatch.AddItem "Acoustic Guitar (steel)"
  1053.     ComboPatch.AddItem "Electric Guitar (jazz)"
  1054.     ComboPatch.AddItem "Electric Guitar (clean)"
  1055.     ComboPatch.AddItem "Electric Guitar (muted)"
  1056.     ComboPatch.AddItem "Overdriven Guitar"
  1057.     ComboPatch.AddItem "Distortion Guitar"
  1058.     ComboPatch.AddItem "Guitar Harmonics"
  1059.     ComboPatch.AddItem "Acoustic Bass"
  1060.     ComboPatch.AddItem "Electric Bass (finger)"
  1061.     ComboPatch.AddItem "Electric Bass (pick)"
  1062.     ComboPatch.AddItem "Fretless Bass"
  1063.     ComboPatch.AddItem "Slap Bass 1"
  1064.     ComboPatch.AddItem "Slap Bass 2"
  1065.     ComboPatch.AddItem "Synth Bass 1"
  1066.     ComboPatch.AddItem "Synth Bass 2"
  1067.     ComboPatch.AddItem "Violin"
  1068.     ComboPatch.AddItem "Viola"
  1069.     ComboPatch.AddItem "Cello"
  1070.     ComboPatch.AddItem "Contra Bass"
  1071.     ComboPatch.AddItem "Tremolo Strings"
  1072.     ComboPatch.AddItem "Pizzicato Strings"
  1073.     ComboPatch.AddItem "Orchestral Harp"
  1074.     ComboPatch.AddItem "Timpani"
  1075.     ComboPatch.AddItem "String Ensemble 1"
  1076.     ComboPatch.AddItem "String Ensemble 2"
  1077.     ComboPatch.AddItem "Synth Strings 1"
  1078.     ComboPatch.AddItem "Synth Strings 2"
  1079.     ComboPatch.AddItem "Choir Aahs"
  1080.     ComboPatch.AddItem "Voice Oohs"
  1081.     ComboPatch.AddItem "Synth Voice"
  1082.     ComboPatch.AddItem "Orchestra Hit"
  1083.     ComboPatch.AddItem "Trumpet"
  1084.     ComboPatch.AddItem "Trombone"
  1085.     ComboPatch.AddItem "Tuba"
  1086.     ComboPatch.AddItem "Muted Trumpet"
  1087.     ComboPatch.AddItem "French Horn"
  1088.     ComboPatch.AddItem "Brass Section"
  1089.     ComboPatch.AddItem "Synth Brass 1"
  1090.     ComboPatch.AddItem "Synth Brass 2"
  1091.     ComboPatch.AddItem "Soprano Sax"
  1092.     ComboPatch.AddItem "Alto Sax"
  1093.     ComboPatch.AddItem "Tenor Sax"
  1094.     ComboPatch.AddItem "Baritone Sax"
  1095.     ComboPatch.AddItem "Oboe"
  1096.     ComboPatch.AddItem "English Horn"
  1097.     ComboPatch.AddItem "Bassoon"
  1098.     ComboPatch.AddItem "Clarinet"
  1099.     ComboPatch.AddItem "Piccolo"
  1100.     ComboPatch.AddItem "Flute"
  1101.     ComboPatch.AddItem "Recorder"
  1102.     ComboPatch.AddItem "Pan Flute"
  1103.     ComboPatch.AddItem "Bottle Blow"
  1104.     ComboPatch.AddItem "Shaku"
  1105.     ComboPatch.AddItem "Whistle"
  1106.     ComboPatch.AddItem "Ocarina"
  1107.     ComboPatch.AddItem "Lead 1 (square)"
  1108.     ComboPatch.AddItem "Lead 2 (saw tooth)"
  1109.     ComboPatch.AddItem "Lead 3 (calliope lead)"
  1110.     ComboPatch.AddItem "Lead 4 (chiff lead)"
  1111.     ComboPatch.AddItem "Lead 5 (charang)"
  1112.     ComboPatch.AddItem "Lead 6 (voice)"
  1113.     ComboPatch.AddItem "Lead 7 (fifths)"
  1114.     ComboPatch.AddItem "Lead 8 (bass + lead)"
  1115.     ComboPatch.AddItem "Pad 1 (new age)"
  1116.     ComboPatch.AddItem "Pad 2 (warm)"
  1117.     ComboPatch.AddItem "Pad 3 (poly synth)"
  1118.     ComboPatch.AddItem "Pad 4 (choir)"
  1119.     ComboPatch.AddItem "Pad 5 (bowed)"
  1120.     ComboPatch.AddItem "Pad 6 (metallic)"
  1121.     ComboPatch.AddItem "Pad 7 (halo)"
  1122.     ComboPatch.AddItem "Pad 8 (sweep)"
  1123.     ComboPatch.AddItem "FX 1 (rain)"
  1124.     ComboPatch.AddItem "FX 2 (sound track)"
  1125.     ComboPatch.AddItem "FX 3 (crystal)"
  1126.     ComboPatch.AddItem "FX 4 (atmo - sphere)"
  1127.     ComboPatch.AddItem "FX 5 (bright)"
  1128.     ComboPatch.AddItem "FX 6 (goblins)"
  1129.     ComboPatch.AddItem "FX 7 (echoes)"
  1130.     ComboPatch.AddItem "FX 8 (sci-fi)"
  1131.     ComboPatch.AddItem "Sitar"
  1132.     ComboPatch.AddItem "Banjo"
  1133.     ComboPatch.AddItem "Shamisen"
  1134.     ComboPatch.AddItem "Koto"
  1135.     ComboPatch.AddItem "Kalimba"
  1136.     ComboPatch.AddItem "Bagpipe"
  1137.     ComboPatch.AddItem "Fiddle"
  1138.     ComboPatch.AddItem "Shanai"
  1139.     ComboPatch.AddItem "Tinkle Bell"
  1140.     ComboPatch.AddItem "Agogo"
  1141.     ComboPatch.AddItem "Steel Drums"
  1142.     ComboPatch.AddItem "Wood block"
  1143.     ComboPatch.AddItem "Taiko Drum"
  1144.     ComboPatch.AddItem "Melodic Tom"
  1145.     ComboPatch.AddItem "Synth Drum"
  1146.     ComboPatch.AddItem "Reverse Cymbal"
  1147.     ComboPatch.AddItem "Guitar Fret Noise"
  1148.     ComboPatch.AddItem "Breath Noise"
  1149.     ComboPatch.AddItem "Seashore"
  1150.     ComboPatch.AddItem "Bird Tweet"
  1151.     ComboPatch.AddItem "Telephone Ring"
  1152.     ComboPatch.AddItem "Helicopter"
  1153.     ComboPatch.AddItem "Applause"
  1154.     ComboPatch.AddItem "Gunshot"
  1155.     ComboPatch.ListIndex = 0
  1156.     MidiChannelOut = 0
  1157.     HSliderMIDIChannel.Value = 0
  1158.     HSliderOctave.Value = 3
  1159.     HSliderVolume.Value = 100
  1160.     KnobPan.Value = 64
  1161.     Screen.MousePointer = 0
  1162.     For n = 1 To 64
  1163.     PianoKey(n).DragIcon = PianoKey(0).DragIcon
  1164.     Next
  1165.     Piano.Show
  1166.     MidiSetupForm.Show MODAL
  1167. End Sub
  1168. Sub Form_Unload (Cancel As Integer)
  1169.     ' Stop the MIDI In
  1170.     MIDIInput1.Action = MIDIIN_STOP
  1171.     ' Close MIDI In
  1172.     MIDIInput1.Action = MIDIIN_CLOSE
  1173.     ' Close MIDI Out
  1174.     MIDIOutput1.Action = MIDIOUT_CLOSE
  1175.     End
  1176. End Sub
  1177. Sub HSliderMIDIChannel_Change ()
  1178.     ' Change Midi Channel to Vscroll1 value
  1179.     MidiChannelOut = HSliderMIDIChannel.Value
  1180.     ' Display new channel
  1181.     MidiChannelOutLabel.Caption = Str$(MidiChannelOut + 1)
  1182.     ' Sets the Patch & Volume for the current Midi Channel Out
  1183.     ComboPatch.ListIndex = MidiPatch(MidiChannelOut)
  1184.     HSliderVolume.Value = MidiVolume(MidiChannelOut)
  1185.     KnobPan.Value = MidiPan(MidiChannelOut)
  1186.     HSliderOctave.Value = Octave(MidiChannelOut) / 12
  1187. End Sub
  1188. Sub HSliderMIDIChannel_Scroll ()
  1189.     ' Change Midi Channel to Vscroll1 value
  1190.     MidiChannelOut = HSliderMIDIChannel.Value
  1191.     ' Display new channel
  1192.     MidiChannelOutLabel.Caption = Str$(MidiChannelOut + 1)
  1193.     ' Sets the Patch & Volume for the current Midi Channel Out
  1194.     ComboPatch.ListIndex = MidiPatch(MidiChannelOut)
  1195.     HSliderVolume.Value = MidiVolume(MidiChannelOut)
  1196.     KnobPan.Value = MidiPan(MidiChannelOut)
  1197.     HSliderOctave.Value = Octave(MidiChannelOut) / 12
  1198. End Sub
  1199. Sub HSliderOctave_Change ()
  1200.     LabelOctave.Caption = Str$(HSliderOctave.Value)
  1201.     Octave(MidiChannelOut) = (HSliderOctave.Value * 12)
  1202. End Sub
  1203. Sub HSliderOctave_Scroll ()
  1204.     LabelOctave.Caption = Str$(HSliderOctave.Value)
  1205.     Octave(MidiChannelOut) = (HSliderOctave.Value * 12)
  1206. End Sub
  1207. Sub HSliderVolume_Change ()
  1208.     MidiVelocity = HSliderVolume.Value
  1209.     MidiVolume(MidiChannelOut) = HSliderVolume.Value
  1210.     LabelVolume.Caption = Str$(MidiVelocity)
  1211. End Sub
  1212. Sub HSliderVolume_Scroll ()
  1213.     MidiVelocity = HSliderVolume.Value
  1214.     MidiVolume(MidiChannelOut) = HSliderVolume.Value
  1215.     LabelVolume.Caption = Str$(MidiVelocity)
  1216. End Sub
  1217. Sub KnobPan_Change ()
  1218.     MidiPan(MidiChannelOut) = KnobPan.Value
  1219.     'Pan Midi Out routine
  1220.     MIDIOutput1.Message = CONTROLLER_CHANGE + MidiChannelOut
  1221.     MIDIOutput1.Data1 = PAN
  1222.     MIDIOutput1.Data2 = MidiPan(MidiChannelOut)
  1223.     MIDIOutput1.Time = 0
  1224.     MIDIOutput1.Action = MIDIOUT_SEND
  1225. End Sub
  1226. Sub KnobPan_Scroll ()
  1227.     MidiPan(MidiChannelOut) = KnobPan.Value
  1228.     'Pan Midi Out routine
  1229.     MIDIOutput1.Message = CONTROLLER_CHANGE + MidiChannelOut
  1230.     MIDIOutput1.Data1 = PAN
  1231.     MIDIOutput1.Data2 = MidiPan(MidiChannelOut)
  1232.     MIDIOutput1.Time = 0
  1233.     MIDIOutput1.Action = MIDIOUT_SEND
  1234. End Sub
  1235. Sub MIDIInput1_Error (ErrorCode As Integer, ErrorMessage As String)
  1236.     MsgBox ErrorMessage
  1237. End Sub
  1238. Sub MIDIInput1_Message ()
  1239.     Dim InMessage As Integer
  1240.     Dim InData1 As Integer
  1241.     Dim InData2 As Integer
  1242.     '
  1243.     ' The MIDI1.VBX will receive and time stamp in-coming MIDI data very
  1244.     ' fast, but it takes VB a lot of time to fire this Message event. If
  1245.     ' you need to process MIDI data in real-time, each time this Message
  1246.     ' event fires, you should take all the pending messages.  One way to
  1247.     ' do this is by using a Do While MIDIInput2.MessageCount > 0
  1248.     ' This do while loop allows you to take all the messages that are
  1249.     ' waiting in the message queue.
  1250.     Do While MIDIInput1.MessageCount > 0
  1251.     'This is in-coming MIDI data
  1252.     InMessage = MIDIInput1.Message
  1253.     InData1 = MIDIInput1.Data1
  1254.     InData2 = MIDIInput1.Data2
  1255.     'Now we are going to prepare the MIDI data that just came in to
  1256.     'be ready to go right back out the MIDI OUT
  1257.     MIDIOutput1.Message = InMessage
  1258.     MIDIOutput1.Data1 = InData1
  1259.     MIDIOutput1.Data2 = InData2
  1260.     Select Case InMessage
  1261.     ' NOTE_ON, NOTE_OFF, PROGRAM_CHANGE, TOTAL_MIDI_CHANNELS
  1262.     ' are all constants from the MIDCONST.BAS file.  Using constants in
  1263.     ' the MIDCONST.BAS file will allow you to not have to work with
  1264.     ' confusing codes.
  1265.     ' Check to see if the in-coming MIDI Message was a NOTE_ON from the
  1266.     ' currently selected MIDI channel.
  1267.     ' We can only display 64 notes on our graphic piano.  Check to see if
  1268.     ' InData1 (which is the actual MIDI note be played) can be shown on
  1269.     ' the graphic piano display.
  1270.     ' Using HSliderOctave, the Octave(MidiChannelOut) is set.  This
  1271.     ' allows you to slide the octave display up and down for disaply
  1272.     ' notes that would otherwise not be able to appear on the graphic
  1273.     ' piano display.
  1274.        Case NOTE_ON + MidiChannelOut
  1275.         If InData1 <= 64 + Octave(MidiChannelOut) Then
  1276.             '
  1277.             ' Some MIDI manufactures turn MIDI notes off by sending a MIDI NOTE ON
  1278.             ' with a velocity = 0.  InData2 is the note velocity.  If it is greater
  1279.             ' than 0 then it truly is a note on.  If it is, then push down the
  1280.             ' graphic key on the piano.
  1281.             '
  1282.             ' If InData2 is equal to zero, then release the graphic key on the piano
  1283.             ' because it is actually a note off.
  1284.             '
  1285.             If InData2 > 0 Then
  1286.             ' Push down the graphic key on the piano
  1287.             'Piano.PianoKey(InData1 - Octave(MidiChannelOut)).BevelOuter = 0
  1288.             Else
  1289.             ' Release the graphic key on the piano
  1290.             'Piano.PianoKey(InData1 - Octave(MidiChannelOut)).BevelOuter = 2
  1291.             End If
  1292.         End If
  1293.         'Tell MIDIOutput1 to send the MIDI data
  1294.         MIDIOutput1.Action = MIDIOUT_SEND
  1295.         '
  1296.         ' MIDI NOTE OFF Event received
  1297.         '
  1298.         Case NOTE_OFF + MidiChannelOut
  1299.         If InData1 <= 64 + Octave(MidiChannelOut) Then
  1300.             '
  1301.             ' Release the graphic key on the piano
  1302.             '
  1303.             'Piano.PianoKey(InData1 - Octave(MidiChannelOut)).BevelOuter = 2
  1304.         End If
  1305.         'Tell MIDIOutput1 to send the MIDI data
  1306.         MIDIOutput1.Action = MIDIOUT_SEND
  1307.         '
  1308.         ' Patch Program Change received
  1309.         '
  1310.         Case PROGRAM_CHANGE + MidiChannelOut
  1311.         ' Patches (organ, piano, horn, etc.) are changed by sending
  1312.         ' a PROGRAM_CHANGE.  If we received a PROGRAM_CHANGE on the
  1313.         ' current MIDI channel from an external MIDI device, we
  1314.         ' will update the patch name on the screen and send the patch
  1315.         ' change out the MIDI Out.
  1316.          ComboPatch.ListIndex = MIDIOutput1.Data1
  1317.         '
  1318.         'Controller Change received
  1319.         '
  1320.         Case CONTROLLER_CHANGE + MidiChannelOut
  1321.         Select Case InData1
  1322.             Case MAIN_VOLUME
  1323.             HSliderVolume.Value = InData2
  1324.             Case PAN
  1325.             KnobPan.Value = InData2
  1326.         End Select
  1327.         
  1328.         Case Else
  1329.         'Tell MIDIOutput1 to send the MIDI data
  1330.         MIDIOutput1.Action = MIDIOUT_SEND
  1331.     End Select
  1332.     'Remove the MIDI data from the MIDI IN queue
  1333.     MIDIInput1.Action = MIDIIN_REMOVE
  1334.     Loop
  1335. End Sub
  1336. Sub MIDISetup_Click ()
  1337.     MidiSetupForm.Show MODAL
  1338. End Sub
  1339. Sub PanelWhite_DragDrop (Index As Integer, Source As Control, X As Single, Y As Single)
  1340.     Dim nn As Integer
  1341.     For nn = 0 To NoteCatchCount - 1
  1342.     MIDIOutput1.Message = NOTE_ON + MidiChannelOut
  1343.     MIDIOutput1.Data2 = 0
  1344.     MIDIOutput1.Data1 = NoteOnCatcher(nn)
  1345.     MIDIOutput1.Time = 0
  1346.     MIDIOutput1.Action = MIDIOUT_SEND
  1347.     'Piano.PianoKey(NoteOnCatcher(nn) - Octave(MidiChannelOut)).BevelOuter = 2
  1348.     Next nn
  1349.     NoteCatchCount = 0
  1350. End Sub
  1351. Sub PanelWhite_DragOver (Index As Integer, Source As Control, X As Single, Y As Single, State As Integer)
  1352.     Dim MIDIMessage As Integer
  1353.     Dim MIDINoteOut As Integer
  1354.     MIDINoteOut = Index + Octave(MidiChannelOut)
  1355.     'If still on same note, discard
  1356.     If NoteCatchCount > 0 Then
  1357.        If NoteOnCatcher(NoteCatchCount - 1) = MIDINoteOut Then
  1358.         Exit Sub
  1359.        End If
  1360.     End If
  1361.     'Piano.PianoKey(Index).BevelOuter = 0
  1362.     MIDIOutput1.Message = NOTE_ON + MidiChannelOut
  1363.     MIDIOutput1.Data2 = MidiVelocity
  1364.     MIDIOutput1.Data1 = MIDINoteOut
  1365.     MIDIOutput1.Time = 0
  1366.     MIDIOutput1.Action = MIDIOUT_SEND
  1367.     'Since drag/drop is being used, we must keep track of the note being
  1368.     'played.
  1369.     NoteOnCatcher(NoteCatchCount) = MIDINoteOut
  1370.     If NoteCatchCount < 750 Then
  1371.     NoteCatchCount = NoteCatchCount + 1
  1372.     End If
  1373. End Sub
  1374. Sub PianoKey_DragDrop (Index As Integer, Source As Control, X As Single, Y As Single)
  1375.     Dim nn As Integer
  1376.     For nn = 0 To NoteCatchCount - 1
  1377.     MIDIOutput1.Message = NOTE_ON + MidiChannelOut
  1378.     MIDIOutput1.Data2 = 0
  1379.     MIDIOutput1.Data1 = NoteOnCatcher(nn)
  1380.     MIDIOutput1.Time = 0
  1381.     MIDIOutput1.Action = MIDIOUT_SEND
  1382.     Select Case (NoteOnCatcher(nn) - Octave(MidiChannelOut)) Mod 12
  1383.         Case Is = 0, 2, 4, 5, 7, 9, 11
  1384.         Piano.PianoKey(NoteOnCatcher(nn) - Octave(MidiChannelOut)).BackColor = WHITE
  1385.         Case Is = 1, 3, 6, 8, 10
  1386.         Piano.PianoKey(NoteOnCatcher(nn) - Octave(MidiChannelOut)).BackColor = BLACK
  1387.     End Select
  1388.     Next nn
  1389.     NoteCatchCount = 0
  1390. End Sub
  1391. Sub PianoKey_DragOver (Index As Integer, Source As Control, X As Single, Y As Single, State As Integer)
  1392.     Dim MIDIMessage As Integer
  1393.     Dim MIDINoteOut As Integer
  1394.     MIDINoteOut = Index + Octave(MidiChannelOut)
  1395.     'If still on same note, discard
  1396.     If NoteCatchCount > 0 Then
  1397.        If NoteOnCatcher(NoteCatchCount - 1) = MIDINoteOut Then
  1398.         Exit Sub
  1399.        End If
  1400.     End If
  1401.     Select Case (Index Mod 12)
  1402.     Case Is = 0, 2, 4, 5, 7, 9, 11
  1403.         Piano.PianoKey(Index).BackColor = YELLOW
  1404.     Case Is = 1, 3, 6, 8, 10
  1405.         Piano.PianoKey(Index).BackColor = CYAN
  1406.     End Select
  1407.     MIDIOutput1.Message = NOTE_ON + MidiChannelOut
  1408.     MIDIOutput1.Data2 = MidiVelocity
  1409.     MIDIOutput1.Data1 = MIDINoteOut
  1410.     MIDIOutput1.Time = 0
  1411.     MIDIOutput1.Action = MIDIOUT_SEND
  1412.     'Since drag/drop is being used, we must keep track of the note being
  1413.     'played.
  1414.     NoteOnCatcher(NoteCatchCount) = MIDINoteOut
  1415.     If NoteCatchCount < 750 Then
  1416.     NoteCatchCount = NoteCatchCount + 1
  1417.     End If
  1418. End Sub
  1419.