kometbomb / klystrack

A chiptune tracker
http://kometbomb.github.io/klystrack/
Other
481 stars 29 forks source link

Custom note mapping? (uniform map example from sunvox) #258

Open Houkime opened 5 years ago

Houkime commented 5 years ago

I can't find a reasonably quick way in klystrack to deviate from standard piano note-to-keyboard mapping to my custom scheme which I find extremely useful and pleasant.

Using keymap presets for that like recommended it looks like would mess up hex editing and general text typing.

It is a bit odd that note-to-key bindings are not a menu config, but also are not in the config file.

For example of what I'm trying to achieve is a gif from sunvox of desired configuration (not a sunvox default):

gifcast_181207233633

Note that in this mapping of mine there is no geometrical distinguishing between majors and minors which is exactly the useful part since it allows for easy transposing by hand (since notes form a uniform row on the logarithmic frequency scale if major/minor categorization is erased) and makes geometrical patterns of keys pressed more meaningful (cause artificial breaking of translational symmetry was removed) and memorizable (less info to maintain).

+such mapping is more compact and allows for extra octave if modified (can't do it in sunvox though cause not opensource).

Also there are a few useful warps added to not have adjacent notes across the keyboard.

and here is how it is represented in the sunvox config file:

main_C0 "0 61 0 "
main_D0 "0 64 0 "
main_d0 "0 66 0 "
main_E0 "0 67 0 "
main_F0 "0 68 0 "
main_f0 "0 6a 0 "
main_G0 "0 6b 0 "
main_g0 "0 6c 0 "
main_A0 "0 3b 0 "
main_a0 "0 27 0 "
main_B0 "0 d 0 1 9 0 "
main_C1 "0 71 0 "
main_c1 "0 77 0 1 77 0 "
main_D1 "0 65 0 1 65 0 "
main_d1 "0 72 0 1 72 0 "
main_E1 "0 74 0 1 74 0 "
main_F1 "0 79 0 "
main_f1 "0 75 0 "
main_G1 "0 69 0 "
main_g1 "0 6f 0 "
main_A1 "0 70 0 "
main_a1 "0 5b 0 "
main_B1 "0 5d 0 1 60 0 "
main_C2 "0 31 0 "
main_c2 "0 32 0 "
main_D2 "0 33 0 "
main_d2 "0 34 0 "
main_E2 "0 35 0 "
main_F2 "0 36 0 "
main_f2 "0 37 0 "
main_G2 "0 38 0 "
main_g2 "0 39 0 "
main_A2 "0 30 0 "
main_a2 "0 2d 0 "
main_B2 "0 3d 0 "
Houkime commented 5 years ago

Found the note map in the code here under find_note https://github.com/kometbomb/klystrack/blob/0ae6ef9c152fcc1c254cc757ca9c89ec4fdc0c82/src/event.c

Seems hardcoded and constant One needs to write a loader of keys[] array from file on program start

Right now i just made a quick patch for myself overriding keys[] to my liking.

uniform_notes.txt