-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi.lcdoc
executable file
·505 lines (236 loc) · 12 KB
/
api.lcdoc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
Library: community.coremidi.paulmcclernan
Type: library
Summary: This library contains bindings for macOS & iOS CoreMIDI, useful sending musical performance data to other applications or communicating with external musical devices.
OS: macOS, iOS (untested)
Edition: Community
Description:
This library is a (currently incomplete) wrapper for Apple's CoreMIDI API.
>*Note:* This library is MIT licensed (permissive).
> Please share and share a like.
version: 0.6
author: Paul McClernan
Name: CoreMIDIController
Type: command
Syntax: CoreMIDIController(<pController>,<pControllerVal><pMIDIChanNum>)
Summary: The send a controller with a single data byte value to on a given channel
Example: CoreMIDIController 7,127,1 -- 7 = Volume Controller, Data Byte 1, channel 1
Parameters:
pController: The number of the MIDI Controller to set values for
pControllerVal: The value byte one
pMIDIChanNum: MIDI Channel to send the controller value on, 1 to 16
Description: The send a controller with a single data byte value to on a given channel
Name: CoreMIDISendMIDIbytesNow
Type: command
Syntax: CoreMIDISendMIDIbytesNow(<pMIDIMsgData>)
Summary: Sends arbitrary bytes to the MIDI Client.
Example: CoreMIDISendMIDIbytesNow <pMIDIMsgData>
Parameters:
pMIDIMsgData: arbitrary bytes, does not check for the bytes for validity as MIDI messages
Description:
Sends arbitrary bytes to the MIDI Client immediately (as fast as possible).
A MIDI Client must be created first using CoreMIDIClientCreate.
Name: CoreMIDIPitchbend
Type: command
Syntax: CoreMIDIPitchbend <pPitchBendCoarse>,<pMIDIChannelNum>
Summary: The send pitchbend with coarse range from 0 to 127, 64 is centered (no bend)
Example:
CoreMIDIPitchbendFine 0,1 -- Pitchbend Maximum Down, channel 1
CoreMIDIPitchbendFine 127,1 -- Pitchbend Maximum Up, channel 1
CoreMIDIPitchbendFine 64,1 -- Centered No Bend, channel 1
Parameters:
pPitchBendCoarse: The number of the pitch bend 'position'
pMIDIChanNum: MIDI Channel to send the bend value on, 1 to 16
Description: The send a controller with a single data byte value to on a given channel
Name: CoreMIDIGetSourceNameAndID
Type: handler
Syntax: CoreMIDIGetSourceNameAndID(<pIndex>)
Summary: Given an index number of a MIDI Source returns Display Name and Unique ID Number.
Example: put CoreMIDIGetSourceNameAndID(1) into line 1 of button "Sources"
Parameters:
pIndex: Index number of a source currently available to CoreMIDI.
Description: Given an index number of a MIDI Source returns Display Name and Unique ID Number seperated by a comma.
Name: CoreMIDIObjectTypeFromID
Type: handler
Syntax: CoreMIDIObjectTypeFromID(<uniqueIDnum>)
Summary: Given the unique ID number of an object in the current MIDI setup returns the object's type.
Example: CoreMIDIObjectTypeFromID( uniqueIDnum )
Parameters:
uniqueIDnum: Unique ID number of an object in the current MIDI setup
Description:
Given the unique ID number of an object in the current MIDI setup returns the object's type.
(Source, Destination, Extenal Device, etc.)
Name: CoreMIDINoteOn
Type: command
Syntax: CoreMIDINoteOn <MIDINoteNumber>,pMIDIVelocityNumber,<pMIDIChannelNumber>
Summary: Immediately sends a MIDI Note On message with the given pitch and velocity on the given channel.
Example: CoreMIDINoteOn 60,127,1 -- 60=Middle C, 127=Full velocity, 1=MIDI channel 1
Parameters:
pMIDINoteNum: The number of the pitch to turn on, 0 to 127, 60 = Middle C
pMIDIVeloNum: The velocity to play the given pitch at, 0 to 127
pMIDIChanNum: The MIDI Channel to play the note on, 1 to 16
Description: Immediately sends a MIDI Note On message with the given pitch and velocity on the given channel.
Name: CoreMIDIStart
Type: command
Syntax: CoreMIDIStart()
Summary: Sends System Realtime Start message
Example: CoreMIDIStart
Description: Sends Start message for receivers such as Drum Machines that respond to System Realtime messages
Name: CoreMIDIGetNumberOfDestinations
Type: handler
Syntax: CoreMIDIGetNumberOfDestinations()
Summary: Returns a count of MIDI Destinations in the MIDI Setup that are currently available.
Example: put CoreMIDIGetNumberOfDestinations() into tDestinationsCount
Description:
Returns a count of MIDI Destinations in the MIDI Setup that are currently available.
Destinations in the setup that are powered off or not connected will not be included in the count.
Name: CoreMIDIAftertouch
Type: command
Syntax: CoreMIDIAftertouch(<pNoteNum>,<pKeyPressure>,<pMIDIChanNum>)
Summary: The send Aftertouch (key pressure) for specified note on the given channel
Example: CoreMIDIAftertouch 60,127,1 -- Middle C=60, 127=Maximum Pressure, channel 1
Parameters:
pNoteNum: The number of the pitch/key to apply pressure value to
pKeyPressure: The pitch/key pressure value, range 0 to 127
pMIDIChanNum: MIDI Channel to send the value on, 1 to 16
Description: The send Aftertouch (key pressure) for specified note on the given channel. MIDI Controllers can have pressure sensors under each key that can transmit this value for each note.
Name: CoreMIDIProgramChange
Type: command
Syntax: CoreMIDIProgramChange(<pPatch>,<pMIDIChanNum>)
Summary: Sends Program Change message on the given channel
Example: CoreMIDIProgramChange 10,1 -- 10=, channel 1
Parameters:
pPatch: The patch number to change to, range 1 to 128
pMIDIChanNum: MIDI Channel to send the value on, 1 to 16
Description: Sends Program Change message on the given channel.
Name: CoreMIDISendMIDIbytesInTime
Type: handler
Syntax: CoreMIDISendMIDIbytesInTime(<pTimeOffsetMillisecs>,<pMIDIMsgData>)
Summary: Sends arbitrary bytes to the MIDI Client's Queue in millisecond Offsets from now.
Example:
CoreMIDISendMIDIbytesInTime(0,pMIDIMsgData) -- sends pMIDIMsgData immediately
CoreMIDISendMIDIbytesInTime(1000,pMIDIMsgData) -- sends pMIDIMsgData in 1 second
Parameters:
pTimeOffsetMillisecs: the millesecond offset from now to hold in queue
pMIDIMsgData: arbitrary bytes, does not check for the bytes for validity as MIDI messages
Description:
Sends arbitrary bytes to the MIDI Client's Queue in millisecond Offsets from now.
A MIDI Client must be created first using CoreMIDIClientCreate.
Name: CoreMIDIStop
Type: command
Syntax: CoreMIDIStop()
Summary: Sends System Realtime Stop message
Example: CoreMIDIStop
Description: Sends Stop message for receivers such as Drum Machines that respond to System Realtime messages
Name: CoreMIDISelectSourceByID
Type: handler
Syntax: CoreMIDISelectSourceByID(<uniqueIDnum>)
Summary: Selects the MIDI Source of the corrisponding unique ID as the data output source.
Example: CoreMIDISelectSourceByID(uniqueIDnum)
Description: Given an index number of a MIDI Source returns Display Name and Unique ID Number seperated by a comma.
Parameters:
:
Name: CoreMIDIGetDestinationInfo
Type: handler
Syntax: CoreMIDIGetDestinationInfo(<pIndex>)
Summary: Given an index number of a MIDI Destination returns Text of it's XML/Plist Data
Example: put CoreMIDIGetDestinationInfo(1) into fld "Destination Plist Info" -- info for the 1st detination found
Parameters:
pIndex: Index number of a destination in the currently available to CoreMIDI.
Description: Given an index number of a MIDI Destination returns Text of it's XML/Plist Data
Name: CoreMIDINoteOff
Type: command
Syntax: CoreMIDINoteOff <MIDINoteNumber>,<MIDIChannelNumber>
Summary: Immediately sends a MIDI Note Off message with the given pitch and velocity on the given channel.
Example: CoreMIDINoteOff 60,1 -- Turns off Middle C on MIDI channel 1
Parameters:
pMIDINoteNum: The number of the pitch to turn off, 0 to 127, 60 = Middle C
pMIDIChanNum: The MIDI Channel to send the message to, 0 to 15, 0 = Channel 1
Description: Immediately sends a MIDI Note Off message with the given pitch on the given channel.
Name: CoreMIDIChannelPressure
Type: command
Syntax: CoreMIDIChannelPressure(<pChannelPressure>,<pMIDIChanNum>)
Summary: The send Channel Pressure on the given channel
Example: CoreMIDIChannelPressure 127,1 -- 127=Maximum Pressure, channel 1
Parameters:
pChannelPressure: The channel pressure value, range 0 to 127
pMIDIChanNum: MIDI Channel to send the value on, 1 to 16
Description: Send Channel Pressure on the given channel. MIDI Controllers can have a single pressure sensor strip for the full range of keys.
Name: CoreMIDIContinue
Type: command
Syntax: CoreMIDIContinue()
Summary: Sends System Realtime Continue message
Example: CoreMIDIContinue
Description: Sends Continue message for receivers such as Drum Machines that respond to System Realtime messages
Name: CoreMIDIGetNumberOfSources
Type: handler
Syntax: CoreMIDIGetNumberOfSources()
Summary: Returns a count of MIDI Sources in the MIDI Setup that are currently available.
Example: put CoreMIDIGetNumberOfSources() into tDestinationsCount
Returns: Count of currently available MIDI Sources
Description:
Returns a count of MIDI Sources in the MIDI Setup that are currently available.
Destinations in the setup that are powered off or not connected will not be included in the count.
Name: CoreMIDIGetDestinationNameAndID
Type: handler
Syntax: CoreMIDIGetDestinationNameAndID(<pIndex>)
Summary: Given an index number of a MIDI Destination returns Display Name and Unique ID Number.
Example: put CoreMIDIGetDestinationNameAndID(1) into line 1 of button "Destinations"
Parameters:
pIndex: Index number of a destination in the currently available to CoreMIDI.
Description: Given an index number of a MIDI Destination returns Display Name and Unique ID Number seperated by a comma.
Name: CoreMIDIPitchbendFine
Type: command
Syntax: CoreMIDIPitchbendFine <pPitchBendCoarseNFine>,<pMIDIChanNum>
Summary: The send pitchbend with fine range from 0 to 16384, 8192 is centered (no bend)
Example:
CoreMIDIPitchbendFine 0,1 -- Pitchbend Maximum Down, channel 1
CoreMIDIPitchbendFine 16384,1 -- Pitchbend Maximum Up, channel 1
CoreMIDIPitchbendFine 8192,1 -- Centered / No Bend, channel 1
Parameters: pPitchBendCoarseNFine\: The number of the pitch bend 'position'
pMIDIChanNum: MIDI Channel to send the bend value on, 1 to 16
Description: The send pitchbend with fine range from 0 to 16384, 8192 is centered (no bend)
Name: CoreMIDISystemReset
Type: command
Syntax: CoreMIDISystemReset()
Summary: Sends System Realtime Reset message
Example: CoreMIDISystemReset
Description:
Sends System Reset message for receivers such that respond to such messages.
The receiver should be reset to the following states if available:
- Omni on, Polyphonic
- Local control on
- All notes turned off
- All controllers returned to their 'normal' settings
- Any song playing stopped
- Song Position Pointer = 0
- Running Status is cleared
- Reset to power-up conditions
Name: CoreMIDIGetSourceInfo
Type: handler
Syntax: CoreMIDIGetSourceInfo(<pIndex>)
Summary: Given an index number of a MIDI Source returns Text of it's XML/Plist Data.
Example: put CoreMIDIGetSourceInfo(1) into fld "Source Plist Info" -- info for the 1st detination found
Parameters:
pIndex: Index number of a source currently available to CoreMIDI.
Description: Given an index number of a MIDI Source returns text of it's XML/Plist Data.
Name: CoreMIDISourceCreate
Type: handler
Syntax: CoreMIDISourceCreate(<sourceName>,<uniqueIDnum>)
Summary: Creates a Virtual MIDI Source with the given name.
Example: CoreMIDISourceCreate("MIDI Output from my LiveCode Stack")
Parameters:
sourceName: The name to use for the MIDI source
uniqueIDnum:
A number to use as the unique ID number for your source, if an
empty value is passed an ID number will be generated by the system.
Description:
Creates a Virtual MIDI Source with the given name.
The name will appear as a source of MIDI data in other applications (such as GarageBand or LogicPro)
Name: CoreMIDIClientCreate
Type: handler
Syntax: CoreMIDIClientCreate(<clientName>)
Summary: Creates a MIDI Client and asigns it a name.
Example: CoreMIDIClientCreate("My LiveCode CoreMIDI Client")
Parameters:
clientName: The text string to use as the MIDI Client's name
Description: Creates a MIDI Client named with string provided (client name is not generally visible to other applications)