Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMAP autosave + 16 MIDI vports #1268

Merged
merged 6 commits into from Dec 15, 2020
Merged

PMAP autosave + 16 MIDI vports #1268

merged 6 commits into from Dec 15, 2020

Conversation

@dndrks
Copy link
Contributor

@dndrks dndrks commented Dec 10, 2020

PMAP auto-save

params.lua

previous behavior:

  • midi mappings (PMAPs) were only saved when a PSET was saved

new behavior:

  • PMAPs are saved after they're assigned, so they persist between script loads without needing to save a PSET

16 MIDI vports

previous behavior:

  • norns could host up to 16 MIDI devices, but only assigned devices to 4 MIDI vports
  • SYSTEM > DEVICES > MIDI reflected only 4 MIDI vports
  • users had to remove/reassign vport-assigned devices more often
  • this removing/reassigning disrupted accuracy of mapped controls in PMAPs (which restores based on vport device ID)

new behavior:

  • norns can now assign up to 16 MIDI vports to match its hosting capability
  • users can manage all 16 vports via SYSTEM > DEVICES > MIDI
  • 16 device history means users will have to do much less device management/rearranging
  • restoring static vport device IDs via PMAPs is less problematic, unless the user purposefully rearranges their device

SYSTEM > DEVICES > MIDI:
mididev1
mididev2

assigned a connected device to a vport (up to 4 pages can generate, no indicator if only 1 page):
mididev3

midi.lua

  • create 16 MIDI vports (addresses #1260)

pmap.lua

  • expect assignments from all 16 MIDI vports

state.lua

  • remember devices from all 16 MIDI vports

devices.lua

  • add menu redraw handling for 16 MIDI vports
  • add m.last_pos to remember which port was last highlighted when switching back to port list from device list

clock.lua

  • extended clock params table to include all 16 ports
  • added naming (with abbreviations) to help make it easy for users to see port assignments
    midiout
    nb. of course, names are refreshed only at boot, but i think this is helpful regardless. if a device's name is none, it just shows the port number.

show mapped device's name

params.lua

previous behavior: mapping a midi controller to a parameter showed only its port number
new behavior: midi map menu now shows the device's name (abbreviated if longer than 6 characters, eg. "Midi Fighter Twister" becomes "MFT"), which helps with clarity

new-map
new-map2

fix #1261

home.lua

  • added parameter menu reset

add util.acronym()

util.lua

  • util.acronym() will return an acronym from a given string

eg. util.acronym("Midi Fighter Twister") returns MFT

dndrks added 4 commits Dec 10, 2020
- 16 assignable midi vports (addresses #1260 )
- extended DEVICES > MIDI menu to reflect all 16 ports
- added "last position" recall when switching between ports and devices
- extended mapping menu to use all 16 ports
- extended PMAP to 16 ports
- assigned PMAP saves to more appropriate triggers (after coming out of mapping)
- fixed #1261
@dndrks dndrks requested review from catfact and tehn Dec 10, 2020
@tehn
Copy link
Member

@tehn tehn commented Dec 10, 2020

rad! will check it out.

Copy link
Member

@tehn tehn left a comment

this is great! some minor inline comments to address but tested it out, nice attention to detail.

one big change i'd like you to tackle first, however, is you introduce a new scrolling/paging style for the device midi menu. i'd much prefer you make it conform the the existing style which is followed by the SELECT and PARAM lists: basically six lines displayed, highlight on line 3. for device/midi the minor mod to this would be MIDI on line 1, line 2 blank, then have lines 3-6 scrolling while keeping line 3 the highlight.

awesome work!

lua/core/menu/home.lua Outdated Show resolved Hide resolved
lua/core/menu/home.lua Outdated Show resolved Hide resolved
lua/core/clock.lua Outdated Show resolved Hide resolved
lua/core/menu/devices.lua Outdated Show resolved Hide resolved
lua/lib/util.lua Show resolved Hide resolved
dndrks added 2 commits Dec 14, 2020
- changed DEVICES > MIDI menu + sub-menu mechanics to align with SELECT and PARAMS
- touched up code readability from PR feedback
@dndrks
Copy link
Contributor Author

@dndrks dndrks commented Dec 14, 2020

@tehn + @ryanlaws , thank you for the detailed feedback!

i've aligned the nav mechanics of the DEVICES > MIDI device menu + submenu with the scrolling template of SELECT + PARAMETERS. i also touched up some of the legibility, as highlighted by your q's and comments.

lmk if this feels good and tests well!

@dndrks dndrks requested a review from tehn Dec 15, 2020
@tehn
Copy link
Member

@tehn tehn commented Dec 15, 2020

code looks good, will test on device this afternoon!

@tehn
tehn approved these changes Dec 15, 2020
@tehn tehn merged commit b7dfd65 into main Dec 15, 2020
@tehn tehn deleted the PMAP-robust branch Dec 15, 2020
@@ -24,6 +24,7 @@ m.key = function(n,z)
else
norns.script.clear()
_norns.free_engine()
params.reset()

This comment has been minimized.

@tehn

tehn Dec 28, 2020
Member

little late--- this throws an error, and i'm wondering what the original intention was?

@dndrks
Copy link
Contributor Author

@dndrks dndrks commented Dec 29, 2020

@tehn
Copy link
Member

@tehn tehn commented Dec 29, 2020

ah i remember now! this is an easy fix i think. i'll get it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants