Skip to main content

MIDI implementation

Meiji Sampler’s MIDI surface covers control mapping, a live monitor, and optional transport response.

Input device discovery

Input ports are opened at startup. To discover a controller connected during a session, open Settings → MIDI → Devices and press [R] ([RESCAN]). Discovery runs in the background, opens new inputs, keeps existing connections, and removes inputs that are no longer present. Saved device-scoped and global mappings are not changed by a rescan. New inputs feed both MIDI Mapping and Monitor. The list reports detected ports even if another application prevents a port from opening. A completion with unavailable inputs reports their count; check the connection and competing software, then rescan. An enumeration failure leaves the previous device list and working connections intact.

Embedded bank capacity

Builds with the extended-banks feature provide sixteen sample channels, loop slots, scene slots, and chop markers. The desktop build keeps ten slots and its [1] through [9], [0] keyboard shortcuts. Desktop bank rows still correspond to those ten digit keys when an embedded build is opened in a terminal. The extended build loads ten-slot sessions by preserving their existing positions and leaving the extra slots empty. Sixteen-slot scene masks and chop-marker arrays require an extended build; a ten-slot build rejects those arrays rather than silently truncating them. Keep a separate copy when sharing projects between builds. Perform already stores two banks of ten bindings. Its persisted bank and MIDI slot identities are unchanged; hardware can address sixteen of these bindings without changing the desktop bank model. The loop event grid scrolls to keep the selected track visible when the display cannot show every track. Embedded hosts can pass each hit’s velocity through sample and chop playback, queued decoding or stretching, loop recording, and scheduled replay. Digit keys keep full velocity. Hardware listening volume is applied after master capture, so turning it down does not turn down an exported bounce. Metronome clicks follow that listening level and remain outside bounce and resample captures. Hosts can also adjust an active or queued Perform effect’s wet mix without restarting its capture or envelope. Lazy chop placement reads the original source-frame position directly, avoiding a normalized floating-point round trip when recording a live marker.

Standalone MPC Sample profile

