File manager

Here is a stab at a file manager for norns.

It runs entirely on the norns itself. The main use case is recording stuff with tape and then copying the file to e.g. a Zoom H5 connected via USB without involving a computer.

PLEASE NOTE While, you might lose data and corrupt sd cards if something goes wrong. What it does it very simple (it just calls out to the Linux shell), but I finished it half an hour ago. In particular, be careful with weird filenames. I am publishing it now to get feedback on the idea. Don’t use it to rename your brand new best take of something you’ve been working hard on for years. I can offer sympathies and condolences, but no file recovery services or warranties.

Currently, the interface for copying involves navigating to the destination directory, "mark"ing it (as the destination), and then selecting copy, one at a time, on the files you want to affect. This is, of course, backwards and unintuitive. It was easier to code this way. I think it might work fine if I store the destination between script invocations, keeping the core use case in mind.

You can also rename and delete files and directories, as well as make new directories.

An Idea that I have but have no explored yet is to add various small audio editing commands via sox. E.g., change gain, trim silence, add fades, mix two files or stitch one after the other. This is mostly a UI problem, i.e. most ways we can think of letting yousers set up such a sox invocation for anything more complicated than normalize scored very highly for suckiness and annoyance in our extensive imaginary testing.

It’s useful for me now, to copy files to/from my Zoom recorder. Maybe you’ll like it too?

Here is the current TODO list as of september 16th, 2021:

  • more defensive code, maybe use lua posix instead of calling out to the shell
  • display errors to the user
  • maintain “destination mark” between invocations
  • sox operations on audio files (normalize, mix, stitch)
  • graphical audio editing (not)
  • encoder-driven vim clone for on-device note keep and code editing (extremely not)
  • make it nice enough to be part of the norns system menu instead of a script :slight_smile:

BTW - it should maybe have a less generic name. “Bureaucrat”, maybe?

16 Likes

Great name, great work!

1 Like

Thanks. I need to sleep now, hope to not wake to a pile of messages about corrupted SD cards :grimacing:

1 Like

haven’t used it yet, but i love the idea! thanks for sharing :slight_smile:

Oh, if you copy a large file it will lock up while it’s working. This is expected. When it’s done it reloads the current directory. I’ll code up a spinner or something.

1 Like

Nornston Commander

5 Likes

I forgot a very important piece of this: by default, USB drives are mounted so they’re only writable by the root user. To make it writable by us, we have to change a line in /etc/usbmount/usbmount.conf:

FS_MOUNTOPTIONS=""

becomes

FS_MOUNTOPTIONS="-fstype=vfat,gid=sudo,dmask=0002"

I’m unsure what the best way to do this when installing/init’ing. I also can’t remember if norns comes with usbmount or I installed it myself :grimacing: The symptom of this BTW is that any attempt to copy to a USB drive immediately finishes and no copy actually happens. There’ll be an error in Maiden about permissions if it happens.

I’ll also say that I managed to bork my H5 SD card, probably by unmounting it while/too soon after writing to it. I’ve added calls to sync after each command that touches the drive, but I don’t know if that’s enough. Should probably add an unmount command to the drive overview.

Update: September 16, 2021, I am a little more confident in this now. I have added a command to securely unmount USB drives (K2 in the list of mounted drives - not marked in the UI for reasons), as well as quotation marks in the shell commands that actually do the work, so it doesn’t fall over if filenames have spaces in them. The unmount function should prevent data loss if you remember to use it before unplugging your USB drive :slight_smile:

The UI is a little more complete - confirmation boxes for destructive operations, there’s a message on the screen while a copy is going (no progress bars though), etc.

The UI could (will) be nicer. One big shortcoming is that it doesn’t yet display any errors to the user. Overall, I think it’s usable, but I have only tested with a limited range of devices (Norns, H5), so the warning stands for now, although it is very simple and I can’t see anything obvious that could go wrong now. You still might need to manually install and set up a package, as described in File manager - #7 by rvense. Feedback is still welcome. Do USB drives even get mounted on an unmodified Norns?

2 Likes