Strange alert on Floor Division in norns’s Lua

I’m on norns 181008, when I use the Lua arithmetic expression for floor division, maiden shows an alert, but norns does the correct calcuation and returns the correct results:
lua%20division%201

When I remove the second / as requested by the alert, I get the standard division (which is not what I need):
lua%20division%202

I guess it is time for me to learn how to file a bug in git, no?

I noticed this in one of my scripts as well, the code actually works error-free, but the alert doesn’t go away.

this is an unfortunate limitation of the lua support baked into the editor framework we’re using in maiden, which doesn’t support lua 5.3 ops. (@tehn noticed this a while ago; tracked in: https://github.com/monome/maiden/issues/9.) . it’s an easy fix but should really happen upstream (or we should get off the web-worker parser and get on to something more robust – e.g., https://github.com/monome/maiden/issues/135).

Are there a best practices for using key 1 within scripts? I’ve been using long presses with it and as a modifier w/ encoders, but don’t want to accidentally override/mask system behavior for accessing the menu with the normal short press.

you actual can’t override the system behavior. it’s built-in to the scripting system, so you’re always safe to get back to the menu despite what your script does. what you’re doing is correct— KEY1 is really only good as a modifier or long-hold. keep in mind you can also track the release which can be useful.

1 Like

following up on my earlier (in retrospect massively misguided) attempt to ‘fix’ maiden on ios to reclaim table space.

i have discovered the ‘obvious’ solution of coding with vim via ssh and bypassing the ios issues entirely. the vim learning curve for a novice is a bit ‘ehhhh’ but the space saving results are undeniable:

i am still trying to wrap my head around the workflow for this kind of coding and would appriciate any thoughts/links about how to approach doing norns scripts via ssh.

i can google vim shortcuts etc, but version control, testing/debugging, and general order of operations are a bit of a mystery since up until now i have just been mashing save/run in maiden and staring at the REPL for errors.

someday i will use norns to make a song. maybe a 2019 new years resolution.

8 Likes

You might also take a look at nano instead of vim. It’s not as cryptic.

man nano from your command line

There’s probably a way to watch the maiden output on the command line, but I don’t know the incantations for that one.

3 Likes

vim is my goto editor, so I’m using the same approach. here are a few random vim thoughts.

I could go on forever. the best advice I can give is to learn as you go. whenever something feels inefficient, that’s probably a good sign that you can learn a vim command to make it easier.

2 Likes

the time invested in becoming proficient in a good editor (vim, emacs (although obviously as a vim user I’m duty bound to make jokes about emacs users - it’s contractual in the vim eula) and there are now a few good desktop ones that people swear by) is well worth it.

3 Likes

Don’t forget :syntax on (in vim)

3 Likes

oh yes! there are a lot of good things you can and should add to your .vimrc file in the home directory. here are a few that I find useful(you may want to change tabs from 4 to 2 since it seems to be the lua norm).

colorscheme darkblue
syntax on
set hlsearch " hilite search "
set ic " ignore case "
set nu " line numbers "

filetype plugin indent on
set tabstop=4 " width of a TAB(\t) is set to 4 "
set softtabstop=4 " TAB(\t) inserts 4 spaces when in insert/edit mode "
set shiftwidth=4 " indents have a width of 4 "
set smarttab
set autoindent

" return to last edit position when opening files (you want this!) "
autocmd BufReadPost *
     \ if line("'\"") > 0 && line("'\"") <= line("$") |
     \   exe "normal! g`\"" |
     \ endif
4 Likes

once you’re ssh’d in:

cd norns
./stop.sh
./crone.sh > /dev/nulll &
build/matron/matron

running matron without websocket redirection means you can type REPL directly into the terminal (helpful!) but there is no readline (ezra originally made a readline terminal-based maiden prior to the web maiden, but we removed it from the repo… maybe we can revive it)

workflow for script development:

open another terminal, run vim editing scripts in dust. to see changes, save file and use system menu on hardware to simply re-launch (SELECT) the script.

6 Likes

What’s the best approach if I want to load a bunch of short samples to be triggered by grid? (like a grid of one-shots)

Looks like ack allows for 8 samples. To get like 32 or 64 samples, would I need to make a version of ack that supports that many samples, or are those like “voices” in a hardware sampler and I could potentially have many different samples loaded for each voice?

You could have more buffers than voices and provide a command to point a given voice at a an arbitrary buffer - this is simple and oefficient in SC but you gotta worry about buffer boundaries I guess.

Alternatively you could load your multiple samples into one large buffer and skip around in it

2 Likes

any special scripting necessary to get param midi learn working with a particular script? or any stuff that breaks it? a few folks have reported that they can’t map any of the params except volume in cranes :frowning:

2 Likes

parameter mapping is currently limited to Control param types.

working on a big update for all param types, along with range scaling and rotary encoder support

(also fyi new standalone softcut is amazinggg)

10 Likes

so so so stoked!

rad to know re: Control params – speeds are all options, so mystery solved, thank you!

1 Like

Yeah, thanks so much. Looking forward to the update. Not hurry. Got plenty to keep me busy.

Further to my thinking out loud about soundfile editing, saving files and the issue of filenaming: I was wondering if a nice solution to hunting through characters with encoders could be a random filename generator, but instead of characters and numbers it could generate filenames from a big dictionary of random words? I feel like it would be cool to have a lines’ey corpus of strings that could be mushed together to make quick filenames on the go for recordings that are more memorable than R-1239BLAH.wav

Useful or problematic?

The ER-301 module does something similar with naming its custom units. Here is a link to a discussion of their new approach. https://forum.orthogonaldevices.com/t/random-custom-unit-naming/2379