The pad mixer includes a scrolling Stem selector: A Pads [B3] Mix, [B2] Next, [DATA] / [B3] Edit, [−] / [+] value, [B1] Back. Pad detail shows the selected stem and preparation status. See stem separation. Tempo adjustments are limited to 1–999.99 BPM. Exit, shutdown, and USB updates save before stopping ordinary playback. If a save fails, Meiji remains open and playback continues; a loop take finalized for shutdown remains available in the session for another save attempt. Complete or close input recordings first. The mpc-sample build uses the MPC’s 320 × 240 display and physical controls, with sixteen slots in each musical bank. The prepared SD contains the full Meiji Factory Packs catalog for offline browsing. This profile is undergoing physical acceptance; emulator results do not establish hardware latency or routing. Hardware action results show a centered toast for 500 ms. Count-In shows COUNT-IN: ON with its selected mode, or COUNT-IN: OFF; Metronome shows its on/off state, and Undo reports its result. Longer results wrap across two lines. Each new result replaces the previous toast. Releasing a modifier does not erase the result. The existing desktop toast timing is unchanged. Turning [DATA] to move a menu or list selection does not show a generic control toast. Ordinary pad hits and aftertouch also omit generic bank, pad-number, and pressure acknowledgments. K1/K2/K3 and Main Volume adjustments also omit routine toasts; parameter values and pickup guidance remain on the screen. Other action results, modifier actions, and errors retain their messages. Native dialog titles use uppercase text. Mixer parameter labels use title case, and hotkeys are orange. Input selection, quantize, and bounce use the same bordered dialog layout as the project and sample pickers. Confirmation questions appear in the center of the dialog. In recording, [SHIFT+B2] toggles input monitoring; [B2] opens the input picker. Monitoring starts off and the microphone requires a detected headphone or lineout. [SHIFT+B3] toggles the session-only USB audio bridge after gadget verification. Select UAC2_Gadget in the input picker for host-to-device recording. The post-effects master feeds the host separately from input monitoring. The bridge requires the verified stereo 44.1 kHz profile; unknown devices fail closed. The recording screen shows INPUT READY before arming. Its LEVEL meter shows the input signal, T marks the recording threshold, and P marks the peak level. Input-recording and loop/transport count-ins fill the display with ANSI block art in cyan, teal, gray, and yellow on black. The digits and Go share a centered scale with at least 10% margins. The configured count-in length is preserved. Go appears for 500 ms after recording or playback successfully starts, without delaying audio. Cancellation and failed starts return to the regular view; blocking dialogs retain priority. Hold [SHIFT] outside Chop to show all sixteen printed pad functions. All printed functions reach their available actions. EDIT identifies related trim-bound and Sync Stretch controls. Actions target the previously selected loop or sample, across banks. HALF/DOUBLE SEQ preserve the selected loop and playback state. Finish or cancel its take before changing its length. [SHIFT+−] undoes sequence edits. REC QUANTIZE is independent of TIME CORRECT: it commits corrected positions for new hits, preserving earlier takes and their playback quantization settings. Its saved grid defaults to 1/16 when the grid is Off; swing is straight and shift is zero. Armed and active takes retain their policy until completion. Auto Tempo first takes use their finalized musical timing; overdubs correct incoming hits. The original off-grid performance is not retained by this recording-only policy. TIME CORRECT remains independently reversible. Its native shortcut stages fields until Apply; the existing loop-editor quantize page continues to apply edits live. Fader assignments persist in settings and require pickup at the new parameter value after a target/channel change. [B1] cancels assignment; [B3] saves it. Browse retains folder jumping and Perform retains wet control. Sync Stretch requires a session clock and loop playback; it does not force loop mode. Sync Off uses ordinary pitch/speed playback, without tempo-following varispeed. SONG supports ordered scene references, per-entry repeats and finite termination. See song controls and flattening, sequence speed and resampling. [SHIFT+SAMPLE] opens analog input selection. Choose Microphone or Rear TRS with [DATA], then request the change with [B3]. Applied state changes only after the native hardware adapter succeeds. Monitoring is controlled from the recording view with [SHIFT+B2], subject to the microphone/headphone safety interlock. MIDI CONFIG stores independent input, output, Thru, transport/program and clock opt-ins in preferences. All default off, channel 10, base note 36, with no selected ports. [DATA] moves through the scrolling fields; [−] / [+] changes them. Select input and output explicitly. Panel Control Surface ports and ambiguous duplicate identities are refused. ALSA client renumbering reconnects only a unique matching name and endpoint number; it never chooses another device. Discovery refreshes every two seconds. Same-endpoint input/output routing is refused to avoid feedback; use distinct endpoints and avoid external cable/software loopbacks. Input preserves velocity and bypasses panel bank/modifier/browser actions. Samples retain ordinary one-shot/loop behavior; incoming NoteOff does not stop shared sample voices. Start/Stop and Program-to-Loop remain separate opt-ins. Programs 0–15 select or cue existing sequences, without toggling repeated selections or arming empty slots. No held-sample gate engine is implied; see the separate sequencing/gate work.

Musical output and safe Thru

Enable Output and choose its port. Confirmed pad audio admissions, including sequenced and SONG hits and delayed decode/stretch/stem completions, send the configured channel and base-note-plus-pad with actual hit velocity. Empty targets, sequence/track mute masks, cancelled or failed admissions emit no generated notes. Mixer gain and listening volume do not scale MIDI velocity. Each generated one-shot MIDI note has an explicit 50 ms gate, independent of audio duration and project BPM. Retrigger releases the previous generated note before NoteOn. Stopping a pad releases its generated note; transport stop, replacement, disconnect, overflow and shutdown attempt all owned NoteOffs plus sustain-off and All Notes Off on touched channels. A disconnected cable cannot guarantee delivery; release/panic failures are shown and require receiver-side recovery if necessary. Thru is an independent opt-in forwarding validated channel messages unchanged, including channel and velocity. SysEx, panel traffic and realtime clock/transport never pass through Thru. External input never also generates mapped output notes, including when its audio decode is delayed. A Thru-held pitch owns that pitch until its external release (or channel All Notes Off); an earlier generated note is released before Thru takes ownership; an overlapping generated hit is suppressed and its short gate cannot cut off the held note. Overflow uses an independent panic signal; output stops until a configuration change rearms it.

Clock master and F8 follower

