dawmcp 0.0.0-stage → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/LICENSE +41 -0
  2. package/NOTICE +1 -0
  3. package/README.md +66 -2
  4. package/THIRD-PARTY-NOTICES.md +1740 -0
  5. package/bridge/index.mjs +62 -0
  6. package/bridge/types/browser-bridge-client.d.ts +134 -0
  7. package/bridge/types/browser-bridge-protocol.d.ts +150 -0
  8. package/bridge/types/catalog.d.ts +106 -0
  9. package/bridge/types/contracts.d.ts +3330 -0
  10. package/bridge/types/cubase-contracts.d.ts +87 -0
  11. package/bridge/types/fl-contracts.d.ts +297 -0
  12. package/bridge/types/http-daw-contracts.d.ts +141 -0
  13. package/bridge/types/logic-contracts.d.ts +527 -0
  14. package/bridge/types/plugin-contracts.d.ts +581 -0
  15. package/bridge/types/pro-tools-contracts.d.ts +103 -0
  16. package/bridge/types/provider-declaration.d.ts +122 -0
  17. package/bridge/types/provider-manifest.d.ts +463 -0
  18. package/bridge/types/provider-operations.d.ts +597 -0
  19. package/bridge/types/reaper-contracts.d.ts +217 -0
  20. package/bridge/types/studio-one-contracts.d.ts +125 -0
  21. package/bridge/types/waveform-contracts.d.ts +131 -0
  22. package/cli.mjs +2381 -0
  23. package/logic/LICENSE +21 -0
  24. package/logic/LogicProMCP +4 -0
  25. package/logic/THIRD-PARTY-NOTICES.md +6317 -0
  26. package/logic/lib/libswiftCompatibilitySpan.dylib +0 -0
  27. package/logic/runtime.json +42 -0
  28. package/native-midi/RtMidi-notices-and-interface.txt +677 -0
  29. package/native-midi/SOURCE.md +5 -0
  30. package/native-midi/package.json +1 -0
  31. package/node_modules/@julusian/midi/LICENSE +20 -0
  32. package/node_modules/@julusian/midi/binding-options.js +1 -0
  33. package/node_modules/@julusian/midi/dist/drums.js +1 -0
  34. package/node_modules/@julusian/midi/dist/input.js +1 -0
  35. package/node_modules/@julusian/midi/dist/instruments.js +1 -0
  36. package/node_modules/@julusian/midi/dist/lazy.js +1 -0
  37. package/node_modules/@julusian/midi/dist/message-parser.js +1 -0
  38. package/node_modules/@julusian/midi/dist/messages.js +1 -0
  39. package/node_modules/@julusian/midi/dist/midi.js +1 -0
  40. package/node_modules/@julusian/midi/dist/native.js +1 -0
  41. package/node_modules/@julusian/midi/dist/notes.js +1 -0
  42. package/node_modules/@julusian/midi/dist/output.js +1 -0
  43. package/node_modules/@julusian/midi/load-native.js +1 -0
  44. package/node_modules/@julusian/midi/package.json +98 -0
  45. package/node_modules/@julusian/midi/prebuilds/midi-darwin-arm64/node-napi-v7.node +0 -0
  46. package/node_modules/@julusian/midi/prebuilds/midi-darwin-x64/node-napi-v7.node +0 -0
  47. package/node_modules/@julusian/midi/prebuilds/midi-linux-arm/node-napi-v7.node +0 -0
  48. package/node_modules/@julusian/midi/prebuilds/midi-linux-arm64/node-napi-v7.node +0 -0
  49. package/node_modules/@julusian/midi/prebuilds/midi-linux-x64/node-napi-v7.node +0 -0
  50. package/node_modules/@julusian/midi/prebuilds/midi-linux-x64-musl/node-napi-v7.node +0 -0
  51. package/node_modules/@julusian/midi/prebuilds/midi-win32-arm64/node-napi-v7.node +0 -0
  52. package/node_modules/@julusian/midi/prebuilds/midi-win32-ia32/node-napi-v7.node +0 -0
  53. package/node_modules/@julusian/midi/prebuilds/midi-win32-x64/node-napi-v7.node +0 -0
  54. package/node_modules/pkg-prebuilds/LICENSE +21 -0
  55. package/node_modules/pkg-prebuilds/bindings.js +4 -0
  56. package/node_modules/pkg-prebuilds/lib/prebuild.js +1 -0
  57. package/node_modules/pkg-prebuilds/package.json +25 -0
  58. package/node_modules/tslib/LICENSE.txt +12 -0
  59. package/node_modules/tslib/modules/index.js +1 -0
  60. package/node_modules/tslib/modules/package.json +3 -0
  61. package/node_modules/tslib/package.json +47 -0
  62. package/node_modules/tslib/tslib.es6.js +1 -0
  63. package/node_modules/tslib/tslib.js +1 -0
  64. package/package.json +69 -3
  65. package/plugin/.agents/plugins/marketplace.json +19 -0
  66. package/plugin/.claude-plugin/marketplace.json +16 -0
  67. package/plugin/.claude-plugin/plugin.json +23 -0
  68. package/plugin/.mcp.json +12 -0
  69. package/plugin/README.md +67 -0
  70. package/plugin/THIRD-PARTY-NOTICES.md +1740 -0
  71. package/plugin/assets/logo.png +0 -0
  72. package/plugin/plugin.json +42 -0
  73. package/plugin/skills/daw/SKILL.md +43 -0
  74. package/plugin/skills/daw/references/ableton.md +16 -0
  75. package/plugin/skills/daw/references/ardour.md +18 -0
  76. package/plugin/skills/daw/references/arrangement.md +17 -0
  77. package/plugin/skills/daw/references/bitwig.md +15 -0
  78. package/plugin/skills/daw/references/connection.md +47 -0
  79. package/plugin/skills/daw/references/cubase.md +13 -0
  80. package/plugin/skills/daw/references/drums.md +23 -0
  81. package/plugin/skills/daw/references/editing.md +34 -0
  82. package/plugin/skills/daw/references/files-and-export.md +23 -0
  83. package/plugin/skills/daw/references/fl-studio.md +13 -0
  84. package/plugin/skills/daw/references/logic.md +15 -0
  85. package/plugin/skills/daw/references/mix-check.md +17 -0
  86. package/plugin/skills/daw/references/pro-tools.md +15 -0
  87. package/plugin/skills/daw/references/reaper.md +15 -0
  88. package/plugin/skills/daw/references/session-hygiene.md +15 -0
  89. package/plugin/skills/daw/references/studio-one.md +14 -0
  90. package/plugin/skills/daw/references/theory.md +26 -0
  91. package/plugin/skills/daw/references/waveform.md +17 -0
  92. package/skill/SKILL.md +43 -0
  93. package/skill/references/ableton.md +16 -0
  94. package/skill/references/ardour.md +18 -0
  95. package/skill/references/arrangement.md +17 -0
  96. package/skill/references/bitwig.md +15 -0
  97. package/skill/references/connection.md +47 -0
  98. package/skill/references/cubase.md +13 -0
  99. package/skill/references/drums.md +23 -0
  100. package/skill/references/editing.md +34 -0
  101. package/skill/references/files-and-export.md +23 -0
  102. package/skill/references/fl-studio.md +13 -0
  103. package/skill/references/logic.md +15 -0
  104. package/skill/references/mix-check.md +17 -0
  105. package/skill/references/pro-tools.md +15 -0
  106. package/skill/references/reaper.md +15 -0
  107. package/skill/references/session-hygiene.md +15 -0
  108. package/skill/references/studio-one.md +14 -0
  109. package/skill/references/theory.md +26 -0
  110. package/skill/references/waveform.md +17 -0
