qmk_firmware/assets/features_midi.md.u3tHPteB.js

16 lines
28 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { _ as _export_sfc, c as createElementBlock, o as openBlock, a8 as createStaticVNode } from "./chunks/framework.DyMmIvSC.js";
const __pageData = JSON.parse('{"title":"MIDI","description":"","frontmatter":{},"headers":[],"relativePath":"features/midi.md","filePath":"features/midi.md"}');
const _sfc_main = { name: "features/midi.md" };
const _hoisted_1 = /* @__PURE__ */ createStaticVNode('<h1 id="midi" tabindex="-1">MIDI <a class="header-anchor" href="#midi" aria-label="Permalink to &quot;MIDI&quot;"></a></h1><h2 id="usage" tabindex="-1">Usage <a class="header-anchor" href="#usage" aria-label="Permalink to &quot;Usage&quot;"></a></h2><p>First, enable MIDI by adding the following to your <code>rules.mk</code>:</p><div class="language-make vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">make</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">MIDI_ENABLE = yes</span></span></code></pre></div><p>There are two MIDI systems in QMK: basic and advanced. With basic MIDI you will only be able to send Note On and Note Off messages using the note keycodes, meaning that keycodes like <code>MI_OCTU</code> and <code>MI_OCTD</code> will not work. Advanced MIDI allows you to do things like octave shifts, channel changes, velocity changes, modulation, and more.</p><h3 id="caveats" tabindex="-1">Caveats <a class="header-anchor" href="#caveats" aria-label="Permalink to &quot;Caveats&quot;"></a></h3><p>MIDI requires 2 USB endpoints and as such may not work on some hardware such as V-USB controllers.</p><h3 id="basic-midi" tabindex="-1">Basic MIDI <a class="header-anchor" href="#basic-midi" aria-label="Permalink to &quot;Basic MIDI&quot;"></a></h3><p>To enable basic MIDI, add the following to your <code>config.h</code>:</p><div class="language-c vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#define</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MIDI_BASIC</span></span></code></pre></div><h3 id="advanced-midi" tabindex="-1">Advanced MIDI <a class="header-anchor" href="#advanced-midi" aria-label="Permalink to &quot;Advanced MIDI&quot;"></a></h3><p>To enable advanced MIDI, add the following to your <code>config.h</code>:</p><div class="language-c vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#define</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MIDI_ADVANCED</span></span></code></pre></div><h4 id="sending-control-change-cc-messages" tabindex="-1">Sending Control Change (CC) Messages <a class="header-anchor" href="#sending-control-change-cc-messages" aria-label="Permalink to &quot;Sending Control Change (CC) Messages&quot;"></a></h4><p>If you&#39;re aiming to emulate the features of something like a Launchpad or other MIDI controller you&#39;ll need to access the internal MIDI device directly.</p><p>Because there are so many possible CC messages, not all of them are implemented as keycodes. Additionally, you might need to provide more than just two values that you would get from a keycode (pressed and released) - for example, the analog values from a fader or a potentiometer. So, you will need to implement <a href="./../feature_macros">custom keycodes</a> if you want to use them in your keymap directly using <code>process_record_user()</code>.</p><p>For reference of all the possible control code numbers see <a href="#midi-specification">MIDI Specification</a></p><h4 id="example-code-for-using-generic-on-off-switches-as-per-midi-specification" tabindex="-1">Example code for using Generic On Off Switches as per MIDI Specification. <a class="header-anchor" href="#example-code-for-using-generic-on-off-switches-as-per-midi-specification" aria-label="Permalink to &quot;Example code for using Generic On Off Switches as per MIDI Specification.&quot;"></a></h4><div class="language-c vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">c</span><pre class="shiki shiki-themes github-light github-dark vp-code"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#include</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> QMK_KEYBOARD_H</span></span>\n<span class="line"></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">extern</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> MidiDevice midi_device;</span></span>\n<span class="line"></span>\n<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// MIDI CC codes for generic on/off switches (80, 81, 82, 83)</span></span>\n<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// Off: 0-63</span></span>\n<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// On: 64-127</span></span>\n<span class="line"></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#define</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MIDI_CC_OFF</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">#define</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> MIDI_CC_ON</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 127</span></span>\n<span class="line"></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">enum</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> custom_keycodes {</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> MIDI_CC80 </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> SAFE_RANGE,</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">};</span></span>\n<span class="line"></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">bool</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> process_record_user</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">uint16_t</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> keycode</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">keyrecord_t</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> *</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">record</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) {</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> switch</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (keycode) {</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> case</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> MIDI_CC80:</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> (record</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">-&gt;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">event.pressed) {</span></span>\n<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> midi_send_cc</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&amp;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">midi_device, midi_config.channel, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">80</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, MIDI_CC_ON);</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">else</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>\n<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> midi_send_cc</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&amp;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">midi_device, midi_config.channel, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">80</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, MIDI_CC_OFF);</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">};</span></span>\n<span class="line"></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">const</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> uint16_t</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> PROGMEM keymaps</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">[]</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[MATRIX_ROWS][MATRIX_COLS] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>\n<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> LAYOUT</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span></span>\n<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // ...</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> MIDI_CC80,</span></span>\n<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> // ...</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> )</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">};</span></span></code></pre></div><h3 id="keycodes" tabindex="-1">Keycodes <a class="header-anchor" href="#keycodes" aria-label="Permalink to &quot;Keycodes&quot;"></a></h3><table><thead><tr><th>Keycode</th><th>Aliases</th><th>Description</th></tr></thead><tbody><tr><td><code>QK_MIDI_ON</code></td><td><code>MI_ON</code></td><td>Turn MIDI on</td></tr><tr><td><code>QK_MIDI_OFF</code></td><td><code>MI_OFF</code></td><td>Turn MIDI off</td></tr><tr><td><code>QK_MIDI_TOGGLE</code></td><td><code>MI_TOGG</code></td><td>Toggle MIDI enabled</td></tr><tr><td><code>QK_MIDI_NOTE_C_0</code></td><td><code>MI_C</code></td><td>C octave 0</td></tr><tr><td><code>QK_MIDI_NOTE_C_SHARP_0</code></td><td><code>MI_Cs</code>, <code>MI_Db</code></td><td>C♯/D♭ octave 0</td></tr><tr><td><code>QK_MIDI_NOTE_D_0</code></td><td><code>MI_D</code></td><td>D octave 0</td></tr><tr><td><code>QK_MIDI_NOTE_D_SHARP_0</code></td><td><code>MI_Ds</code>, <code>MI_Eb</code></td><td>D♯/E♭ octave 0</td></tr><tr><td><code>QK_MIDI_NOTE_E_0</code></td><td><code>MI_E</code></td><td>E octave 0</td></tr><tr><td><code>QK_MIDI_NOTE_F_0</code></td><td><code>MI_F</code></td><td>F octave 0</td></tr><tr><td><code>QK_MIDI_NOTE_F_SHARP_0</code></td><td><code>MI_Fs</code>, <code>MI_Gb</code></td><td>F♯/G♭ octave 0</td></tr><tr><td><code>QK_MIDI_NOTE_G_0</code></td><td><code>MI_G</code></td><td>G octave 0</td></tr><tr><td><code>QK_MIDI_NOTE_G_SHARP_0</code></td><td><code>MI_Gs</code>, <code>MI_Ab</code></td><td>G♯/A♭ octave 0</td></tr><tr><td><code>QK_MIDI_NOTE_A_0</code></td><td><code>MI_A</code></td><td>A octave 0</td></tr><tr><td><code>QK_MIDI_NOTE_A_SHARP_0</code></td><td><code>MI_As</code>, <code>MI_Bb</code></td><td>A♯/B♭ octave 0</td></tr><tr><td><code>QK_MIDI_NOTE_B_0</code></td><td><code>MI_B</code></td><td>B octave 0</td></tr><tr><td><code>QK_MIDI_NOTE_C_1</code></td><td><code>MI_C1</code></td><td>C octave 1</td></tr><tr><td><code>QK_MIDI_NOTE_C_SHARP_1</code></td><td><code>MI_Cs1</code>, <code>MI_Db1</code></td><td>C♯/D♭ octave 1</td></tr><tr><td><code>QK_MIDI_NOTE_D_1</code></td><td><code>MI_D1</code></td><td>D octave 1</td></tr><tr><td><code>QK_MIDI_NOTE_D_SHARP_1</code></td><td><code>MI_Ds1</code>, <code>MI_Eb1</code></td><td>D♯/E♭ octave 1</td></tr><tr><td><code>QK_MIDI_NOTE_E_1</code></td><td><code>MI_E1</code></td><td>E octave 1</td></tr><tr><td><code>QK_MIDI_NOTE_F_1</code></td><td><code>MI_F1</code></td><td>F octave 1</td></tr><tr><td><code>QK_MIDI_NOTE_F_SHARP_1</code></td><td><code>MI_Fs1</code>, <code>MI_Gb1</code></td><td>F♯/G♭ octave 1</td></tr><tr><td><code>QK_MIDI_NOTE_G_1</code></td><td><code>MI_G1</code></td><td>G octave 1</td></tr><tr><td><code>QK_MIDI_NOTE_G_SHARP_1</code></td><td><code>MI_Gs1</code>, <code>MI_Ab1</code></td><td>G♯/A♭ octave 1</td></tr><tr><td><code>QK_MIDI_NOTE_A_1</code></td><td><code>MI_A1</code></td><td>A octave 1</td></tr><tr><td><code>QK_MIDI_NOTE_A_SHARP_1</code></td><td><code>MI_As1</code>, <code>MI_Bb1</code></td><td>A♯/B♭ octave 1</td></tr><tr><td><code>QK_MIDI_NOTE_B_1</code></td><td><code>MI_B1</code></td><td>B octave 1</td></tr><tr><td><code>QK_MIDI_NOTE_C_2</code></td><td><code>MI_C2</code></td><td>C octave 2</td></tr><tr><td><code>QK_MIDI_NOTE_C_SHARP_2</code></td><td><code>MI_Cs2</code>, <code>MI_Db2</code></td><td>C♯/D♭ octave 2</td></tr><tr><td><code>QK_MIDI_NOTE_D_2</code></td><td><code>MI_D2</code></td><td>D octave 2</td></tr><tr><td><code>QK_MIDI_NOTE_D_SHARP_2</code></td><td><code>MI_Ds2</code>, <code>MI_Eb2</code></td><td>D♯/E♭ octave 2</td></tr><tr><td><code>QK_MIDI_NOTE_E_2</code></td><td><code>MI_E2</code></td><td>E octave 2</td></tr><tr><td><code>QK_MIDI_NOTE_F_2</code></td><td><code>MI_F2</code></td><td>F octave 2</td></tr><tr><td><code>QK_MIDI_NOTE_F_SHARP_2</code></td><td><code>MI_Fs2</code>, <code>MI_Gb2</code></td><td>F♯/G♭ octave 2</td></tr><tr><td><code>QK_MIDI_NOTE_G_2</code></td><td><code>MI_G2</code></td><td>G octave 2</td></tr><tr><td><code>QK_MIDI_NOTE_G_SHARP_2</code></td><td><code>MI_Gs2</code>, <code>MI_Ab2</code></td><td>G♯/A♭ octave 2</td></tr><tr><td><code>QK_MIDI_NOTE_A_2</code></td><td><code>MI_A2</code></td><td>A octave 2</td></tr><tr><td><code>QK_MIDI_NOTE_A_SHARP_2</code></td><td><code>MI_As2</code>, <code>MI_Bb2</code></td><td>A♯/B♭ octave 2</td></tr><tr><td><code>QK_MIDI_NOTE_B_2</code></td><td><code>MI_B2</code></td><td>B octave 2</td></tr><tr><td><code>QK_MIDI_NOTE_C_3</code></td><td><code>MI_C3</code></td><td>C octave 3</td></tr><tr><td><code>QK_MIDI_NOTE_C_SHARP_3</code></td><td><code>MI_Cs3</code>, <code>MI_Db3</code></td><td>C♯/D♭ octave 3</td></tr><tr><td><code>QK_MIDI_NOTE_D_3</code></td><td><code>MI_D3</code></td><td>D octave 3</td></tr><tr><td><code>QK_MIDI_NOTE_D_SHARP_3</code></td><td><code>MI_Ds3</code>, <code>MI_Eb3</code></td><td>D♯/E♭ octave 3</td></tr><tr><td><code>QK_MIDI_NOTE_E_3</code></td><td><code>MI_E3</code></td><td>E octave 3</td></tr><tr><td><code>QK_MIDI_NOTE_F_3</code></td><td><code>MI_F3</code></td><td>F octave 3</td></tr><tr><td><code>QK_MIDI_NOTE_F_SHARP_3</code></td><td><code>MI_Fs3</code>, <code>MI_Gb3</code></td><td>F♯/G♭ octave 3</td></tr><tr><td><code>QK_MIDI_NOTE_G_3</code></td><td><code>MI_G3</code></td><td>G octave 3</td></tr><tr><td><code>QK_MIDI_NOTE_G_SHARP_3</code></td><td><code>MI_Gs3</code>, <code>MI_Ab3</code></td><td>G♯/A♭ octave 3</td></tr><tr><td><code>QK_MIDI_NOTE_A_3</code></td><td><code>MI_A3</code></td><td>A octave 3</td></tr><tr><td><code>QK_MIDI_NOTE_A_SHARP_3</code></td><td><code>MI_As3</code>, <code>MI_Bb3</code></td><td>A♯/B♭ octave 3</td></tr><tr><td><code>QK_MIDI_NOTE_B_3</code></td><td><code>MI_B3</code></td><td>B octave 3</td></tr><tr><td><code>QK_MIDI_NOTE_C_4</code></td><td><code>MI_C4</code></td><td>C octave 4</td></tr><tr><td><code>QK_MIDI_NOTE_C_SHARP_4</code></td><td><code>MI_Cs4</code>, <code>MI_Db4</code></td><td>C♯/D♭ octave 4</td></tr><tr><td><code>QK_MIDI_NOTE_D_4</code></td><td><code>MI_D4</code></td><td>D octave 4</td></tr><tr><td><code>QK_MIDI_NOTE_D_SHARP_4</code></td><td><code>MI_Ds4</code>, <code>MI_Eb4</code></td><td>D♯/E♭ octave 4</td></tr><tr><td><code>QK_MIDI_NOTE_E_4</code></td><td><code>MI_E4</code></td><td>E octave 4</td></tr><tr><td><code>QK_MIDI_NOTE_F_4</code></td><td><code>MI_F4</code></td><td>F octave 4</td></tr><tr><td><code>QK_MIDI_NOTE_F_SHARP_4</code></td><td><code>MI_Fs4</code>, <code>MI_Gb4</code></td><td>F♯/G♭ octave 4</td></tr><tr><td><code>QK_MIDI_NOTE_G_4</code></td><td><code>MI_G4</code></td><td>G octave 4</td></tr><tr><td><code>QK_MIDI_NOTE_G_SHARP_4</code></td><td><code>MI_Gs4</code>, <code>MI_Ab4</code></td><td>G♯/A♭ octave 4</td></tr><tr><td><code>QK_MIDI_NOTE_A_4</code></td><td><code>MI_A4</code></td><td>A octave 4</td></tr><tr><td><code>QK_MIDI_NOTE_A_SHARP_4</code></td><td><code>MI_As4</code>, <code>MI_Bb4</code></td><td>A♯/B♭ octave 4</td></tr><tr><td><code>QK_MIDI_NOTE_B_4</code></td><td><code>MI_B4</code></td><td>B octave 4</td></tr><tr><td><code>QK_MIDI_NOTE_C_5</code></td><td><code>MI_C5</code></td><td>C octave 5</td></tr><tr><td><code>QK_MIDI_NOTE_C_SHARP_5</code></td><td><code>MI_Cs5</code>, <code>MI_Db5</code></td><td>C♯/D♭ octave 5</td></tr><tr><td><code>QK_MIDI_NOTE_D_5</code></td><td><code>MI_D5</code></td><td>D octave 5</td></tr><tr><td><code>QK_MIDI_NOTE_D_SHARP_5</code></td><td><code>MI_Ds5</code>, <code>MI_Eb5</code></td><td>D♯/E♭ octave 5</td></tr><tr><td><code>QK_MIDI_NOTE_E_5</code></td><td><code>MI_E5</code></td><td>E octave 5</td></tr><tr><td><code>QK_MIDI_NOTE_F_5</code></td><td><code>MI_F5</code></td><td>F octave 5</td></tr><tr><td><code>QK_MIDI_NOTE_F_SHARP_5</code></td><td><code>MI_Fs5</code>, <code>MI_Gb5</code></td><td>F♯/G♭ octave 5</td></tr><tr><td><code>QK_MIDI_NOTE_G_5</code></td><td><code>MI_G5</code></td><td>G octave 5</td></tr><tr><td><code>QK_MIDI_NOTE_G_SHARP_5</code></td><td><code>MI_Gs5</code>, <code>MI_Ab5</code></td><td>G♯/A♭ octave 5</td></tr><tr><td><code>QK_MIDI_NOTE_A_5</code></td><td><code>MI_A5</code></td><td>A octave 5</td></tr><tr><td><code>QK_MIDI_NOTE_A_SHARP_5</code></td><td><code>MI_As5</code>, <code>MI_Bb5</code></td><td>A♯/B♭ octave 5</td></tr><tr><td><code>QK_MIDI_NOTE_B_5</code></td><td><code>MI_B5</code></td><td>B octave 5</td></tr><tr><td><code>QK_MIDI_OCTAVE_N2</code></td><td><code>MI_OCN2</code></td><td>Set octave to -2</td></tr><tr><td><code>QK_MIDI_OCTAVE_N1</code></td><td><code>MI_OCN1</code></td><td>Set octave to -1</td></tr><tr><td><code>QK_MIDI_OCTAVE_0</code></td><td><code>MI_OC0</code></td><td>Set octave to 0</td></tr><tr><td><code>QK_MIDI_OCTAVE_1</code></td><td><code>MI_OC1</code></td><td>Set octave to 1</td></tr><tr><td><code>QK_MIDI_OCTAVE_2</code></td><td><code>MI_OC2</code></td><td>Set octave to 2</td></tr><tr><td><code>QK_MIDI_OCTAVE_3</code></td><td><code>MI_OC3</code></td><td>Set octave to 3</td></tr><tr><td><code>QK_MIDI_OCTAVE_4</code></td><td><code>MI_OC4</code></td><td>Set octave to 4</td></tr><tr><td><code>QK_MIDI_OCTAVE_5</code></td><td><code>MI_OC5</code></td><td>Set octave to 5</td></tr><tr><td><code>QK_MIDI_OCTAVE_6</code></td><td><code>MI_OC6</code></td><td>Set octave to 6</td></tr><tr><td><code>QK_MIDI_OCTAVE_7</code></td><td><code>MI_OC7</code></td><td>Set octave to 7</td></tr><tr><td><code>QK_MIDI_OCTAVE_DOWN</code></td><td><code>MI_OCTD</code></td><td>Move down an octave</td></tr><tr><td><code>QK_MIDI_OCTAVE_UP</code></td><td><code>MI_OCTU</code></td><td>Move up an octave</td></tr><tr><td><code>QK_MIDI_TRANSPOSE_N6</code></td><td><code>MI_TRN6</code></td><td>Set transposition to -6 semitones</td></tr><tr><td><code>QK_MIDI_TRANSPOSE_N5</code></td><td><code>MI_TRN5</code></td><td>Set transposition to -5 semitones</td></tr><tr><td><code>QK_MIDI_TRANSPOSE_N4</code></td><td><code>MI_TRN4</code></td><td>Set transposition to -4 semitones</td></tr><tr><td><code>QK_MIDI_TRANSPOSE_N3</code></td><td><code>MI_TRN3</code></td><td>Set transposition to -3 semitones</td></tr><tr><td><code>QK_MIDI_TRANSPOSE_N2</code></td><td><code>MI_TRN2</code></td><td>Set transposition to -2 semitones</td></tr><tr><td><code>QK_MIDI_TRANSPOSE_N1</code></td><td><code>MI_TRN1</code></td><td>Set transposition to -1 semitone</td></tr><tr><td><code>QK_MIDI_TRANSPOSE_0</code></td><td><code>MI_TR0</code></td><td>No transposition</td></tr><tr><td><code>QK_MIDI_TRANSPOSE_1</code></td><td><code>MI_TR1</code></td><td>Set transposition to +1 semitone</td></tr><tr><td><code>QK_MIDI_TRANSPOSE_2</code></td><td><code>MI_TR2</code></td><td>Set transposition to +2 semitones</td></tr><tr><td><code>QK_MIDI_TRANSPOSE_3</code></td><td><code>MI_TR3</code></td><td>Set transposition to +3 semitones</td></tr><tr><td><code>QK_MIDI_TRANSPOSE_4</code></td><td><code>MI_TR4</code></td><td>Set transposition to +4 semitones</td></tr><tr><td><code>QK_MIDI_TRANSPOSE_5</code></td><td><code>MI_TR5</code></td><td>Set transposition to +5 semitones</td></tr><tr><td><code>QK_MIDI_TRANSPOSE_6</code></td><td><code>MI_TR6</code></td><td>Set transposition to +6 semitones</td></tr><tr><td><code>QK_MIDI_TRANSPOSE_DOWN</code></td><td><code>MI_TRSD</code></td><td>Decrease transposition</td></tr><tr><td><code>QK_MIDI_TRANSPOSE_UP</code></td><td><code>MI_TRSU</code></td><td>Increase transposition</td></tr><tr><td><code>QK_MIDI_VELOCITY_0</code></td><td><code>MI_VL0</code></td><td>Set velocity to 0</td></tr><tr><td><code>QK_MIDI_VELOCITY_1</code></td><td><code>MI_VL1</code></td><td>Set velocity to 12</td></tr><tr><td><code>QK_MIDI_VELOCITY_2</code></td><td><code>MI_VL2</code></td><td>Set velocity to 25</td></tr><tr><td><code>QK_MIDI_VELOCITY_3</code></td><td><code>MI_VL3</code></td><td>Set velocity to 38</td></tr><tr><td><code>QK_MIDI_VELOCITY_4</code></td><td><code>MI_VL4</code></td><td>Set velocity to 51</td></tr><tr><td><code>QK_MIDI_VELOCITY_5</code></td><td><code>MI_VL5</code></td><td>Set velocity to 64</td></tr><tr><td><code>QK_MIDI_VELOCITY_6</code></td><td><code>MI_VL6</code></td><td>Set velocity to 76</td></tr><tr><td><code>QK_MIDI_VELOCITY_7</code></td><td><code>MI_VL7</code></td><td>Set velocity to 89</td></tr><tr><td><code>QK_MIDI_VELOCITY_8</code></td><td><code>MI_VL8</code></td><td>Set velocity to 102</td></tr><tr><td><code>QK_MIDI_VELOCITY_9</code></td><td><code>MI_VL9</code></td><td>Set velocity to 114</td></tr><tr><td><code>QK_MIDI_VELOCITY_10</code></td><td><code>MI_VL10</code></td><td>Set velocity to 127</td></tr><tr><td><code>QK_MIDI_VELOCITY_DOWN</code></td><td><code>MI_VELD</code></td><td>Decrease velocity</td></tr><tr><td><code>QK_MIDI_VELOCITY_UP</code></td><td><code>MI_VELU</code></td><td>Increase velocity</td></tr><tr><td><code>QK_MIDI_CHANNEL_1</code></td><td><code>MI_CH1</code></td><td>Set channel to 1</td></tr><tr><td><code>QK_MIDI_CHANNEL_2</code></td><td><code>MI_CH2</code></td><td>Set channel to 2</td></tr><tr><td><code>QK_MIDI_CHANNEL_3</code></td><td><code>MI_CH3</code></td><td>Set channel to 3</td></tr><tr><td><code>QK_MIDI_CHANNEL_4</code></td><td><code>MI_CH4</code></td><td>Set channel to 4</td></tr><tr><td><code>QK_MIDI_CHANNEL_5</code></td><td><code>MI_CH5</code></td><td>Set channel to 5</td></tr><tr><td><code>QK_MIDI_CHANNEL_6</code></td><td><code>MI_CH6</code></td><td>Set channel to 6</td></tr><tr><td><code>QK_MIDI_CHANNEL_7</code></td><td><code>MI_CH7</code></td><td>Set channel to 7</td></tr><tr><td><code>QK_MIDI_CHANNEL_8</code></td><td><code>MI_CH8</code></td><td>Set channel to 8</td></tr><tr><td><code>QK_MIDI_CHANNEL_9</code></td><td><code>MI_CH9</code></td><td>Set channel to 9</td></tr><tr><td><code>QK_MIDI_CHANNEL_10</code></td><td><code>MI_CH10</code></td><td>Set channel to 10</td></tr><tr><td><code>QK_MIDI_CHANNEL_11</code></td><td><code>MI_CH11</code></td><td>Set channel to 11</td></tr><tr><td><code>QK_MIDI_CHANNEL_12</code></td><td><code>MI_CH12</code></td><td>Set channel to 12</td></tr><tr><td><code>QK_MIDI_CHANNEL_13</code></td><td><code>MI_CH13</code></td><td>Set channel to 13</td></tr><tr><td><code>QK_MIDI_CHANNEL_14</code></td><td><code>MI_CH14</code></td><td>Set channel to 14</td></tr><tr><td><code>QK_MIDI_CHANNEL_15</code></td><td><code>MI_CH15</code></td><td>Set channel to 15</td></tr><tr><td><code>QK_MIDI_CHANNEL_16</code></td><td><code>MI_CH16</code></td><td>Set channel to 16</td></tr><tr><td><code>QK_MIDI_CHANNEL_DOWN</code></td><td><code>MI_CHND</code></td><td>Decrease channel</td></tr><tr><td><code>QK_MIDI_CHANNEL_UP</code></td><td><code>MI_CHNU</code></td><td>Increase channel</td></tr><tr><td><code>QK_MIDI_ALL_NOTES_OFF</code></td><td><code>MI_AOFF</code></td><td>Stop all notes</td></tr><tr><td><code>QK_MIDI_SUSTAIN</code></td><td><code>MI_SUST</code></td><td>Sustain</td></tr><tr><td><code>QK_MIDI_PORTAMENTO</code></td><td><code>MI_PORT</code></td><td>Portmento</td></tr><tr><td><code>QK_MIDI_SOSTENUTO</code></td><td><code>MI_SOST</code></td><td>Sostenuto</td></tr><tr><td><code>QK_MIDI_SOFT</code></td><td><code>MI_SOFT</code></td><td>Soft Pedal</td></tr><tr><td><code>QK_MIDI_LEGATO</code></td><td><code>MI_LEG</code></td><td>Legato</td></tr><tr><td><code>QK_MIDI_MODULATION</code></td><td><code>MI_MOD</code></td><td>Modulation</td></tr><tr><td><code>QK_MIDI_MODULATION_SPEED_DOWN</code></td><td><code>MI_MODD</code></td><td>Decrease modulation speed</td></tr><tr><td><code>QK_MIDI_MODULATION_SPEED_UP</code></td><td><code>MI_MODU</code></td><td>Increase modulation speed</td></tr><tr><td><code>QK_MIDI_PITCH_BEND_DOWN</code></td><td><code>MI_BNDD</code></td><td>Bend pitch down</td></tr><tr><td><code>QK_MIDI_PITCH_BEND_UP</code></td><td><code>MI_BNDU</code></td><td>Bend pitch up</td></tr></tbody></table><h3 id="configuration" tabindex="-1">Configuration <a class="header-anchor" href="#configuration" aria-label="Permalink to &quot;Configuration&quot;"></a></h3><p>Certain values are stored in the <code>midi_config</code> struct. This configuration is not persisted to EEPROM. By default, these values are:</p><table><thead><tr><th>Configuration</th><th>Value</th><th>Comments</th></tr></thead><tbody><tr><td>Octave</td><td><code>4</code></td><td>Corresponds to <code>MI_OC2</code></td></tr><tr><td>Transposition</td><td><code>0</code></td><td></td></tr><tr><td>Velocity</td><td><code>127</code></td><td></td></tr><tr><td>Channel</td><td><code>0</code></td><td></td></tr><tr><td>Modulation Interval</td><td><code>8</code></td><td></td></tr></tbody></table><p>For the above, the <code>MI_C</code> keycode will produce a C3 (note number 48), and so on.</p><h3 id="references" tabindex="-1">References <a class="header-anchor" href="#references" aria-label="Permalink to &quot;References&quot;"></a></h3><h4 id="midi-specification" tabindex="-1">MIDI Specification <a class="header-anchor" href="#midi-specification" aria-label="Permalink to &quot;MIDI Specification&quot;"></a></h4><ul><li><a href="https://www.midi.org/specifications-old/item/table-1-summary-of-midi-message" target="_blank" rel="noreferrer">MIDI.org</a></li><li><a href="https://www.cs.cmu.edu/~music/cmsip/readings/MIDI%20tutorial%20for%20programmers.html" target="_blank" rel="noreferrer">CMU MIDI Programmer&#39;s Reference</a></li></ul><h4 id="qmk-c-files" tabindex="-1">QMK C Files <a class="header-anchor" href="#qmk-c-files" aria-label="Permalink to &quot;QMK C Files&quot;"></a></h4><ul><li><code>quantum/process_keycode/process_midi.c</code></li><li><code>quantum/quantum_keycodes.h</code></li><li><code>quantum/midi/midi.h</code></li><li><code>quantum/midi/midi.c</code></li><li><code>quantum/midi/qmk_midi.c</code></li><li><code>quantum/midi/midi_device.h</code></li></ul>', 30);
const _hoisted_31 = [
_hoisted_1
];
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", null, _hoisted_31);
}
const midi = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
export {
__pageData,
midi as default
};