Clock has one owner: Off, Master or Follower. Master requires a known project BPM; it does not invent a tempo for an empty Auto project. Master sends 24 F8 pulses per quarter note, from the musical worker independently of display redraws. Local Play starts at a new beginning (FA); Stop sends FC. [SHIFT+PLAY] pauses and resumes a preserved sequence phase (FB). A normal Stop clears that preserved phase. Continue refuses missing or edited/project-replaced phase. Tempo changes preserve the fraction of the next pulse; a stall exceeding four overdue pulses stops output instead of sending an unbounded burst. Reconnected outputs require local Stop/Play for Master or a fresh external Start for Follower. Failed owned releases are retried on the same unique endpoint before new output is admitted; cable loss can still require receiver-side panic. Follower accepts FA/FB/FC and timestamped F8, with no clock echo. It acquires a stable quarter-note window (24 intervals) before launching. The initial acquisition is silent: playback then joins the external pulse phase and skips elapsed notes, instead of replaying history. Every accepted pulse reanchors the existing audio scheduler; the worker does not add another sequence engine. Start joins from the external beginning; Continue adds pulse progress to the preserved sequence/scene phase. Changing the project, scene definition, sequence content or blocked route refuses Continue explicitly. Pending scene transitions, capture or a completed take cannot supply a preserved phase; send Start. Clock faults/loss invalidate Continue. Follower tempo supports 1–999.99 BPM, rounded at MIDI’s microsecond timestamp resolution; timeout adapts to the pulse interval (at least 500 ms, up to 7.5 seconds at 1 BPM). Invalid rate, lost input or queue overflow stops local transport through an independent stop latch. Native local Play and manual tempo changes are refused while Follower owns timing. Disabling Follower retains the last acquired project BPM. There is no Song Position Pointer or MTC support. External receiver, USB/TRS replug, drift and jitter measurements remain physical acceptance work; software tests do not establish hardware timing quality.

Physical Sync Out discovery

The Sync field performs read-only interface inventory and explicitly refuses pulse output. Published source identifies the musical UART but does not identify Sync Out ownership, polarity or timing. Candidate GPIO/PWM interfaces are not permission to drive a pin. No pulse scheduler, voltage calibration or guessed GPIO writes are implemented. Physical acceptance requires correlating a stock Sync enable/base/division change with read-only driver/interface evidence and isolated scope measurements of voltage, polarity, idle state, pulse width, audio alignment and long-run jitter before any output adapter is authorized. Hold [ERASE] to keep a PRESS PAD TO ERASE prompt visible until release. It names the current target: pad, loop, scene, effect, chop, or a track in the loop editor. [MUTE] keeps the corresponding mute prompt visible (or PRESS EFFECT TO STOP in Perform). [NOTE REPEAT] prompts for a pad or chop on the sample bank. While chopping, [SHIFT] acts like [ERASE]: hold either for PRESS CHOP TO ERASE, then press a chop pad to erase its marker in the current view. The result names the physical pad, such as CHOP 1 ERASED. Auditioning an existing chop does not show a routine marker-playback toast; playback errors remain visible. Confirmations, input and project pickers, recording, and bounce screens take priority over held prompts. A result or error temporarily replaces the prompt for 500 ms; the prompt returns if the action is still held. Releasing the button clears its prompt without dismissing a later result, so you can act on several pads during one hold. Start with [SAMPLE SELECT]. Browse automatically previews the first highlighted sample and each newly selected sample. Turn [DATA] to step through entries, or move the [PAD VOL] fader to jump through the current folder. The top selects the first entry, including [..]; the bottom selects the last entry. Its 128 reported positions snap to the nearest entry. In longer folders, [DATA] reaches entries between fader positions. Browse fader movement leaves channel gain unchanged and keeps the list visible without a control toast. Press [DATA] or [B3] to open a folder or assign a sample to the selected pad and return to bank A. Selecting [..] goes to the parent folder, like [B1], and stays inside the SD card. [B2] immediately cuts off and restarts the selected preview, including while it is playing. A physical pad assigns the selected file to that pad and returns to bank A. On a blank pad in bank A, [DATA] opens Browse for that pad. On a loaded pad it opens the editor. Turn [DATA] in the bank to select any slot without playing it. Selection stops silently at slots 1 and 16 without wrapping, including the source-pad selection in chop performance. [SHIFT+PAD] invokes the printed function; use [DATA] to select without invoking a shortcut.

