]> git.donarmstrong.com Git - qmk_firmware.git/blob - docs/internals_send_functions.md
use twitter card large setting for larger previews
[qmk_firmware.git] / docs / internals_send_functions.md
1 # group `send_functions` {#group__send__functions}
2
3 These are the functions you use to send midi data through a device.
4
5 ## Summary
6
7  Members                        | Descriptions                                
8 --------------------------------|---------------------------------------------
9 `public void `[`midi_send_cc`](#group__send__functions_1gaaf884811c92df405ca8fe1a00082f960)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num,uint8_t val)`            | Send a control change message (cc) via the given device.
10 `public void `[`midi_send_noteon`](#group__send__functions_1ga467bcf46dbf03ec269ce565b46bc2775)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num,uint8_t vel)`            | Send a note on message via the given device.
11 `public void `[`midi_send_noteoff`](#group__send__functions_1gaedb7d8805425eef5d47d57ddcb4c7a49)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num,uint8_t vel)`            | Send a note off message via the given device.
12 `public void `[`midi_send_aftertouch`](#group__send__functions_1ga0014847571317a0e34b2ef46a6bc584f)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t note_num,uint8_t amt)`            | Send an after touch message via the given device.
13 `public void `[`midi_send_pitchbend`](#group__send__functions_1gae5a4a1e71611e7534be80af9ce3d3491)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,int16_t amt)`            | Send a pitch bend message via the given device.
14 `public void `[`midi_send_programchange`](#group__send__functions_1ga7b15588ef25e5e1ff09c2afc3151ce86)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num)`            | Send a program change message via the given device.
15 `public void `[`midi_send_channelpressure`](#group__send__functions_1gaf23e69fdf812e89c0036f51f88ab2e1b)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t amt)`            | Send a channel pressure message via the given device.
16 `public void `[`midi_send_clock`](#group__send__functions_1ga4e1b11a7cdb0875f6e03ce7c79c581aa)`(`[`MidiDevice`](#struct__midi__device)` * device)`            | Send a clock message via the given device.
17 `public void `[`midi_send_tick`](#group__send__functions_1ga2b43c7d433d940c5b907595aac947972)`(`[`MidiDevice`](#struct__midi__device)` * device)`            | Send a tick message via the given device.
18 `public void `[`midi_send_start`](#group__send__functions_1ga1569749a8d58ccc56789289d7c7245cc)`(`[`MidiDevice`](#struct__midi__device)` * device)`            | Send a start message via the given device.
19 `public void `[`midi_send_continue`](#group__send__functions_1gaed5dc29d754a27372e89ab8bc20ee120)`(`[`MidiDevice`](#struct__midi__device)` * device)`            | Send a continue message via the given device.
20 `public void `[`midi_send_stop`](#group__send__functions_1ga026e1a620276cb653ac501aa0d12a988)`(`[`MidiDevice`](#struct__midi__device)` * device)`            | Send a stop message via the given device.
21 `public void `[`midi_send_activesense`](#group__send__functions_1ga9b6e4c6ce4719d2604187b325620db37)`(`[`MidiDevice`](#struct__midi__device)` * device)`            | Send an active sense message via the given device.
22 `public void `[`midi_send_reset`](#group__send__functions_1ga3671e39a6d93ca9568fc493001af1b1b)`(`[`MidiDevice`](#struct__midi__device)` * device)`            | Send a reset message via the given device.
23 `public void `[`midi_send_tcquarterframe`](#group__send__functions_1ga5b85639910eec280bb744c934d0fd45a)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t time)`            | Send a tc quarter frame message via the given device.
24 `public void `[`midi_send_songposition`](#group__send__functions_1gab1c9eeef3b57a8cd2e6128d18e85eb7f)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t pos)`            | Send a song position message via the given device.
25 `public void `[`midi_send_songselect`](#group__send__functions_1ga42de7838ba70d949af9a50f9facc3c50)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t song)`            | Send a song select message via the given device.
26 `public void `[`midi_send_tunerequest`](#group__send__functions_1ga8db6c7e04d48e4d2266dd59118ca0656)`(`[`MidiDevice`](#struct__midi__device)` * device)`            | Send a tune request message via the given device.
27 `public void `[`midi_send_byte`](#group__send__functions_1ga857e85eb90b288385642d4d991e09881)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t b)`            | Send a byte via the given device.
28 `public void `[`midi_send_data`](#group__send__functions_1ga36e2f2e45369d911b76969361679054b)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t count,uint8_t byte0,uint8_t byte1,uint8_t byte2)`            | Send up to 3 bytes of data.
29 `public void `[`midi_send_array`](#group__send__functions_1ga245243cb1da18d2cea18d4b18d846ead)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t count,uint8_t * array)`            | Send an array of formatted midi data.
30
31 ## Members
32
33 #### `public void `[`midi_send_cc`](#group__send__functions_1gaaf884811c92df405ca8fe1a00082f960)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num,uint8_t val)` {#group__send__functions_1gaaf884811c92df405ca8fe1a00082f960}
34
35 Send a control change message (cc) via the given device.
36
37 #### Parameters
38 * `device` the device to use for sending 
39
40 * `chan` the channel to send on, 0-15 
41
42 * `num` the cc num 
43
44 * `val` the value of that cc num
45
46 #### `public void `[`midi_send_noteon`](#group__send__functions_1ga467bcf46dbf03ec269ce565b46bc2775)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num,uint8_t vel)` {#group__send__functions_1ga467bcf46dbf03ec269ce565b46bc2775}
47
48 Send a note on message via the given device.
49
50 #### Parameters
51 * `device` the device to use for sending 
52
53 * `chan` the channel to send on, 0-15 
54
55 * `num` the note number 
56
57 * `vel` the note velocity
58
59 #### `public void `[`midi_send_noteoff`](#group__send__functions_1gaedb7d8805425eef5d47d57ddcb4c7a49)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num,uint8_t vel)` {#group__send__functions_1gaedb7d8805425eef5d47d57ddcb4c7a49}
60
61 Send a note off message via the given device.
62
63 #### Parameters
64 * `device` the device to use for sending 
65
66 * `chan` the channel to send on, 0-15 
67
68 * `num` the note number 
69
70 * `vel` the note velocity
71
72 #### `public void `[`midi_send_aftertouch`](#group__send__functions_1ga0014847571317a0e34b2ef46a6bc584f)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t note_num,uint8_t amt)` {#group__send__functions_1ga0014847571317a0e34b2ef46a6bc584f}
73
74 Send an after touch message via the given device.
75
76 #### Parameters
77 * `device` the device to use for sending 
78
79 * `chan` the channel to send on, 0-15 
80
81 * `note_num` the note number 
82
83 * `amt` the after touch amount
84
85 #### `public void `[`midi_send_pitchbend`](#group__send__functions_1gae5a4a1e71611e7534be80af9ce3d3491)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,int16_t amt)` {#group__send__functions_1gae5a4a1e71611e7534be80af9ce3d3491}
86
87 Send a pitch bend message via the given device.
88
89 #### Parameters
90 * `device` the device to use for sending 
91
92 * `chan` the channel to send on, 0-15 
93
94 * `amt` the bend amount range: -8192..8191, 0 means no bend
95
96 #### `public void `[`midi_send_programchange`](#group__send__functions_1ga7b15588ef25e5e1ff09c2afc3151ce86)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t num)` {#group__send__functions_1ga7b15588ef25e5e1ff09c2afc3151ce86}
97
98 Send a program change message via the given device.
99
100 #### Parameters
101 * `device` the device to use for sending 
102
103 * `chan` the channel to send on, 0-15 
104
105 * `num` the program to change to
106
107 #### `public void `[`midi_send_channelpressure`](#group__send__functions_1gaf23e69fdf812e89c0036f51f88ab2e1b)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t chan,uint8_t amt)` {#group__send__functions_1gaf23e69fdf812e89c0036f51f88ab2e1b}
108
109 Send a channel pressure message via the given device.
110
111 #### Parameters
112 * `device` the device to use for sending 
113
114 * `chan` the channel to send on, 0-15 
115
116 * `amt` the amount of channel pressure
117
118 #### `public void `[`midi_send_clock`](#group__send__functions_1ga4e1b11a7cdb0875f6e03ce7c79c581aa)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga4e1b11a7cdb0875f6e03ce7c79c581aa}
119
120 Send a clock message via the given device.
121
122 #### Parameters
123 * `device` the device to use for sending
124
125 #### `public void `[`midi_send_tick`](#group__send__functions_1ga2b43c7d433d940c5b907595aac947972)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga2b43c7d433d940c5b907595aac947972}
126
127 Send a tick message via the given device.
128
129 #### Parameters
130 * `device` the device to use for sending
131
132 #### `public void `[`midi_send_start`](#group__send__functions_1ga1569749a8d58ccc56789289d7c7245cc)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga1569749a8d58ccc56789289d7c7245cc}
133
134 Send a start message via the given device.
135
136 #### Parameters
137 * `device` the device to use for sending
138
139 #### `public void `[`midi_send_continue`](#group__send__functions_1gaed5dc29d754a27372e89ab8bc20ee120)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1gaed5dc29d754a27372e89ab8bc20ee120}
140
141 Send a continue message via the given device.
142
143 #### Parameters
144 * `device` the device to use for sending
145
146 #### `public void `[`midi_send_stop`](#group__send__functions_1ga026e1a620276cb653ac501aa0d12a988)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga026e1a620276cb653ac501aa0d12a988}
147
148 Send a stop message via the given device.
149
150 #### Parameters
151 * `device` the device to use for sending
152
153 #### `public void `[`midi_send_activesense`](#group__send__functions_1ga9b6e4c6ce4719d2604187b325620db37)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga9b6e4c6ce4719d2604187b325620db37}
154
155 Send an active sense message via the given device.
156
157 #### Parameters
158 * `device` the device to use for sending
159
160 #### `public void `[`midi_send_reset`](#group__send__functions_1ga3671e39a6d93ca9568fc493001af1b1b)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga3671e39a6d93ca9568fc493001af1b1b}
161
162 Send a reset message via the given device.
163
164 #### Parameters
165 * `device` the device to use for sending
166
167 #### `public void `[`midi_send_tcquarterframe`](#group__send__functions_1ga5b85639910eec280bb744c934d0fd45a)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t time)` {#group__send__functions_1ga5b85639910eec280bb744c934d0fd45a}
168
169 Send a tc quarter frame message via the given device.
170
171 #### Parameters
172 * `device` the device to use for sending 
173
174 * `time` the time of this quarter frame, range 0..16383
175
176 #### `public void `[`midi_send_songposition`](#group__send__functions_1gab1c9eeef3b57a8cd2e6128d18e85eb7f)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t pos)` {#group__send__functions_1gab1c9eeef3b57a8cd2e6128d18e85eb7f}
177
178 Send a song position message via the given device.
179
180 #### Parameters
181 * `device` the device to use for sending 
182
183 * `pos` the song position
184
185 #### `public void `[`midi_send_songselect`](#group__send__functions_1ga42de7838ba70d949af9a50f9facc3c50)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t song)` {#group__send__functions_1ga42de7838ba70d949af9a50f9facc3c50}
186
187 Send a song select message via the given device.
188
189 #### Parameters
190 * `device` the device to use for sending 
191
192 * `song` the song to select
193
194 #### `public void `[`midi_send_tunerequest`](#group__send__functions_1ga8db6c7e04d48e4d2266dd59118ca0656)`(`[`MidiDevice`](#struct__midi__device)` * device)` {#group__send__functions_1ga8db6c7e04d48e4d2266dd59118ca0656}
195
196 Send a tune request message via the given device.
197
198 #### Parameters
199 * `device` the device to use for sending
200
201 #### `public void `[`midi_send_byte`](#group__send__functions_1ga857e85eb90b288385642d4d991e09881)`(`[`MidiDevice`](#struct__midi__device)` * device,uint8_t b)` {#group__send__functions_1ga857e85eb90b288385642d4d991e09881}
202
203 Send a byte via the given device.
204
205 This is a generic method for sending data via the given midi device. This would be useful for sending sysex data or messages that are not implemented in this API, if there are any. Please contact the author if you find some so we can add them.
206
207 #### Parameters
208 * `device` the device to use for sending 
209
210 * `b` the byte to send
211
212 #### `public void `[`midi_send_data`](#group__send__functions_1ga36e2f2e45369d911b76969361679054b)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t count,uint8_t byte0,uint8_t byte1,uint8_t byte2)` {#group__send__functions_1ga36e2f2e45369d911b76969361679054b}
213
214 Send up to 3 bytes of data.
215
216 % 4 is applied to count so that you can use this to pass sysex through
217
218 #### Parameters
219 * `device` the device to use for sending 
220
221 * `count` the count of bytes to send, %4 is applied 
222
223 * `byte0` the first byte 
224
225 * `byte1` the second byte, ignored if cnt % 4 != 2 
226
227 * `byte2` the third byte, ignored if cnt % 4 != 3
228
229 #### `public void `[`midi_send_array`](#group__send__functions_1ga245243cb1da18d2cea18d4b18d846ead)`(`[`MidiDevice`](#struct__midi__device)` * device,uint16_t count,uint8_t * array)` {#group__send__functions_1ga245243cb1da18d2cea18d4b18d846ead}
230
231 Send an array of formatted midi data.
232
233 Can be used for sysex.
234
235 #### Parameters
236 * `device` the device to use for sending 
237
238 * `count` the count of bytes to send 
239
240 * `array` the array of bytes
241