← UniPack

keySound

The keySound file maps sound files to each button. Write one mapping per line, separated by spaces.

Syntax

chain  x  y  soundFile  [loop]  [wormhole]
FieldTypeRequiredDescription
chainintOChain number (1 ~ chain)
xintOButton X coordinate (1 ~ buttonX)
yintOButton Y coordinate (1 ~ buttonY)
soundFilestringOFile path within sounds/ folder
loopintLoop setting (see below)
wormholeintChain number to switch to, 100 ms after the button is pressed

Loop Values

The loop value is internally stored with 1 subtracted.

Written ValueBehavior
Omitted or 1Play once (default)
0Loop indefinitely
N (2 or more)Play N times in total
Below 0Play once; releasing does not stop it

Example

1 1 1 kick.wav
1 2 1 snare.wav
1 3 1 hihat.wav 0
2 1 1 bass.wav 1 3
  • 1 3 1 hihat.wav 0 — Chain 1, position (3,1), loop hihat.wav indefinitely
  • 2 1 1 bass.wav 1 3 — Chain 2, position (1,1), play bass.wav once and switch to chain 3 100 ms after the press (the sound keeps playing)

Circular Queue (Multi-mapping)

When multiple sounds are mapped to the same chain x y coordinate, they cycle in order each time the button is pressed.

1 1 1 sound_a.wav
1 1 1 sound_b.wav
1 1 1 sound_c.wav

Each press of button (1,1): sound_a → sound_b → sound_c → sound_a → ...

Playback

  • Releasing the button stops only an endless (loop 0) sound it started. A sound that plays once or N times plays to its end.
  • Pressing the same button in the same chain again replaces its previous sound. Sounds from different chains can overlap, even at the same coordinates.
  • An omitted wormhole or written 0 means no chain change and no warning. A negative destination still warns and moves to chain 1.
  • A wormhole that names a chain the pack does not have switches to the nearest chain (chain 1 or the last chain).

The shared playback rules also require:

  • A manual wormhole happens 100 ms after the press. If the player directly selects a chain on screen, by keyboard or on a Launchpad during that wait, the pending switch is cancelled and the selected chain stays. Closing the play screen also cancels pending manual switches. Auto-play and LED chain commands keep their own behavior.
  • Several player inputs can hold the same pad. Each release stops only the endless sound and lights that input started; the pad's pressed highlight stays until the last input releases. A release follows the original press even after a chain change.
  • Manual and auto-play presses own their sound and lights separately. Releasing one must not stop what the other currently owns.

App updates are aligning these overlapping-input and timing rules. Single-input playback uses the same format.

Text Encoding

These rules apply to every text file of a UniPack: info, keySound, the files in keyLED and autoPlay.

  • UTF-8 is read first; a UTF-8 byte order mark at the start is dropped.
  • UTF-16 (little or big endian) that starts with a byte order mark is read.
  • A file that is neither is read as CP949 (EUC-KR, the Korean Windows encoding).

Save new files as UTF-8.

Validation

  • Empty lines and lines with fewer than 3 columns are ignored.
  • Lines with out-of-range coordinates are skipped with a warning.
  • A warning is logged if the referenced sound file is not found in the sounds/ folder.
  • A sound file name whose upper and lower case differ from the file in sounds/ is still found (a file whose case matches exactly is used first). Write names with the same case as the files anyway.

All numeric fields use ASCII digits 0–9 with an optional ASCII + or -. Mapping, LED and auto-play numbers must fit a signed 32-bit integer. Internally subtracting one must preserve the exact result, including -2147483649. Non-ASCII digits are format errors in the shared format; Android support is being aligned.