Selected slot details

A Pads, B Loops, and C Scenes open with details of the selected slot. Press the same bank button again for the sixteen-slot index. Hitting a physical pad or turning [DATA] moves the selection in either view. Turning [DATA] selects without playing. Returning with a bank button from another bank or an editor opens detail; [B1] returns from an editor to its previous bank view. Pad detail shows the cached waveform, trim bounds, chop markers, playback mode, gate, loop-end behavior, trimmed length, linked/copied settings, and mix values. Loop detail shows transport progress, event lanes, length, quantization, swing, and scenes containing the loop. Up to five active tracks fit; [B2] opens the full sequence editor when more tracks are present. Scene detail shows member loops in physical pad order, repeat progress, total duration, and the effective follow action. A missing next scene means STOP. The small numbered map keeps all sixteen slots visible, with pads 13 to 16 at the top. Detail values are read-only. [B2] opens the existing editor; [B3] opens Mix or captures the playing loops into a scene. Empty slots show their next action. An uncached sample shows a load hint, and a missing sample keeps its settings and offers Browse. [SHIFT], chop performance, and [16 LEVELS] show their action grids. D Perform uses its index. Detail/index choices reset on restart and require no project conversion. K1/K2/K3 labels sit along the bottom edge, aligned left, center, and right with their physical knobs. Their K1/K2/K3 identifiers are orange, with title-case parameter names such as Wet, Attack, and Release. The selected pad’s border, number, and name are white in every bank, with a matching white physical pad. Other sample pads reuse their saved channel color, including the color assigned when loading a sample; pads without a saved color use their sample-type color. Chops and 16 Levels use the source sample’s color. Loops, scenes, and effects use the same slot palettes as the main sampler. Mute, recording, queue, and missing-file indicators keep their status colors. Bank tempo appears beside the selected slot name and shows AUTO BPM until a tempo is set or inferred. Project, mixer, SD access, and confirmation screens use bordered dialogs; the Project dialog includes the current session name. Screens omit the branding/session/BPM footer. Chop controls remain on the bottom row in both the editor and pad view. Power and clear confirmations keep their actions at the top and leave the lower two rows clear. Sample assignment, Project Load, and FX selection share a bordered picker. Sample assignment names the destination in its border, such as Assign to Pad A1, and keeps folder navigation, preview, and fader scrolling. Project and FX lists stay within their inventories, with no parent-folder entry. Picker status uses the bottom row, leaving more room for the list. K1/K2/K3 and the fader follow the labels on the current screen. In the pad bank, they control pitch, low-pass filter, reverb, and channel gain. Main volume changes listening level; exports retain the musical mix level. B1/B2/B3 always follow the three top-edge actions. The loop editor supports track mute, erase, and quantization; the scene editor uses all sixteen pads to include or exclude loops. In the loop editor, a pad selects its track, [DATA] starts or finishes moving a note, and [−] / [+] moves it. Hold [SHIFT] for fine movement. [B3] deletes the selected note; clearing all tracks requires confirmation. [KNOB FX] closes the editor before showing channel controls. Held note-repeat is paused during bounce capture. In CHOP, placing or auditioning a marker highlights its pad in white on the screen and physical surface. Other set markers remain lit in the source sample’s color; unset or erased markers are unlit. The physical pad order follows the sixteen chop markers. [ERASE+PAD] or [SHIFT+PAD] clears that pad’s marker in both the CHOP editor and chop performance, preserving the current view, assigned source sample, and playback. The Shift shortcut takes precedence over all sixteen global functions while chopping; use [SHIFT+STOP] for Project without clearing a chop. Holding [SHIFT] pauses note repeat so held pads cannot retrigger shortcuts. In the CHOP editor, each encoder detent moves the playhead by 0.4% of the source; hold [SHIFT] for 0.15% steps. During playback, hit an empty pad to place its marker at the current source position. To dial in a sample’s beginning by ear, hold [PLAY] and turn [DATA]. Each repeat starts at the saved START point, including changes made with [K1]. To edit one chop, hold its physical pad and turn [DATA]; each repeat starts at that chop’s saved marker. In either hold, [DATA] edits by 0.4% of the source per detent, or 0.15% with [SHIFT], rounded to whole samples. START stays before END, and chop markers stay within the source. Playback progress does not move these saved points. Linked samples share the edits; copied samples retain their own overrides. The latest held Play or chop pad chooses which point [DATA] edits. Releasing that control ends retriggering and continues its latest audition; [DATA] then returns to its normal cursor or source-selection role. A quick Play tap starts ordinary playback. [NOTE REPEAT] keeps its musical cadence for held pads. Stop, leaving the Chop view, changing its sample, or opening a blocking dialog cancels future repeats. [SAMPLE] preserves the playing chop while returning to the normal pad view. PROJECT → SD access via Akai saves the Meiji session and returns to Akai. In Akai, open [SHIFT+PAD 16] → SD Card Access. Transfer files, safely eject the card on the computer, then press Akai [B1]. On the paired Mac, run mise run mpc-sample:device -- launch to resume Meiji with the saved session. A normal transfer needs no reboot. To resume without the Mac helper, finish ejection and Akai [B1] first, then power off and back on. A cold boot requires fresh USB pairing. Meiji’s direct export remains disabled. See SD recovery. Knobs and the pad-volume fader use pickup when controlling musical parameters. Move through the saved parameter’s position before adjusting it; a highlighted PICKUP hint gives the direction. Changing the selected channel/effect or editing the value with another control rearms pickup. Browse fader navigation applies immediately; returning to the pad bank rearms channel-gain pickup. Main volume applies immediately. Controls without a parameter on the current browser, editor, or dialog leave the musical mix intact. During a native export, the screen shows progress. [B1] or [STOP] cancels; main volume adjusts listening level. The musical controls resume when the export finishes or is cancelled. Projects, recordings, bounces, configuration, and restored session state remain under Meiji/State on the SD. Factory samples remain under Meiji/Packs. A normal exit saves session state and pending Perform settings, then restores stock firmware. A separate supervisor restores stock after a native-process failure. Use Exit to stock before removing the SD; wait for the stock screen before using stock controls. If the native audio output fails or its sample clock stalls for three seconds, Meiji saves session state and exits to the stock supervisor. Unkept audio-input recordings still require the recording workflow’s Keep action. To skip Meiji on boot, create an empty DISABLE_MODS file in the SD root or rename its autorun folder. Booting without the card also starts stock firmware.

