-- card: 3055 from stack: in
-- bmap block id: 4518
-- flags: 0000
-- background id: 2702
-- name: 
----- HyperTalk script -----
on openCard
  global noUpdate

  -- Here we use the buttons to setup and to find our sliders.
  -- If you wish, you can rearrange the slider on the card by
  -- moving the "Pitch" and "Mod" buttons.  Then, when you close
  -- and re-open the card, the sliders will be moved also.
  global PitchSlider, ModSlider
  put NewSlider(rect of button "pitch",64,0,127,"224 x x") into PitchSlider
  put NewSlider(rect of button "Mod",0,0,127,"176 1 x") into ModSlider

  -- don't draw sliders if About message is displayed:
  if noUpdate <> true then
    SetSlider  -- we make sure the synth is set the same as our sliders
  end if
end openCard

on closeCard
  disposeSlider
  -- or, we could have said:
  --   global PitchSlider, ModSlider
  --   DisposeSlider(PitchSlider)
  --   DisposeSlider(ModSlider)
end closeCard



-- part 3 (button)
-- low flags: 00
-- high flags: 8003
-- rect: left=126 top=294 right=316 bottom=226
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Flush buffer
----- HyperTalk script -----
on mouseUp
  put RxMIDI("flush") into dummy     -- flushes receive buffer
end mouseUp



-- part 4 (field)
-- low flags: 00
-- high flags: 0007
-- rect: left=152 top=176 right=273 bottom=458
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Receive


-- part 5 (button)
-- low flags: 00
-- high flags: 0000
-- rect: left=71 top=95 right=172 bottom=436
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Keyboard
----- HyperTalk script -----
on mouseDown
  global keymap
  global realNote
  get the clickloc
  put item 1 of it into noteNum
  put 1 + (noteNum - 71) DIV 13 into noteNum
  put word noteNum of keymap into realNote
  TxMIDI "hex",90,realNote,60 -- synth must be MIDI ch #1 or OMNI
end mouseDown

on mouseUp
  global realNote
  TxMIDI "hex",80,realNote,60
end mouseUp


-- part 6 (button)
-- low flags: 00
-- high flags: 8003
-- rect: left=285 top=294 right=316 bottom=385
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Clear Display
----- HyperTalk script -----
on mouseUp
  put empty into card field "Receive"    -- clear the display field
end mouseUp



-- part 11 (button)
-- low flags: 00
-- high flags: 8003
-- rect: left=20 top=294 right=316 bottom=120
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Display buffer
----- HyperTalk script -----
on mouseUp
  put RxMIDI("all") after card field "Receive"
end mouseUp



-- part 14 (button)
-- low flags: 00
-- high flags: 8003
-- rect: left=387 top=294 right=316 bottom=487
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Symbolic
----- HyperTalk script -----
on mouseUp
  put card field "receive" into junk
  put convertmidi("symbolic",junk) into card field "receive"
end mouseUp



-- part 16 (button)
-- low flags: 00
-- high flags: 0001
-- rect: left=305 top=28 right=52 bottom=336
-- title width / last selected line: 0
-- icon id / first selected line: 2478 / 2478
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: About
----- HyperTalk script -----
on mouseUp
  global noUpdate
  put true into noUpdate  -- don't draw sliders if About message is out
  Show card field "About"
end mouseUp



-- part 19 (button)
-- low flags: 00
-- high flags: 0002
-- rect: left=76 top=183 right=260 bottom=101
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Pitch
----- HyperTalk script -----
on mouseDown
  global PitchSlider
  get TrackSlider(PitchSlider)
end mouseDown



-- part 20 (button)
-- low flags: 00
-- high flags: 0002
-- rect: left=113 top=183 right=260 bottom=138
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Mod
----- HyperTalk script -----
on mouseDown
  global ModSlider
  get TrackSlider(ModSlider)
end mouseDown



