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

Long file and directory names confuse audio fileselect #1681

Closed
xmacex opened this issue Jun 10, 2023 · 2 comments
Closed

Long file and directory names confuse audio fileselect #1681

xmacex opened this issue Jun 10, 2023 · 2 comments
Assignees
Labels

Comments

@xmacex
Copy link

xmacex commented Jun 10, 2023

It seems that long names of directories or files, those long enough to get the ellipsis "...", too long for screen confuse fileselect on updated norns. Choosing such a file or directory leaves the norns on-screen UI incl. menus unresponsive for a while, but pressing K1 a few times seems to work to get back to an earlier state.

Specimen

  • File "kubish_transformer.wav" exhibits the problem.
  • Same file as "kubish.wav" is fine.
  • Folder "2023-06-08-monheim" is fine.
  • Same folder as "peace-to-ukraine-finally-this-is-taking-too-long" exhibits the problem
  • A long symlink e.g. "all-wars-must-end-we-cannot-go-on-like-this.wav" to a short filename exhibits the problem.
  • A short symlink e.g "peace" to a long directory name is fine.

Maiden when trying to enter a directory with a long name:

lua: /home/we/norns/lua/lib/util.lua:221: bad argument #2 to 'format' (number has no integer representation)
stack traceback:
	[C]: in function 'string.format'
	/home/we/norns/lua/lib/util.lua:221: in function 'util.s_to_hms'
	home/we/dust/code/nice-tapes/lib/tape_inject.lua:114: in function 'fileselect.callback'
	/home/we/norns/lua/lib/fileselect.lua:52: in function 'fileselect.exit'
	/home/we/norns/lua/lib/fileselect.lua:168: in function 'fileselect.key'
	/home/we/norns/lua/core/menu.lua:147: in function </home/we/norns/lua/core/menu.lua:124>

Discussed in CC2 thread.

Please let me know if I can test something etc. I'll try to read the code to see how the filename travels into util.lua:221.

@xmacex xmacex changed the title Long paths confuse fileselect Long file and directory names confuse audio fileselect Jun 10, 2023
dndrks added a commit that referenced this issue Jun 10, 2023
ah! i had totally spaced on the auto-shortening of long filenames by appending '...', which confused the "is this a file or is this a folder?" mechanism! this is now fixed + and i will ask for community testing!
@dndrks
Copy link
Member

dndrks commented Jun 10, 2023

@xmacex thanks so much for logging the issue and building up a super-useful repro case!
i think i've got this fixed in #1682, but would love your (and anyone watching) stress-testing <3

to merge this PR'd change into your norns, SSH in and execute:

cd norns
git fetch origin pull/1681/head:1681
git checkout 1681
./waf configure
./waf -j2
systemctl restart norns-matron

to switch back:

cd norns
git checkout main
./waf -j2

hopefully we can get this tested with a few of your failure cases! thanks so much!

@dndrks dndrks self-assigned this Jun 10, 2023
@dndrks dndrks added the bug label Jun 10, 2023
@xmacex
Copy link
Author

xmacex commented Jun 11, 2023

The branch is 1682, and with that.

  • ✅ File "free-ukraine-free-everyone-abolish-all-military-action-worldwide-forever-and-start-raising-a-sequence-of-generations-who-do-not-know-what-warfare-is.wav" is fine.
  • ✅ Same file as "is-possible.wav" is fine.
  • ✅ Folder "peace" is fine.
  • ✅ Same folder ar "abolish-all-militaries-and-find-better-ways" is fine.
  • ✅ A long symlink e.g. "purge-militarism-from-your-mind-and-culture.wav" to a short filename is fine.
  • ✅ A short symlink e.g. "slava-ukraini.wav" to a long directory name is fine.

Looks good to me, good job @dndrks.