First Loop Setup

When all loops are empty and no timing source exists, [SEQ REC] opens First Loop Setup for the selected loop. Pressing an empty pad in B Loops opens it for that pad’s loop. The destination stays selected throughout setup. Turn [DATA] to select a field and use [−] / [+] to change its value. Hold [SHIFT] for 0.01 BPM tempo steps instead of 1 BPM. [TAP TEMPO] works from any field, sounds a click, selects Tempo, and returns Mode to FIXED TEMPO. Press [DATA], [SEQ REC], or [B3] to confirm recording. [B1] or [STOP] cancels without arming. Pads and other navigation are blocked while setup is open; Main Volume still adjusts listening level. Choose FIXED TEMPO to keep a known BPM. A fixed bar Length ends the first take automatically and continues into overdub. With Length AUTO, press [SEQ REC] to finish the take yourself; the chosen BPM is retained as overdub begins. Choose AUTO TEMPO to let the end of the first take establish tempo. Confirming this mode clears the manual BPM and fixed bar length. Press [SEQ REC] to finish the take; Meiji Sampler infers tempo and continues into overdub. Quantize, Count-in, and Click still apply in this mode. After confirming either mode, [PLAY] or a sample/chop pad in A Pads starts the chosen Count-in. Large digits lead to Go as recording starts. The pad or chop that starts the countdown plays immediately. During count-in, only hits in the final beat are recorded on the downbeat at 0:00; with a one-beat count-in, this includes the starting hit. Auto Tempo counts in at the tempo prepared in setup, using the current tempo when setup opens or 90.00 BPM when unset. This guides the countdown without setting project BPM; ending the first take still determines the project tempo. The chosen Count-in length and Click mode are saved with the metronome settings. Once a timing source exists, later loops skip setup and share the session’s synchronized subdivisions and multiples. Overdubbing keeps the existing loop length. See Loop for the shared recording behavior.

Control identification

