home *** CD-ROM | disk | FTP | other *** search
/ Mundo do CD-ROM 16 / CDROM16.iso / nando / MUSICA / PIANO2.TMP (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-05-30  |  15.5 KB  |  434 lines

  1. VERSION 2.00
  2. Begin Form Piano 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Piano"
  6.    ClientHeight    =   2388
  7.    ClientLeft      =   684
  8.    ClientTop       =   1680
  9.    ClientWidth     =   9516
  10.    ClipControls    =   0   'False
  11.    Height          =   3132
  12.    Icon            =   PIANO2.FRX:0000
  13.    Left            =   636
  14.    LinkTopic       =   "Form1"
  15.    MaxButton       =   0   'False
  16.    ScaleHeight     =   2388
  17.    ScaleWidth      =   9516
  18.    Top             =   984
  19.    Width           =   9612
  20.    Begin SSPanel Panel3D3 
  21.       Alignment       =   6  'Center - TOP
  22.       AutoSize        =   3  'AutoSize Child To Panel
  23.       BackColor       =   &H00C0C0C0&
  24.       BevelWidth      =   3
  25.       BorderWidth     =   0
  26.       Font3D          =   3  'Inset w/light shading
  27.       ForeColor       =   &H00808080&
  28.       Height          =   975
  29.       Left            =   90
  30.       Outline         =   -1  'True
  31.       TabIndex        =   20
  32.       Top             =   1290
  33.       Width           =   9315
  34.    Begin SSFrame SSFrame4 
  35.       Alignment       =   2  'Center
  36.       Caption         =   "Piano Settings"
  37.       Font3D          =   3  'Inset w/light shading
  38.       ForeColor       =   &H00000000&
  39.       Height          =   1245
  40.       Left            =   0
  41.       ShadowColor     =   1  'Black
  42.       ShadowStyle     =   1  'Raised
  43.       TabIndex        =   0
  44.       Top             =   0
  45.       Width           =   9585
  46.       Begin SSPanel SSPanel6 
  47.          Alignment       =   6  'Center - TOP
  48.          AutoSize        =   3  'AutoSize Child To Panel
  49.          BackColor       =   &H00C0C0C0&
  50.          BevelInner      =   1  'Inset
  51.          BorderWidth     =   2
  52.          Caption         =   "SSPanel6"
  53.          Font3D          =   3  'Inset w/light shading
  54.          ForeColor       =   &H00808080&
  55.          Height          =   375
  56.          Left            =   2070
  57.          TabIndex        =   18
  58.          Top             =   720
  59.          Width           =   1695
  60.          Begin HScrollBar HScrollVolume 
  61.             Height          =   276
  62.             LargeChange     =   10
  63.             Left            =   48
  64.             Max             =   127
  65.             TabIndex        =   19
  66.             Top             =   48
  67.             Value           =   50
  68.             Width           =   1596
  69.          End
  70.       End
  71.       Begin SSPanel SSPanel5 
  72.          Alignment       =   6  'Center - TOP
  73.          AutoSize        =   3  'AutoSize Child To Panel
  74.          BackColor       =   &H00C0C0C0&
  75.          BevelInner      =   1  'Inset
  76.          BorderWidth     =   1
  77.          Caption         =   "SSPanel5"
  78.          Font3D          =   3  'Inset w/light shading
  79.          ForeColor       =   &H00808080&
  80.          Height          =   375
  81.          Left            =   5520
  82.          TabIndex        =   16
  83.          Top             =   720
  84.          Width           =   2415
  85.          Begin HScrollBar HScrollPatch 
  86.             Height          =   300
  87.             LargeChange     =   10
  88.             Left            =   36
  89.             Max             =   127
  90.             TabIndex        =   17
  91.             Top             =   36
  92.             Value           =   1
  93.             Width           =   2340
  94.          End
  95.       End
  96.       Begin SSPanel SSPanel2 
  97.          Alignment       =   6  'Center - TOP
  98.          AutoSize        =   3  'AutoSize Child To Panel
  99.          BackColor       =   &H00C0C0C0&
  100.          BevelInner      =   1  'Inset
  101.          BorderWidth     =   1
  102.          Caption         =   "SSPanel2"
  103.          Font3D          =   3  'Inset w/light shading
  104.          ForeColor       =   &H00808080&
  105.          Height          =   375
  106.          Left            =   180
  107.          TabIndex        =   14
  108.          Top             =   720
  109.          Width           =   1680
  110.          Begin HScrollBar HScrollMIDIChannel 
  111.             Height          =   300
  112.             LargeChange     =   2
  113.             Left            =   36
  114.             Max             =   15
  115.             TabIndex        =   15
  116.             Top             =   36
  117.             Value           =   1
  118.             Width           =   1608
  119.          End
  120.       End
  121.       Begin SSPanel VolumeLabel 
  122.          Alignment       =   4  'Right Justify - MIDDLE
  123.          AutoSize        =   3  'AutoSize Child To Panel
  124.          BackColor       =   &H00C0C0C0&
  125.          BevelOuter      =   0  'None
  126.          BorderWidth     =   1
  127.          Caption         =   "100"
  128.          Font3D          =   3  'Inset w/light shading
  129.          ForeColor       =   &H00000000&
  130.          Height          =   228
  131.          Left            =   3348
  132.          TabIndex        =   13
  133.          Top             =   396
  134.          Width           =   372
  135.       End
  136.       Begin SSPanel MidiChannelOutLabel 
  137.          Alignment       =   4  'Right Justify - MIDDLE
  138.          AutoSize        =   3  'AutoSize Child To Panel
  139.          BackColor       =   &H00C0C0C0&
  140.          BevelOuter      =   0  'None
  141.          BorderWidth     =   1
  142.          Caption         =   "1"
  143.          Font3D          =   3  'Inset w/light shading
  144.          ForeColor       =   &H00000000&
  145.          Height          =   225
  146.          Left            =   1575
  147.          TabIndex        =   12
  148.          Top             =   390
  149.          Width           =   300
  150.       End
  151.       Begin SSPanel SSPanel10 
  152.          AutoSize        =   3  'AutoSize Child To Panel
  153.          BackColor       =   &H00C0C0C0&
  154.          BevelInner      =   2  'Raised
  155.          BevelOuter      =   1  'Inset
  156.          BorderWidth     =   0
  157.          Caption         =   "L -  Pan  - R"
  158.          FloodShowPct    =   0   'False
  159.          Font3D          =   3  'Inset w/light shading
  160.          ForeColor       =   &H00000000&
  161.          Height          =   375
  162.          Left            =   8100
  163.          TabIndex        =   11
  164.          Top             =   300
  165.          Width           =   1185
  166.       End
  167.       Begin SSPanel SSPanel9 
  168.          Alignment       =   1  'Left Justify - MIDDLE
  169.          AutoSize        =   3  'AutoSize Child To Panel
  170.          BackColor       =   &H00C0C0C0&
  171.          BevelInner      =   2  'Raised
  172.          BevelOuter      =   1  'Inset
  173.          BorderWidth     =   0
  174.          Caption         =   "Volume"
  175.          FloodShowPct    =   0   'False
  176.          Font3D          =   3  'Inset w/light shading
  177.          ForeColor       =   &H00000000&
  178.          Height          =   375
  179.          Index           =   0
  180.          Left            =   2070
  181.          TabIndex        =   10
  182.          Top             =   300
  183.          Width           =   1230
  184.       End
  185.       Begin SSPanel PatchLabel 
  186.          AutoSize        =   3  'AutoSize Child To Panel
  187.          BackColor       =   &H00C0C0C0&
  188.          BevelInner      =   2  'Raised
  189.          BevelOuter      =   1  'Inset
  190.          BorderWidth     =   0
  191.          Caption         =   "Electric Piano 2 "
  192.          Font3D          =   3  'Inset w/light shading
  193.          FontBold        =   -1  'True
  194.          FontItalic      =   0   'False
  195.          FontName        =   "Small Fonts"
  196.          FontSize        =   6
  197.          FontStrikethru  =   0   'False
  198.          FontUnderline   =   0   'False
  199.          ForeColor       =   &H00000000&
  200.          Height          =   375
  201.          Left            =   6150
  202.          TabIndex        =   9
  203.          Top             =   300
  204.          Width           =   1785
  205.       End
  206.       Begin SSPanel SSPanel8 
  207.          Alignment       =   1  'Left Justify - MIDDLE
  208.          AutoSize        =   3  'AutoSize Child To Panel
  209.          BackColor       =   &H00C0C0C0&
  210.          BevelInner      =   2  'Raised
  211.          BevelOuter      =   1  'Inset
  212.          BorderWidth     =   0
  213.          Caption         =   "Patch"
  214.          Font3D          =   3  'Inset w/light shading
  215.          ForeColor       =   &H00000000&
  216.          Height          =   375
  217.          Left            =   5535
  218.          TabIndex        =   8
  219.          Top             =   300
  220.          Width           =   615
  221.       End
  222.       Begin SSPanel SSPanel7 
  223.          Alignment       =   1  'Left Justify - MIDDLE
  224.          AutoSize        =   3  'AutoSize Child To Panel
  225.          BackColor       =   &H00C0C0C0&
  226.          BevelInner      =   2  'Raised
  227.          BevelOuter      =   1  'Inset
  228.          BorderWidth     =   0
  229.          Caption         =   "MIDI Channel "
  230.          Font3D          =   3  'Inset w/light shading
  231.          ForeColor       =   &H00000000&
  232.          Height          =   375
  233.          Left            =   180
  234.          TabIndex        =   7
  235.          Top             =   300
  236.          Width           =   1275
  237.       End
  238.       Begin SSPanel Panel3D1 
  239.          Alignment       =   6  'Center - TOP
  240.          AutoSize        =   3  'AutoSize Child To Panel
  241.          BackColor       =   &H00C0C0C0&
  242.          BevelInner      =   1  'Inset
  243.          BorderWidth     =   2
  244.          Caption         =   "SSPanel6"
  245.          Font3D          =   3  'Inset w/light shading
  246.          ForeColor       =   &H00808080&
  247.          Height          =   375
  248.          Left            =   8100
  249.          TabIndex        =   5
  250.          Top             =   720
  251.          Width           =   1215
  252.          Begin HScrollBar HScrollPan 
  253.             Height          =   276
  254.             LargeChange     =   10
  255.             Left            =   48
  256.             Max             =   127
  257.             TabIndex        =   6
  258.             Top             =   48
  259.             Width           =   1116
  260.          End
  261.       End
  262.       Begin SSPanel Panel3D2 
  263.          Alignment       =   6  'Center - TOP
  264.          AutoSize        =   3  'AutoSize Child To Panel
  265.          BackColor       =   &H00C0C0C0&
  266.          BevelInner      =   1  'Inset
  267.          BorderWidth     =   2
  268.          Caption         =   "SSPanel6"
  269.          Font3D          =   3  'Inset w/light shading
  270.          ForeColor       =   &H00808080&
  271.          Height          =   375
  272.          Left            =   4050
  273.          TabIndex        =   3
  274.          Top             =   720
  275.          Width           =   1200
  276.          Begin HScrollBar HScrollOctave 
  277.             Height          =   276
  278.             LargeChange     =   10
  279.             Left            =   48
  280.             Max             =   4
  281.             TabIndex        =   4
  282.             Top             =   48
  283.             Value           =   2
  284.             Width           =   1104
  285.          End
  286.       End
  287.       Begin SSPanel SSPanel9 
  288.          Alignment       =   1  'Left Justify - MIDDLE
  289.          AutoSize        =   3  'AutoSize Child To Panel
  290.          BackColor       =   &H00C0C0C0&
  291.          BevelInner      =   2  'Raised
  292.          BevelOuter      =   1  'Inset
  293.          BorderWidth     =   0
  294.          Caption         =   "Octave"
  295.          FloodShowPct    =   0   'False
  296.          Font3D          =   3  'Inset w/light shading
  297.          ForeColor       =   &H00000000&
  298.          Height          =   375
  299.          Index           =   1
  300.          Left            =   4050
  301.          TabIndex        =   2
  302.          Top             =   300
  303.          Width           =   735
  304.       End
  305.       Begin SSPanel LabelOctave 
  306.          Alignment       =   4  'Right Justify - MIDDLE
  307.          AutoSize        =   3  'AutoSize Child To Panel
  308.          BackColor       =   &H00C0C0C0&
  309.          BevelOuter      =   0  'None
  310.          BorderWidth     =   1
  311.          Caption         =   "1"
  312.          Font3D          =   3  'Inset w/light shading
  313.          ForeColor       =   &H00000000&
  314.          Height          =   225
  315.          Left            =   4950
  316.          TabIndex        =   1
  317.          Top             =   390
  318.          Width           =   300
  319.       End
  320.    End
  321.    Begin Menu File 
  322.       Caption         =   "&File"
  323.       Begin Menu Exit 
  324.          Caption         =   "E&xit"
  325.       End
  326.    End
  327.    Begin Menu help 
  328.       Caption         =   "&Help"
  329.       Begin Menu About 
  330.          Caption         =   "&About"
  331.       End
  332.    End
  333. Dim NoteCatchCount As Integer
  334. Dim NoteOnCatcher(1024) As Integer
  335. Sub About_Click ()
  336.     AboutBox1.Show Modal
  337. End Sub
  338. Sub Exit_Click ()
  339.     X% = MidiOutClose(hmidioutcopy)
  340.     End
  341. End Sub
  342. Sub Form_Load ()
  343.     Screen.MousePointer = 11
  344.     Piano.Left = 0
  345.     Piano.Top = 0
  346.     ' Open Midi Driver
  347.     MidiOutOpenPort
  348.     HScrollMIDIChannel.Value = 13
  349.     HScrollPatch.Value = 0
  350.     HScrollVolume.Value = 100
  351.     HScrollPan.Value = 64
  352.     HScrollOctave.Value = 2
  353.     Screen.MousePointer = 0
  354. End Sub
  355. Sub Form_Unload (Cancel As Integer)
  356.     X% = MidiOutClose(hmidioutcopy)
  357. End Sub
  358. Sub HScrollMIDIChannel_Change ()
  359.     ' Change Midi Channel to Vscroll1 value
  360.     MidiChannelOut = HScrollMIDIChannel.Value
  361.     ' Display new channel
  362.     MidiChannelOutLabel.Caption = Str$(MidiChannelOut + 1)
  363.     ' Sets the Patch & Volume for the current Midi Channel Out
  364.     HScrollPatch.Value = MidiPatch(MidiChannelOut)
  365.     HScrollVolume.Value = MidiVolume(MidiChannelOut)
  366.     HScrollPan.Value = MidiPan(MidiChannelOut)
  367.     HScrollOctave.Value = Octave(MidiChannelOut) / 12
  368. End Sub
  369. Sub HScrollOctave_Change ()
  370.     LabelOctave.Caption = Str$(HScrollOctave.Value)
  371.     Octave(MidiChannelOut) = (HScrollOctave.Value * 12)
  372. End Sub
  373. Sub HScrollPan_Change ()
  374.     MidiPan(MidiChannelOut) = HScrollPan.Value
  375.     ' 05-16-92 Pan Midi Out routine
  376.     MidiEventOut = 176 + MidiChannelOut
  377.     MidiNoteOut = 10
  378.     MidiVelOut = MidiPan(MidiChannelOut)
  379.     SendMidiOut
  380. End Sub
  381. Sub HScrollPatch_Change ()
  382.     ' Sets the Patch for the current Midi Channel Out
  383.     MidiPatch(MidiChannelOut) = HScrollPatch.Value
  384.     ReadPatch
  385.     ' 05-15-92 Patch Midi Out routine
  386.     MidiEventOut = &HC0 + MidiChannelOut
  387.     MidiNoteOut = MidiPatch(MidiChannelOut)
  388.     MidiVelOut = 0
  389.     SendMidiOut
  390. End Sub
  391. Sub HScrollVolume_Change ()
  392.     MidiVelocity = HScrollVolume.Value
  393.     MidiVolume(MidiChannelOut) = HScrollVolume.Value
  394.     VolumeLabel.Caption = Str$(MidiVelocity)
  395. End Sub
  396. Sub PanelWhite_DragDrop (Index As Integer, Source As Control, X As Single, Y As Single)
  397.     For nn = 0 To NoteCatchCount - 1
  398.         MidiEventOut = 144 + MidiChannelOut
  399.         MidiVelOut = 0
  400.         MidiNoteOut = NoteOnCatcher(nn)
  401.         SendMidiOut
  402.         NoteMOD = (NoteOnCatcher(nn) - Octave(MidiChannelOut)) Mod 12
  403.         If NoteMOD = 0 Or NoteMOD = 2 Or NoteMOD = 4 Or NoteMOD = 5 Or NoteMOD = 7 Or NoteMOD = 9 Or NoteMOD = 11 Then
  404.             Piano.PanelWhite(NoteOnCatcher(nn) - Octave(MidiChannelOut)).BevelOuter = 2
  405.         Else
  406.             Piano.PanelWhite(NoteOnCatcher(nn) - Octave(MidiChannelOut)).BevelOuter = 2
  407.         End If
  408.     Next nn
  409.     NoteCatchCount = 0
  410. End Sub
  411. Sub PanelWhite_DragOver (Index As Integer, Source As Control, X As Single, Y As Single, State As Integer)
  412.     'If still on same note, discard
  413.     If NoteCatchCount > 0 Then
  414.        If NoteOnCatcher(NoteCatchCount - 1) = Index + Octave(MidiChannelOut) Then
  415.             Exit Sub
  416.        End If
  417.     End If
  418.     NoteMOD = (Index) Mod 12
  419.     If NoteMOD = 0 Or NoteMOD = 2 Or NoteMOD = 4 Or NoteMOD = 5 Or NoteMOD = 7 Or NoteMOD = 9 Or NoteMOD = 11 Then
  420.         Piano.PanelWhite(Index).BevelOuter = 0
  421.     Else
  422.         Piano.PanelWhite(Index).BevelOuter = 0
  423.     End If
  424.     MidiEventOut = 144 + MidiChannelOut
  425.     MidiVelOut = MidiVelocity
  426.     MidiNoteOut = Index + Octave(MidiChannelOut)
  427.     SendMidiOut
  428.     'Since drag/drop is being used, we must keep track of the note being played.
  429.     NoteOnCatcher(NoteCatchCount) = MidiNoteOut
  430.     If NoteCatchCount < 750 Then 'Don't let array get out of range
  431.         NoteCatchCount = NoteCatchCount + 1
  432.     End If
  433. End Sub
  434.