-- part 18 (field)
-- low flags: 01
-- high flags: 2004
-- rect: left=37 top=62 right=303 bottom=473
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: About
----- HyperTalk script -----
on MouseUp
  global noUpdate
  put false into noUpdate
  set visible of me to false
  UpdateSlider
end mouseUp



-- part contents for card part 18
----- text -----

HyperMIDI v1.0, © 1988, Nigel J. Redmon

MAKE A COPY OF THIS STACK BEFORE MESSING WITH IT

HyperMIDI is shareware.  Please read the accompanying documentation.  If you wish to keep HyperMIDI, please send $30 to become a licensed user to:

EarLevel Engineering
21810 Barbara Street
Torrance, CA 90503

CompuServe: 72736,753      PAN: NIGELR     Delphi: NREDMON



-- part contents for card part 4
----- text -----
NON:1 72 52
NON:1 72 0
NON:1 70 64
PWL:1 6 67
PWL:1 10 69
PWL:1 16 72
PWL:1 20 74
PWL:1 26 77
PWL:1 30 79
PWL:1 36 82
PWL:1 40 84
PWL:1 44 86
PWL:1 48 88
PWL:1 50 89
PWL:1 54 91
PWL:1 56 92
PWL:1 58 93
PWL:1 60 94
PWL:1 62 95
PWL:1 64 96
PWL:1 66 97
PWL:1 68 98
PWL:1 70 99
PWL:1 72 100
PWL:1 74 101
PWL:1 72 100
PWL:1 70 99
PWL:1 68 98
PWL:1 64 96
PWL:1 62 95
PWL:1 52 90
PWL:1 32 80
PWL:1 6 67
NON:1 70 0
PWL:1 0 64
NON:1 67 64
NON:1 67 0
NON:1 65 91
CCH:1 1 1
CCH:1 1 2
CCH:1 1 4
CCH:1 1 6
CCH:1 1 8
CCH:1 1 9
CCH:1 1 11
CCH:1 1 13
CCH:1 1 15
CCH:1 1 17
CCH:1 1 18
CCH:1 1 20
CCH:1 1 21
CCH:1 1 23
CCH:1 1 25
CCH:1 1 26
CCH:1 1 27
CCH:1 1 29
CCH:1 1 30
CCH:1 1 32
CCH:1 1 33
CCH:1 1 35
CCH:1 1 36
CCH:1 1 38
CCH:1 1 39
CCH:1 1 40
CCH:1 1 41
CCH:1 1 43
CCH:1 1 44
CCH:1 1 45
CCH:1 1 46
CCH:1 1 47
CCH:1 1 49
CCH:1 1 50
CCH:1 1 51
CCH:1 1 52
CCH:1 1 53
CCH:1 1 54
CCH:1 1 55
CCH:1 1 56
CCH:1 1 57
CCH:1 1 58
CCH:1 1 59
CCH:1 1 60
CCH:1 1 59
CCH:1 1 57
CCH:1 1 56
CCH:1 1 55
CCH:1 1 53
CCH:1 1 52
CCH:1 1 50
CCH:1 1 48
CCH:1 1 46
CCH:1 1 44
CCH:1 1 41
CCH:1 1 39
CCH:1 1 36
CCH:1 1 33
NON:1 65 0
CCH:1 1 30
CCH:1 1 24
NON:1 67 60
CCH:1 1 19
CCH:1 1 15
CCH:1 1 11
CCH:1 1 8
CCH:1 1 4
CCH:1 1 1
CCH:1 1 0
NON:1 67 0
NON:1 60 60
NON:1 60 0
PCH:1 115
NON:1 60 48
PWL:1 2 65
PWL:1 6 67
PWL:1 8 68
PWL:1 12 70
PWL:1 16 72
PWL:1 20 74
PWL:1 24 76
PWL:1 28 78
PWL:1 32 80
PWL:1 34 81
PWL:1 38 83
PWL:1 42 85
PWL:1 44 86