@@ -0,0 +1,677 @@
1
+ /**********************************************************************/
2
+ /*! \class RtMidi
3
+ \brief An abstract base class for realtime MIDI input/output.
4
+
5
+ This class implements some common functionality for the realtime
6
+ MIDI input/output subclasses RtMidiIn and RtMidiOut.
7
+
8
+ RtMidi GitHub site: https://github.com/thestk/rtmidi
9
+ RtMidi WWW site: http://www.music.mcgill.ca/~gary/rtmidi/
10
+
11
+ RtMidi: realtime MIDI i/o C++ classes
12
+ Copyright (c) 2003-2023 Gary P. Scavone
13
+
14
+ Permission is hereby granted, free of charge, to any person
15
+ obtaining a copy of this software and associated documentation files
16
+ (the "Software"), to deal in the Software without restriction,
17
+ including without limitation the rights to use, copy, modify, merge,
18
+ publish, distribute, sublicense, and/or sell copies of the Software,
19
+ and to permit persons to whom the Software is furnished to do so,
20
+ subject to the following conditions:
21
+
22
+ The above copyright notice and this permission notice shall be
23
+ included in all copies or substantial portions of the Software.
24
+
25
+ Any person wishing to distribute modifications to the Software is
26
+ asked to send the modifications to the original developer so that
27
+ they can be incorporated into the canonical version. This is,
28
+ however, not a binding provision of this license.
29
+
30
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
31
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
32
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
33
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
34
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
35
+ CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
36
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
37
+ */
38
+ /**********************************************************************/
39
+
40
+ /*!
41
+ \file RtMidi.h
42
+ */
43
+
44
+ #ifndef RTMIDI_H
45
+ #define RTMIDI_H
46
+
47
+ #if defined _WIN32 || defined __CYGWIN__
48
+ #if defined(RTMIDI_EXPORT)
49
+ #define RTMIDI_DLL_PUBLIC __declspec(dllexport)
50
+ #else
51
+ #define RTMIDI_DLL_PUBLIC
52
+ #endif
53
+ #else
54
+ #if __GNUC__ >= 4
55
+ #define RTMIDI_DLL_PUBLIC __attribute__( (visibility( "default" )) )
56
+ #else
57
+ #define RTMIDI_DLL_PUBLIC
58
+ #endif
59
+ #endif
60
+
61
+ #define RTMIDI_VERSION_MAJOR 6
62
+ #define RTMIDI_VERSION_MINOR 0
63
+ #define RTMIDI_VERSION_PATCH 0
64
+ #define RTMIDI_VERSION_BETA 0
65
+
66
+ #define RTMIDI_TOSTRING2(n) #n
67
+ #define RTMIDI_TOSTRING(n) RTMIDI_TOSTRING2(n)
68
+
69
+ #if RTMIDI_VERSION_BETA > 0
70
+ #define RTMIDI_VERSION RTMIDI_TOSTRING(RTMIDI_VERSION_MAJOR) \
71
+ "." RTMIDI_TOSTRING(RTMIDI_VERSION_MINOR) \
72
+ "." RTMIDI_TOSTRING(RTMIDI_VERSION_PATCH) \
73
+ "beta" RTMIDI_TOSTRING(RTMIDI_VERSION_BETA)
74
+ #else
75
+ #define RTMIDI_VERSION RTMIDI_TOSTRING(RTMIDI_VERSION_MAJOR) \
76
+ "." RTMIDI_TOSTRING(RTMIDI_VERSION_MINOR) \
77
+ "." RTMIDI_TOSTRING(RTMIDI_VERSION_PATCH)
78
+ #endif
79
+
80
+ #include <exception>
81
+ #include <iostream>
82
+ #include <string>
83
+ #include <vector>
84
+
85
+
86
+ /************************************************************************/
87
+ /*! \class RtMidiError
88
+ \brief Exception handling class for RtMidi.
89
+
90
+ The RtMidiError class is quite simple but it does allow errors to be
91
+ "caught" by RtMidiError::Type. See the RtMidi documentation to know
92
+ which methods can throw an RtMidiError.
93
+ */
94
+ /************************************************************************/
95
+
96
+ class RTMIDI_DLL_PUBLIC RtMidiError : public std::exception
97
+ {
98
+ public:
99
+ //! Defined RtMidiError types.
100
+ enum Type {
101
+ WARNING, /*!< A non-critical error. */
102
+ DEBUG_WARNING, /*!< A non-critical error which might be useful for debugging. */
103
+ UNSPECIFIED, /*!< The default, unspecified error type. */
104
+ NO_DEVICES_FOUND, /*!< No devices found on system. */
105
+ INVALID_DEVICE, /*!< An invalid device ID was specified. */
106
+ MEMORY_ERROR, /*!< An error occurred during memory allocation. */
107
+ INVALID_PARAMETER, /*!< An invalid parameter was specified to a function. */
108
+ INVALID_USE, /*!< The function was called incorrectly. */
109
+ DRIVER_ERROR, /*!< A system driver error occurred. */
110
+ SYSTEM_ERROR, /*!< A system error occurred. */
111
+ THREAD_ERROR /*!< A thread error occurred. */
112
+ };
113
+
114
+ //! The constructor.
115
+ RtMidiError( const std::string& message, Type type = RtMidiError::UNSPECIFIED ) throw()
116
+ : message_(message), type_(type) {}
117
+
118
+ //! The destructor.
119
+ virtual ~RtMidiError( void ) throw() {}
120
+
121
+ //! Prints thrown error message to stderr.
122
+ virtual void printMessage( void ) const throw() { std::cerr << '\n' << message_ << "\n\n"; }
123
+
124
+ //! Returns the thrown error message type.
125
+ virtual const Type& getType( void ) const throw() { return type_; }
126
+
127
+ //! Returns the thrown error message string.
128
+ virtual const std::string& getMessage( void ) const throw() { return message_; }
129
+
130
+ //! Returns the thrown error message as a c-style string.
131
+ virtual const char* what( void ) const throw() { return message_.c_str(); }
132
+
133
+ protected:
134
+ std::string message_;
135
+ Type type_;
136
+ };
137
+
138
+ //! RtMidi error callback function prototype.
139
+ /*!
140
+ \param type Type of error.
141
+ \param errorText Error description.
142
+
143
+ Note that class behaviour is undefined after a critical error (not
144
+ a warning) is reported.
145
+ */
146
+ typedef void (*RtMidiErrorCallback)( RtMidiError::Type type, const std::string &errorText, void *userData );
147
+
148
+ class MidiApi;
149
+
150
+ class RTMIDI_DLL_PUBLIC RtMidi
151
+ {
152
+ public:
153
+
154
+ RtMidi(RtMidi&& other) noexcept;
155
+ //! MIDI API specifier arguments.
156
+ enum Api {
157
+ UNSPECIFIED, /*!< Search for a working compiled API. */
158
+ MACOSX_CORE, /*!< Macintosh OS-X CoreMIDI API. */
159
+ LINUX_ALSA, /*!< The Advanced Linux Sound Architecture API. */
160
+ UNIX_JACK, /*!< The JACK Low-Latency MIDI Server API. */
161
+ WINDOWS_MM, /*!< The Microsoft Multimedia MIDI API. */
162
+ RTMIDI_DUMMY, /*!< A compilable but non-functional API. */
163
+ WEB_MIDI_API, /*!< W3C Web MIDI API. */
164
+ WINDOWS_UWP, /*!< The Microsoft Universal Windows Platform MIDI API. */
165
+ ANDROID_AMIDI, /*!< Native Android MIDI API. */
166
+ NUM_APIS /*!< Number of values in this enum. */
167
+ };
168
+
169
+ //! A static function to determine the current RtMidi version.
170
+ static std::string getVersion( void ) throw();
171
+
172
+ //! A static function to determine the available compiled MIDI APIs.
173
+ /*!
174
+ The values returned in the std::vector can be compared against
175
+ the enumerated list values. Note that there can be more than one
176
+ API compiled for certain operating systems.
177
+ */
178
+ static void getCompiledApi( std::vector<RtMidi::Api> &apis ) throw();
179
+
180
+ //! Return the name of a specified compiled MIDI API.
181
+ /*!
182
+ This obtains a short lower-case name used for identification purposes.
183
+ This value is guaranteed to remain identical across library versions.
184
+ If the API is unknown, this function will return the empty string.
185
+ */
186
+ static std::string getApiName( RtMidi::Api api );
187
+
188
+ //! Return the display name of a specified compiled MIDI API.
189
+ /*!
190
+ This obtains a long name used for display purposes.
191
+ If the API is unknown, this function will return the empty string.
192
+ */
193
+ static std::string getApiDisplayName( RtMidi::Api api );
194
+
195
+ //! Return the compiled MIDI API having the given name.
196
+ /*!
197
+ A case insensitive comparison will check the specified name
198
+ against the list of compiled APIs, and return the one which
199
+ matches. On failure, the function returns UNSPECIFIED.
200
+ */
201
+ static RtMidi::Api getCompiledApiByName( const std::string &name );
202
+
203
+ //! Pure virtual openPort() function.
204
+ virtual void openPort( unsigned int portNumber = 0, const std::string &portName = std::string( "RtMidi" ) ) = 0;
205
+
206
+ //! Pure virtual openVirtualPort() function.
207
+ virtual void openVirtualPort( const std::string &portName = std::string( "RtMidi" ) ) = 0;
208
+
209
+ //! Pure virtual getPortCount() function.
210
+ virtual unsigned int getPortCount() = 0;
211
+
212
+ //! Pure virtual getPortName() function.
213
+ virtual std::string getPortName( unsigned int portNumber = 0 ) = 0;
214
+
215
+ //! Pure virtual closePort() function.
216
+ virtual void closePort( void ) = 0;
217
+
218
+ void setClientName( const std::string &clientName );
219
+ void setPortName( const std::string &portName );
220
+
221
+ //! Returns true if a port is open and false if not.
222
+ /*!
223
+ Note that this only applies to connections made with the openPort()
224
+ function, not to virtual ports.
225
+ */
226
+ virtual bool isPortOpen( void ) const = 0;
227
+
228
+ //! Set an error callback function to be invoked when an error has occurred.
229
+ /*!
230
+ The callback function will be called whenever an error has occurred. It is best
231
+ to set the error callback function before opening a port.
232
+ */
233
+ virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL, void *userData = 0 ) = 0;
234
+
235
+ protected:
236
+ RtMidi();
237
+ virtual ~RtMidi();
238
+ MidiApi *rtapi_;
239
+
240
+ /* Make the class non-copyable */
241
+ RtMidi(RtMidi& other) = delete;
242
+ RtMidi& operator=(RtMidi& other) = delete;
243
+ };
244
+
245
+ /**********************************************************************/
246
+ /*! \class RtMidiIn
247
+ \brief A realtime MIDI input class.
248
+
249
+ This class provides a common, platform-independent API for
250
+ realtime MIDI input. It allows access to a single MIDI input
251
+ port. Incoming MIDI messages are either saved to a queue for
252
+ retrieval using the getMessage() function or immediately passed to
253
+ a user-specified callback function. Create multiple instances of
254
+ this class to connect to more than one MIDI device at the same
255
+ time. With the OS-X, Linux ALSA, and JACK MIDI APIs, it is also
256
+ possible to open a virtual input port to which other MIDI software
257
+ clients can connect.
258
+ */
259
+ /**********************************************************************/
260
+
261
+ // **************************************************************** //
262
+ //
263
+ // RtMidiIn and RtMidiOut class declarations.
264
+ //
265
+ // RtMidiIn / RtMidiOut are "controllers" used to select an available
266
+ // MIDI input or output interface. They present common APIs for the
267
+ // user to call but all functionality is implemented by the classes
268
+ // MidiInApi, MidiOutApi and their subclasses. RtMidiIn and RtMidiOut
269
+ // each create an instance of a MidiInApi or MidiOutApi subclass based
270
+ // on the user's API choice. If no choice is made, they attempt to
271
+ // make a "logical" API selection.
272
+ //
273
+ // **************************************************************** //
274
+
275
+ class RTMIDI_DLL_PUBLIC RtMidiIn : public RtMidi
276
+ {
277
+ public:
278
+ //! User callback function type definition.
279
+ typedef void (*RtMidiCallback)( double timeStamp, std::vector<unsigned char> *message, void *userData );
280
+
281
+ //! Default constructor that allows an optional api, client name and queue size.
282
+ /*!
283
+ An exception will be thrown if a MIDI system initialization
284
+ error occurs. The queue size defines the maximum number of
285
+ messages that can be held in the MIDI queue (when not using a
286
+ callback function). If the queue size limit is reached,
287
+ incoming messages will be ignored.
288
+
289
+ If no API argument is specified and multiple API support has been
290
+ compiled, the default order of use is ALSA, JACK (Linux) and CORE,
291
+ JACK (OS-X).
292
+
293
+ \param api An optional API id can be specified.
294
+ \param clientName An optional client name can be specified. This
295
+ will be used to group the ports that are created
296
+ by the application.
297
+ \param queueSizeLimit An optional size of the MIDI input queue can be specified.
298
+ */
299
+ RtMidiIn( RtMidi::Api api=UNSPECIFIED,
300
+ const std::string& clientName = "RtMidi Input Client",
301
+ unsigned int queueSizeLimit = 100 );
302
+
303
+ RtMidiIn(RtMidiIn&& other) noexcept : RtMidi(std::move(other)) { }
304
+
305
+ //! If a MIDI connection is still open, it will be closed by the destructor.
306
+ ~RtMidiIn ( void ) throw();
307
+
308
+ //! Returns the MIDI API specifier for the current instance of RtMidiIn.
309
+ RtMidi::Api getCurrentApi( void ) throw();
310
+
311
+ //! Open a MIDI input connection given by enumeration number.
312
+ /*!
313
+ \param portNumber An optional port number greater than 0 can be specified.
314
+ Otherwise, the default or first port found is opened.
315
+ \param portName An optional name for the application port that is used to connect to portId can be specified.
316
+ */
317
+ void openPort( unsigned int portNumber = 0, const std::string &portName = std::string( "RtMidi Input" ) );
318
+
319
+ //! Create a virtual input port, with optional name, to allow software connections (OS X, JACK and ALSA only).
320
+ /*!
321
+ This function creates a virtual MIDI input port to which other
322
+ software applications can connect. This type of functionality
323
+ is currently only supported by the Macintosh OS-X, any JACK,
324
+ and Linux ALSA APIs (the function returns an error for the other APIs).
325
+
326
+ \param portName An optional name for the application port that is
327
+ used to connect to portId can be specified.
328
+ */
329
+ void openVirtualPort( const std::string &portName = std::string( "RtMidi Input" ) );
330
+
331
+ //! Set a callback function to be invoked for incoming MIDI messages.
332
+ /*!
333
+ The callback function will be called whenever an incoming MIDI
334
+ message is received. While not absolutely necessary, it is best
335
+ to set the callback function before opening a MIDI port to avoid
336
+ leaving some messages in the queue.
337
+
338
+ \param callback A callback function must be given.
339
+ \param userData Optionally, a pointer to additional data can be
340
+ passed to the callback function whenever it is called.
341
+ */
342
+ void setCallback( RtMidiCallback callback, void *userData = 0 );
343
+
344
+ //! Cancel use of the current callback function (if one exists).
345
+ /*!
346
+ Subsequent incoming MIDI messages will be written to the queue
347
+ and can be retrieved with the \e getMessage function.
348
+ */
349
+ void cancelCallback();
350
+
351
+ //! Close an open MIDI connection (if one exists).
352
+ void closePort( void );
353
+
354
+ //! Returns true if a port is open and false if not.
355
+ /*!
356
+ Note that this only applies to connections made with the openPort()
357
+ function, not to virtual ports.
358
+ */
359
+ virtual bool isPortOpen() const;
360
+
361
+ //! Return the number of available MIDI input ports.
362
+ /*!
363
+ \return This function returns the number of MIDI ports of the selected API.
364
+ */
365
+ unsigned int getPortCount();
366
+
367
+ //! Return a string identifier for the specified MIDI input port number.
368
+ /*!
369
+ \return The name of the port with the given Id is returned.
370
+ \retval An empty string is returned if an invalid port specifier
371
+ is provided. User code should assume a UTF-8 encoding.
372
+ */
373
+ std::string getPortName( unsigned int portNumber = 0 );
374
+
375
+ //! Specify whether certain MIDI message types should be queued or ignored during input.
376
+ /*!
377
+ By default, MIDI timing and active sensing messages are ignored
378
+ during message input because of their relative high data rates.
379
+ MIDI sysex messages are ignored by default as well. Variable
380
+ values of "true" imply that the respective message type will be
381
+ ignored.
382
+ */
383
+ void ignoreTypes( bool midiSysex = true, bool midiTime = true, bool midiSense = true );
384
+
385
+ //! Fill the user-provided vector with the data bytes for the next available MIDI message in the input queue and return the event delta-time in seconds.
386
+ /*!
387
+ This function returns immediately whether a new message is
388
+ available or not. A valid message is indicated by a non-zero
389
+ vector size. An exception is thrown if an error occurs during
390
+ message retrieval or an input connection was not previously
391
+ established.
392
+ */
393
+ double getMessage( std::vector<unsigned char> *message );
394
+
395
+ //! Set an error callback function to be invoked when an error has occurred.
396
+ /*!
397
+ The callback function will be called whenever an error has occurred. It is best
398
+ to set the error callback function before opening a port.
399
+ */
400
+ virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL, void *userData = 0 );
401
+
402
+ //! Set maximum expected incoming message size.
403
+ /*!
404
+ For APIs that require manual buffer management, it can be useful to set the buffer
405
+ size and buffer count when expecting to receive large SysEx messages. Note that
406
+ currently this function has no effect when called after openPort(). The default
407
+ buffer size is 1024 with a count of 4 buffers, which should be sufficient for most
408
+ cases; as mentioned, this does not affect all API backends, since most either support
409
+ dynamically scalable buffers or take care of buffer handling themselves. It is
410
+ principally intended for users of the Windows MM backend who must support receiving
411
+ especially large messages.
412
+ */
413
+ virtual void setBufferSize( unsigned int size, unsigned int count );
414
+
415
+ protected:
416
+ void openMidiApi( RtMidi::Api api, const std::string &clientName, unsigned int queueSizeLimit );
417
+ };
418
+
419
+ /**********************************************************************/
420
+ /*! \class RtMidiOut
421
+ \brief A realtime MIDI output class.
422
+
423
+ This class provides a common, platform-independent API for MIDI
424
+ output. It allows one to probe available MIDI output ports, to
425
+ connect to one such port, and to send MIDI bytes immediately over
426
+ the connection. Create multiple instances of this class to
427
+ connect to more than one MIDI device at the same time. With the
428
+ OS-X, Linux ALSA and JACK MIDI APIs, it is also possible to open a
429
+ virtual port to which other MIDI software clients can connect.
430
+ */
431
+ /**********************************************************************/
432
+
433
+ class RTMIDI_DLL_PUBLIC RtMidiOut : public RtMidi
434
+ {
435
+ public:
436
+ //! Default constructor that allows an optional client name.
437
+ /*!
438
+ An exception will be thrown if a MIDI system initialization error occurs.
439
+
440
+ If no API argument is specified and multiple API support has been
441
+ compiled, the default order of use is ALSA, JACK (Linux) and CORE,
442
+ JACK (OS-X).
443
+ */
444
+ RtMidiOut( RtMidi::Api api=UNSPECIFIED,
445
+ const std::string& clientName = "RtMidi Output Client" );
446
+
447
+ RtMidiOut(RtMidiOut&& other) noexcept : RtMidi(std::move(other)) { }
448
+
449
+ //! The destructor closes any open MIDI connections.
450
+ ~RtMidiOut( void ) throw();
451
+
452
+ //! Returns the MIDI API specifier for the current instance of RtMidiOut.
453
+ RtMidi::Api getCurrentApi( void ) throw();
454
+
455
+ //! Open a MIDI output connection.
456
+ /*!
457
+ An optional port number greater than 0 can be specified.
458
+ Otherwise, the default or first port found is opened. An
459
+ exception is thrown if an error occurs while attempting to make
460
+ the port connection.
461
+ */
462
+ void openPort( unsigned int portNumber = 0, const std::string &portName = std::string( "RtMidi Output" ) );
463
+
464
+ //! Close an open MIDI connection (if one exists).
465
+ void closePort( void );
466
+
467
+ //! Returns true if a port is open and false if not.
468
+ /*!
469
+ Note that this only applies to connections made with the openPort()
470
+ function, not to virtual ports.
471
+ */
472
+ virtual bool isPortOpen() const;
473
+
474
+ //! Create a virtual output port, with optional name, to allow software connections (OS X, JACK and ALSA only).
475
+ /*!
476
+ This function creates a virtual MIDI output port to which other
477
+ software applications can connect. This type of functionality
478
+ is currently only supported by the Macintosh OS-X, Linux ALSA
479
+ and JACK APIs (the function does nothing with the other APIs).
480
+ An exception is thrown if an error occurs while attempting to
481
+ create the virtual port.
482
+ */
483
+ void openVirtualPort( const std::string &portName = std::string( "RtMidi Output" ) );
484
+
485
+ //! Return the number of available MIDI output ports.
486
+ unsigned int getPortCount( void );
487
+
488
+ //! Return a string identifier for the specified MIDI port type and number.
489
+ /*!
490
+ \return The name of the port with the given Id is returned.
491
+ \retval An empty string is returned if an invalid port specifier
492
+ is provided. User code should assume a UTF-8 encoding.
493
+ */
494
+ std::string getPortName( unsigned int portNumber = 0 );
495
+
496
+ //! Immediately send a single message out an open MIDI output port.
497
+ /*!
498
+ An exception is thrown if an error occurs during output or an
499
+ output connection was not previously established.
500
+ */
501
+ void sendMessage( const std::vector<unsigned char> *message );
502
+
503
+ //! Immediately send a single message out an open MIDI output port.
504
+ /*!
505
+ An exception is thrown if an error occurs during output or an
506
+ output connection was not previously established.
507
+
508
+ \param message A pointer to the MIDI message as raw bytes
509
+ \param size Length of the MIDI message in bytes
510
+ */
511
+ void sendMessage( const unsigned char *message, size_t size );
512
+
513
+ //! Set an error callback function to be invoked when an error has occurred.
514
+ /*!
515
+ The callback function will be called whenever an error has occurred. It is best
516
+ to set the error callback function before opening a port.
517
+ */
518
+ virtual void setErrorCallback( RtMidiErrorCallback errorCallback = NULL, void *userData = 0 );
519
+
520
+ protected:
521
+ void openMidiApi( RtMidi::Api api, const std::string &clientName );
522
+ };
523
+
524
+
525
+ // **************************************************************** //
526
+ //
527
+ // MidiInApi / MidiOutApi class declarations.
528
+ //
529
+ // Subclasses of MidiInApi and MidiOutApi contain all API- and
530
+ // OS-specific code necessary to fully implement the RtMidi API.
531
+ //
532
+ // Note that MidiInApi and MidiOutApi are abstract base classes and
533
+ // cannot be explicitly instantiated. RtMidiIn and RtMidiOut will
534
+ // create instances of a MidiInApi or MidiOutApi subclass.
535
+ //
536
+ // **************************************************************** //
537
+
538
+ class RTMIDI_DLL_PUBLIC MidiApi
539
+ {
540
+ public:
541
+
542
+ MidiApi();
543
+ virtual ~MidiApi();
544
+ virtual RtMidi::Api getCurrentApi( void ) = 0;
545
+ virtual void openPort( unsigned int portNumber, const std::string &portName ) = 0;
546
+ virtual void openVirtualPort( const std::string &portName ) = 0;
547
+ virtual void closePort( void ) = 0;
548
+ virtual void setClientName( const std::string &clientName ) = 0;
549
+ virtual void setPortName( const std::string &portName ) = 0;
550
+
551
+ virtual unsigned int getPortCount( void ) = 0;
552
+ virtual std::string getPortName( unsigned int portNumber ) = 0;
553
+
554
+ inline bool isPortOpen() const { return connected_; }
555
+ void setErrorCallback( RtMidiErrorCallback errorCallback, void *userData );
556
+
557
+ //! A basic error reporting function for RtMidi classes.
558
+ void error( RtMidiError::Type type, std::string errorString );
559
+
560
+ protected:
561
+ virtual void initialize( const std::string& clientName ) = 0;
562
+
563
+ void *apiData_;
564
+ bool connected_;
565
+ std::string errorString_;
566
+ RtMidiErrorCallback errorCallback_;
567
+ bool firstErrorOccurred_;
568
+ void *errorCallbackUserData_;
569
+
570
+ };
571
+
572
+ class RTMIDI_DLL_PUBLIC MidiInApi : public MidiApi
573
+ {
574
+ public:
575
+
576
+ MidiInApi( unsigned int queueSizeLimit );
577
+ virtual ~MidiInApi( void );
578
+ void setCallback( RtMidiIn::RtMidiCallback callback, void *userData );
579
+ void cancelCallback( void );
580
+ virtual void ignoreTypes( bool midiSysex, bool midiTime, bool midiSense );
581
+ virtual double getMessage( std::vector<unsigned char> *message );
582
+ virtual void setBufferSize( unsigned int size, unsigned int count );
583
+
584
+ // A MIDI structure used internally by the class to store incoming
585
+ // messages. Each message represents one and only one MIDI message.
586
+ struct MidiMessage {
587
+ std::vector<unsigned char> bytes;
588
+
589
+ //! Time in seconds elapsed since the previous message
590
+ double timeStamp;
591
+
592
+ // Default constructor.
593
+ MidiMessage()
594
+ : bytes(0), timeStamp(0.0) {}
595
+ };
596
+
597
+ struct MidiQueue {
598
+ unsigned int front;
599
+ unsigned int back;
600
+ unsigned int ringSize;
601
+ MidiMessage *ring;
602
+
603
+ // Default constructor.
604
+ MidiQueue()
605
+ : front(0), back(0), ringSize(0), ring(0) {}
606
+ bool push( const MidiMessage& );
607
+ bool pop( std::vector<unsigned char>*, double* );
608
+ unsigned int size( unsigned int *back=0, unsigned int *front=0 );
609
+ };
610
+
611
+ // The RtMidiInData structure is used to pass private class data to
612
+ // the MIDI input handling function or thread.
613
+ struct RtMidiInData {
614
+ MidiQueue queue;
615
+ MidiMessage message;
616
+ unsigned char ignoreFlags;
617
+ bool doInput;
618
+ bool firstMessage;
619
+ void *apiData;
620
+ bool usingCallback;
621
+ RtMidiIn::RtMidiCallback userCallback;
622
+ void *userData;
623
+ bool continueSysex;
624
+ unsigned int bufferSize;
625
+ unsigned int bufferCount;
626
+
627
+ // Default constructor.
628
+ RtMidiInData()
629
+ : ignoreFlags(7), doInput(false), firstMessage(true), apiData(0), usingCallback(false),
630
+ userCallback(0), userData(0), continueSysex(false), bufferSize(1024), bufferCount(4) {}
631
+ };
632
+
633
+ protected:
634
+ RtMidiInData inputData_;
635
+ };
636
+
637
+ class RTMIDI_DLL_PUBLIC MidiOutApi : public MidiApi
638
+ {
639
+ public:
640
+
641
+ MidiOutApi( void );
642
+ virtual ~MidiOutApi( void );
643
+ virtual void sendMessage( const unsigned char *message, size_t size ) = 0;
644
+ };
645
+
646
+ // **************************************************************** //
647
+ //
648
+ // Inline RtMidiIn and RtMidiOut definitions.
649
+ //
650
+ // **************************************************************** //
651
+
652
+ inline RtMidi::Api RtMidiIn :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); }
653
+ inline void RtMidiIn :: openPort( unsigned int portNumber, const std::string &portName ) { rtapi_->openPort( portNumber, portName ); }
654
+ inline void RtMidiIn :: openVirtualPort( const std::string &portName ) { rtapi_->openVirtualPort( portName ); }
655
+ inline void RtMidiIn :: closePort( void ) { rtapi_->closePort(); }
656
+ inline bool RtMidiIn :: isPortOpen() const { return rtapi_->isPortOpen(); }
657
+ inline void RtMidiIn :: setCallback( RtMidiCallback callback, void *userData ) { static_cast<MidiInApi *>(rtapi_)->setCallback( callback, userData ); }
658
+ inline void RtMidiIn :: cancelCallback( void ) { static_cast<MidiInApi *>(rtapi_)->cancelCallback(); }
659
+ inline unsigned int RtMidiIn :: getPortCount( void ) { return rtapi_->getPortCount(); }
660
+ inline std::string RtMidiIn :: getPortName( unsigned int portNumber ) { return rtapi_->getPortName( portNumber ); }
661
+ inline void RtMidiIn :: ignoreTypes( bool midiSysex, bool midiTime, bool midiSense ) { static_cast<MidiInApi *>(rtapi_)->ignoreTypes( midiSysex, midiTime, midiSense ); }
662
+ inline double RtMidiIn :: getMessage( std::vector<unsigned char> *message ) { return static_cast<MidiInApi *>(rtapi_)->getMessage( message ); }
663
+ inline void RtMidiIn :: setErrorCallback( RtMidiErrorCallback errorCallback, void *userData ) { rtapi_->setErrorCallback(errorCallback, userData); }
664
+ inline void RtMidiIn :: setBufferSize( unsigned int size, unsigned int count ) { static_cast<MidiInApi *>(rtapi_)->setBufferSize(size, count); }
665
+
666
+ inline RtMidi::Api RtMidiOut :: getCurrentApi( void ) throw() { return rtapi_->getCurrentApi(); }
667
+ inline void RtMidiOut :: openPort( unsigned int portNumber, const std::string &portName ) { rtapi_->openPort( portNumber, portName ); }
668
+ inline void RtMidiOut :: openVirtualPort( const std::string &portName ) { rtapi_->openVirtualPort( portName ); }
669
+ inline void RtMidiOut :: closePort( void ) { rtapi_->closePort(); }
670
+ inline bool RtMidiOut :: isPortOpen() const { return rtapi_->isPortOpen(); }
671
+ inline unsigned int RtMidiOut :: getPortCount( void ) { return rtapi_->getPortCount(); }
672
+ inline std::string RtMidiOut :: getPortName( unsigned int portNumber ) { return rtapi_->getPortName( portNumber ); }
673
+ inline void RtMidiOut :: sendMessage( const std::vector<unsigned char> *message ) { static_cast<MidiOutApi *>(rtapi_)->sendMessage( &message->at(0), message->size() ); }
674
+ inline void RtMidiOut :: sendMessage( const unsigned char *message, size_t size ) { static_cast<MidiOutApi *>(rtapi_)->sendMessage( message, size ); }
675
+ inline void RtMidiOut :: setErrorCallback( RtMidiErrorCallback errorCallback, void *userData ) { rtapi_->setErrorCallback(errorCallback, userData); }
676
+
677
+ #endif
@@ -0,0 +1,5 @@
1
+ Native MIDI: @julusian/midi 3.8.1, MIT, https://github.com/Julusian/node-midi. RtMidi notices accompany its package. Only shipped N-API v7 prebuilds are used. No dependency build scripts run.
2
+
3
+ DAWMCP npm runtime projection: @julusian/midi package.json omits scripts, bin and the build-only node-addon-api dependency; pkg-prebuilds package.json omits its build-time CLI bin mappings. Runtime dependencies, version/name/license/main/exports and native binary bytes are retained. tslib has no lifecycle hooks or CLI bins and is unchanged.
4
+
5
+ DAWMCP minifies copied runtime JavaScript with Maru’s npm payload helper. Native binaries and package manifests are not minified; removed legal comments are retained in the root THIRD-PARTY-NOTICES.md. Source maps are neither emitted nor distributed.
@@ -0,0 +1 @@
1
+ {"private":true,"name":"maru-firmware-midi-runtime"}