Each MIDI control is uniquely identified by three properties: A CC on channel 1 number 60 and a Note on channel 1 number 60 are treated as two separate controls.

Mapping behavior

Mappings allow multiple controls to share an action:
  • One control maps to at most one action.
  • One action can be assigned to multiple controls, each with its own behavior settings.
When you move a control that already has a mapping, MIDI Learn returns to the Listening list, selects that mapping row, and briefly shows already mapped. Press [ENTER] on the selected row to edit that control’s assignment. Assigning an action used by another control preserves both mappings. The Mapping list has one row per control, grouped by action and ordered by scope, channel, message type, and number within each action. [DEL] removes only the selected row. The action picker shows one control label or a count such as [2 controls]. Manual MIDI Learn creates global mappings identified by channel, message type, and number. Identical messages from different devices share the same global mapping. Device-scoped automap assignments take precedence over global mappings for that device. Mappings are persisted in the settings file and survive app restarts. After assigning a trigger action, MIDI Learn preselects the next matching trigger target for the next unmapped control: Pad, loop, scene, and chop indices stop at the final display slot, 0. Non-trigger actions keep the exact last assigned action as the next preselected action.

Mappable actions

Transport

Pads

Pad slots use display numbering 1-9 then 0 (matching the keyboard number row).

Loops

Scenes

Mixer

Keypress

PerformFX

These actions are available when the PerformFX feature is enabled.

MIDI learn flow phases

The learn flow uses these phases and capture states:

Trigger behavior

Each mapping carries a Behavior that decides how the control’s value drives the action. Both behaviors carry a threshold (1-127, default 64) and an inverted flag (default false).
  • Note triggers default to Trigger { threshold: 1 }. Note On velocity 0 and Note Off are forwarded as value 0, so stateful actions such as PerformFX Hold slots and mapped FX Library presets receive a falling edge.
  • CC value 0 is forwarded to the app (it is the falling-edge signal for Gate). Gate mappings will not act on a Recording / Armed loop slot to protect takes in progress.
  • Mappings loaded from configs saved before this version load with Trigger { threshold: 1 } so existing projects keep their prior behavior.

MIDI tab shortcuts

Mappings sub-view (Listening phase)

Mappings sub-view (Assigning phase)

Mappings sub-view (Keypress capture)

Mappings sub-view (Editing Behavior step)

Sub-tab navigation

MIDI transport

The settings include a transport_enabled toggle. When disabled, transport messages are visible in the monitor but do not trigger transport behavior.

Monitor coverage

The MIDI monitor displays all incoming MIDI events, not just mapping-eligible ones. Visible message types:
  • Note Off, Note On, Poly Pressure
  • Control Change, Program Change, Channel Pressure, Pitch Bend
  • Clock, Start, Stop, Continue
  • Active Sensing, SysEx, Unknown
Clock and Active Sensing generate high message volume and can flood the display. Use monitor filters to suppress them unless diagnosing a sync problem.

Route allowlist

MIDI mappings use two route rules:
  • Keypress mappings replay the captured key through the normal key handler after the MIDI control is resolved. They work anywhere the same keyboard key would work, including the Trim/chop editor and other focused modal or view states. The MIDI Mapping assignment page still blocks mapped-controller actions while it is learning a control.
  • Direct app-action mappings use a conservative allowlist so pad, loop, scene, transport, and mixer actions cannot silently dismiss stateful UI.
The direct-action allowlist is: New modal or view variants added to the codebase are blocked by default. New Channel variants require an explicit allow or block decision at compile time.
If a direct app-action mapping does nothing, check whether the current view is on this allowlist. If a keypress mapping does nothing, verify that the same physical key works in the current UI state. See MIDI And Sync Problems for more.

Current caution

The public marketing copy still describes MIDI controller support as emerging. Use this page as the implementation reference, not as a promise of broader DAW-style MIDI coverage. The experimental MPC Sample runtime checks the device model and mixer controls before enabling the physical audio profile. It requires a 44.1 kHz, two-channel stock PCM stream. A different channel count is refused until the live routing is verified. Speaker, headphone and lineout mapping and quiet transitions require physical measurement. This conservative restriction can prevent startup on a previously working four-channel stock profile. Published codec capabilities do not establish the complete live audio route.