@tehn tehn closed this as completed in 77fd4da Jun 11, 2023
tehn added a commit that referenced this issue Sep 27, 2023
* add PSET number to PSET actions + add delete action (#1544)

* add PSET number to callbacks + add delete callback

* fix passing pset_number in delete action

* Revert "fix passing pset_number in delete action"

This reverts commit 7f98bb2.

* fix pset_number in read action

* clean up formatting

* remove unnecessary nil checks

* update paramset docs

* fix parameter name passing to params:delete

* add pset_number to docs

* releases.txt

* remove nonexistent post_filter_fc_mod command from softcut param factory

* Update pmap.lua

* typo fix (#1560)

* fix registration for screen_display_image_region

* Update readme.md

* add note to readme regarding release flag

* use abl_link C API for link clock

* init session state

* add param separators to lookup table (#1539)

* add param separators to lookup table for hide/show

* add unnamed failsafe

* add visibility lookup for strings

* fix name forcing

* cleanup DSP 'lab work' folder (#1580)

* add script-definable action for when clock tempo changes (#1575)

* add clock.temo_changed callback

* clean up naming

* reset handler when clocks are cleaned up

* fold in artem's feedback

* remove 'source' pass, remove redundant nils

* params: align 'add_separator' and 'add_group' flow with other paramtypes (#1584)

* protect against casual param naming

* protect groups, too

* add error message

* change separator and group addition

* specify overwrite conditions

* overwrite flag allows for continuity for param count

* allow hidden param to be registered

* add parameter-based lfo scripting library (#1585)

* initial upload + unload lfo's after use

* default = 'param action' and track fn mapping

* add function type lookup table

* add ldoc notes

* bars -> clocked

* no spaces in param IDs

* remove 'frm', not used

* rename library to 'param_lfo'

* rename to 'param-lfo'

* p_lfo -> plfo

just cosmetic, but looks way better

* apply menu password entry to SMB + hotspot (#1570)

* unify smb + hotspot password change

* Update link

* Revert "Update link"

This reverts commit 55fff78.

* Revert "Merge branch 'main' into password-helper"

This reverts commit 66fe798, reversing
changes made to 651d7c0.

* Revert "Revert "Merge branch 'main' into password-helper""

This reverts commit b797f04.

* maiden inaccessible

* robust message for hotspot password change

* fix to add midi data when device is removed (issue #1557)  (#1562)

* typo fix

* fix to add midi data when device is removed (issue #1557)

code fixed and doc info updated for issue #1557: #1557

* Place downbeats correctly.

Without this change, a swing of 66 will shift some events early and some events late from where they would otherwise be. With this change, a swing of 66 leaves some beats alone, and shifts other beats late from where they would otherwise be. 

Example to evaluate change, run as a norns script:

```
engine.name = "PolyPerc"
local lattice = require("lattice")

function init()
    l = lattice:new()
    p1 = l:new_pattern{
        enabled = true,
        division = 1/4,
        action = function(t)
            print("q", t)
            engine.hz(440) 
        end,
    }
    p2 = l:new_pattern{
        enabled = true,
        division = 1/8,
        swing = 66,
        action = function(t)
            print("e", t)
            engine.hz(660)
        end,
    }
    l:start()
end
```

In this example, the expected behavior is that two events (440 and 660) fall on the "down" beat, and then one (660) falls on the "up" beat, but with a "triplet feel". Without the change we get the "eighth notes" falling before and after the quarter note, but not on it.

* Revert "add parameter-based lfo scripting library (#1585)" (#1588)

This reverts commit 221531a.

* Revert "fix to add midi data when device is removed (issue #1557)  (#1562)" (#1589)

This reverts commit a808394.

* add 'lfo' (#1591)

* add lib/lfospec

a general-purpose scripting library for establishing LFOs, with optional parameter UI control

* add lfospec attributions

* protect against nil IDs

* add note about clocks + start/stop with parameter menu

* update params per entry

* Use lattice for LFOs, so they share clocks, and allow setting ppqn

* attribution and unused var cleanup

* change name and fold in feedback

* register 'norns.lfo' table, manage from script.lua

* Update script.lua

* check for nil norns.lfo

* remove note about clocks

since using lattice, there's no worry about counting clocks

* add API text to LFO:add

okay, this is the last touch! sorry for all the final countdown updates 😬

Co-authored-by: Naomi Seyfer <naomi@seyfer.org>

* execute global Midi.remove callback (#1590)

this runs the global, customizable midi device removal callback when a device is unplugged (if the device is registered by the norns midi system), in addition to and without affecting the per-device removal callback (if defined.)

alternative to PR #1562, addressing issue #1557

* 220802

* releases.txt

* hotfix: lfo `:add` (#1593)

* hotfix: lfo `:add`

gah! the `:add` method wasn't properly invoking the `.new` function

* Update lfo.lua

* rest of the lfo hotfix (#1594)

* hotfix: lfo `:add`

gah! the `:add` method wasn't properly invoking the `.new` function

* Update lfo.lua

* Update lfo.lua

* releases.txt

* gamepad support (#1439)

* basic gamepad support w/ whitelist

* basic support for gamepad in global menu

* fix missing clear callback

* handling of analog joysticks & numeric dpads

* optim: faster lookup of event code 2 axis

* (cont.)

* fix bad name for axis properties

* bug fixes, catchall axis callback vs dpad/apad

* rename `apad` into `astick` (analog stick)

* mark dpad as naalog for bufalo model, fix typo

* do not debug log

* do not add separators to PSET file (#1598)

* fixed screen curve param descriptions (#1603)

* Update paramset.lua (#1605)

* expand acceptable accum CC values (#1606)

a tiny change that allows controllers to send any CC value above 64 for "up" and any below for "down". previously it had to just be 65 and 63 which isn't supported by all controllers.

* add TAPE previewing to fileselect (#1607)

* add previewing to fileselect

* working

* stop previewing on key and always on left scroll

* Tweaks to the keyboard (#1611)

* handle osc messages for the keyboard

* change parameters with +/- keys

* allow holding key to scroll menu

* toggle menu with F5 key

* goto menu if F1-4 are pressed

* add version error (#1613)

* add previewing to fileselect

* working

* stop previewing on key and always on left scroll

* add version error message

* working

* address issue #1612 (#1617)

adds a call to the script-defined `clock.tempo_change_handler` function whenever the `clock_tempo` parameter is changed in the parameters UI from an external source

* work on lattice v2 (#1616)

* work on v2

* preserve 'new_pattern' for backwards-compatibility

* quarter note is good actually lol

* incorporate tyler's comments

* docblock, comments, and semantic changes

Co-authored-by: Tyler Etters <tyler@etters.co>

* fix `_menu.keychar` not getting called (#1619)

* prevent global menu shortcut messing up w/ sub-menu's (#1620)

* fix undefined `gamepad` when `script.clear` gets called (#1621)

* fix: document sprocket ordering (#1625)

* update lfo lib to use lattice sprockets (#1626)

* add password length failsafes for WPA-PSK (#1627)

WPA-PSK requires a sequence between 8 and 63 ASCII characters, so if a user uses this prompt to change their password to something shorter, then they won't be able to access hotspot (due to the conveniences added by #1570).

to help guardrail, this commit adds:
- an on-screen `textentry` check which shows a countdown to 8 characters and a warning if the password goes beyond 63
- a character count check to `m.passdone`, which will only change all passwords if the string length is >= 8 and < 64, otherwise it prints warnings to maiden that the password has not been changed

* 221214

* releases.txt

* update.sh fix

* update docs

* releases.txt

* `new_pattern` was missing return keyword (#1629)

* lfo fixes + improvements (#1630)

fixed locally global variables for `scaled_min` / `scaled_max`, `mid`, and `rand_value`, which interfered with square and random waves when multiple LFOs were running with different min/max values.

added `mid: rising` and `mid: falling` as options for the `reset_target`, which allows more control over how the reset affects the starting value

* add osc.cleanup() to script.lua (#1643)

* allow sending midi clock to all devices simultaneously (#1642)

* Add files via upload

* toggles for targeting device clock out

builds out @tehn's feedback from #1642 :
- any currently-ported midi device will populate in the 'midi clock out' section of 'PARAMS > CLOCK'
- each visible entry has a toggle to receive norns clock
- toggles get saved/restored as part of `system.state` during clean reboots

follow the approach brian outlined actually saves us from doing any if's during each clock tick!

* longer short name

cleaned up formatting to match the SYSTEM > DEVICES > MIDI syntax, which allows for up to 20 characters to display comfortably before aliasing

Co-authored-by: dan derks <derks.dan@gmail.com>

* fix lattice transport value getting increased in steps of 5 (#1638)

* fix lattice ppqn resolution divded by 5

* order sprockets once per pulse

* Make maiden-repl compile on macOS 13.1 Ventura (#1645)

* Change wrap to use math instead of iteration, and happen in constant time (#1577)

* clean up device callbacks (#1646)

* remove unnecessary _menu.rebuild_params() (#1647)

this gets called elsewhere throughout the stack (including MIDI device add/remove), which makes this unnecessary -- it also seems to cause race-condition conflicts as the rebuild attempts to index parameters which don't yet exist

* Update device_midi.c

blind fix attempt for dropped sysex bytes

* fix typo (want stop byte not start byte)

* Add UK keyboard option. (#1651)

* Remove error from unknown key press. (#1654)

* fix argument indices for buffer_clear_region_channel (#1656)

this is a blind fix attempt for issue #1652

* lua NRT processing function (#1634)

* not working

* still not working

* first draft

* fix typo

* refactor: attempt to pass buffer data rather than function

* catch silly typo

* process_chunk should match OscInterface.cpp

* working! refactor to allow longer sections to be processed

* fix errors

* catch typos

* refactor to use shared memory

* attempt to not cause stack overflow, fix wscript so norns ./wafs correctly

* catch typo, add debug prints

* attempt to prevent poke failing to open shared memory

* strange not-working place

* catch small typo, add debug print

* attempt to prevent error on second call to process

* working

* refactor to use clocks to chunk up softcut_process

* fix weaver bugs, change lua API

* fix: catch typo

* Update docs for screen.fill() and screen.stroke(). (#1660)

* new crow4 features on norns (#1662)

* run ldoc

* regenerate docs

* better separator labeling in core params (#1665)

* better separator labeling

* Update audio.lua

* reduce 'send_midi_clock' var scope (#1666)

during release testing, i realized that after my ~40th script load, `clock.sync` calls were off by a tenth of a beat, compounding as i continued to load scripts.

when i verified #b932b0d sparked the issue's emergence, i realized that the `send_midi_clock` table was being added to each time `clock.add_params()` was called, but never emptied out. so, eventually, the clock was doing 24ppqn calls on a table with *tons* of entries.

i guess nice to accidentally stress-test that a lot of devices could receive MIDI clock before timing issues emerged? anyway, fixed now!

* Implement character/key conversion (#1659)

* Implement character/key conversion.

* Remove char_to_code().

* [mergeable] rework `gamepad` to handle more edge-cases (#1624)

* rework gamepad to handle more edge-cases

* woops

* SDL-format GUID generation for HID devices

* (cont., missed this one binding)

* use this new GUID as id in known controller models table

* add guid in controller conf, some 8bitdo masquerade as xbox 360

* log guid

* actually use guid in `gamepad.process` callback

* analog btn support, fix std order X axis, no meta btn state

* fix value of sign in gamepad.axis() when analog button

* remove dead code

* re-introduce denoize for analog buttons, comments

* call gamepad.analog after computing state

* on sensors, negative half is generally 1+ bigger than positive one

* tweak submenu integration

* disable verbose mode

* prevent trigger script cb if in menu, add _menu.analog

* prefix all new `menu` callbacks w/ `gamepad_`

* rounding the half-reso may be counter-intuitive, document instead

* sometimes lower half bigger, sometimes upper one...

* fix actual resolution for this controller

* be resilient against "lean" config files (w/ empty maps ommited)

* add system/settings menu, move items, add battery_warning (#1668)

* add system/settings menu, move items, add battery_warning

* yikes booleans

* fixes

* export png (#1669)

* changelog

* norns.expand_filesystem() (#1670)

* Update norns.lua

* Update norns.lua

* releases.txt

* allow user to add gamepad profiles without tempering w/ core (#1671)

* allow user to add gamepad models without tempering w/ core

* more explicit var names

* Revert "lua NRT processing function (#1634)" (#1673)

This reverts commit 0c06b09.

* changelog

* releases.txt

* Update settings.lua (#1675)

* revert export_png and rename export_screenshot (#1676)

* changelog, version, releases.txt

* releases.txt

* fix: softcut.voice_sync order documentation

softcut's `voice_sync` command has its arguments reversed in the API docs

* add fade_time correction, as well!

* fix fade_time parameter names

* add filters to fileselect (#1678)

* add filters to fileselect

* Update fileselect.lua

* remove whitespace

* fix midi clock double-tap (#1680)

* changelog, version

* update.sh ancient typo

* Update releases.txt

* fix #1681 (#1682)

ah! i had totally spaced on the auto-shortening of long filenames by appending '...', which confused the "is this a file or is this a folder?" mechanism! this is now fixed + and i will ask for community testing!

* 230614

* changelog

* releases.txt beta

* releases.txt stable

* Return correct 7th chords from musicutil.generate_chord_scale_degree  (#1688)

* Support half-diminished chords and correct scale degrees

* Add remaining missing 7th chords to roman notation: dominant, minor major, augmented major

* Use M decorator for Augmented Major 7, expand docs

* More docstring tweaks

* Update scale chord tables for Augmented Major 7 (27)

* Add new glyphs with FontForge instead of PixelForge

* Add alt_names Min7b5 and Maj7#5 for consistency w/teletype

* Ensure that disk field can represent size of larger sd cards (#1690)

Co-authored-by: Chris Aquino <aquino.chris@pm.me>

* lfo library: v2 (#1692)

* 'saw' -> 'tri', add 'up' and 'down', fix init

* build params from lfo spec

* add phase

* tune 'RESTART' (#1695)

* midi mapping touchups (#1696)

* fix user gamepad profile lookup + new model (#1697)

* fix: user-defined gamepad profile lookup

* new gamepad model: Retrolink B00GWKL3Y4

* more info

* disable hciuart in update (#1700)

* make variable y in util.wrap local (#1704)

* fix: debounce tape preview in fileselect (closes #1628) (#1703)

---------

Co-authored-by: dan derks <derks.dan@gmail.com>
Co-authored-by: brian crabtree <tehn@nnnnnnnn.co>
Co-authored-by: zbs <86270534+zjb-s@users.noreply.github.com>
Co-authored-by: Jonathan Snyder <52048666+jaseknighter@users.noreply.github.com>
Co-authored-by: Greg Wuller <greg@afofo.com>
Co-authored-by: Tyler Etters <tyleretters@users.noreply.github.com>
Co-authored-by: Artem Popov <artfwo@gmail.com>
Co-authored-by: Naomi Seyfer <naomi@seyfer.org>
Co-authored-by: Jordan Besly <11557146+p3r7@users.noreply.github.com>
Co-authored-by: Tom Waters <github@random-works.co.uk>
Co-authored-by: Rylee Alanza Lyman <46907231+ryleelyman@users.noreply.github.com>
Co-authored-by: Zack <zack.scholl@gmail.com>
Co-authored-by: Tyler Etters <tyler@etters.co>
Co-authored-by: kasperbauer <kasperbauer@users.noreply.github.com>
Co-authored-by: Anders Östlin <anders.ostlin@gmail.com>
Co-authored-by: Nik Silver <nik@niksilver.com>
Co-authored-by: trent <trent.gill@gmail.com>
Co-authored-by: brian crabtree <tehn@monome.org>
Co-authored-by: Michael Dewberry <michael.dewberry@gmail.com>
Co-authored-by: Chris Aquino <chris@thunderbird.net>
Co-authored-by: Chris Aquino <aquino.chris@pm.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants