I’m not near my device so can’t upload anything right now. It’s a really simple/naive text file format made up of lines of either the character 1 or 0. :slight_smile:

It was based on https://github.com/monome/dust/blob/master/scripts/tehn/playfair.lua#L234.

Oh, I didn’t know about this. :blush: Agreed it looks like a convenient option (see https://github.com/monome/norns/blob/master/lua/tabutil.lua#L77)

1 Like

Foulplay does something similar to this as well. Only instead of 1’s and 0’s, there are various pattern values per line.

1 Like

Its a bit fiddly to read it when you have complex table (with a lot tables inside)

2 Likes

Totally. Foulplay’s data file would be nigh impossible to edit by hand. Luckily, Norns doesn’t care, and there’s really no need to. :stuck_out_tongue:

1 Like

Also, its harder to maintain theese load/save functions if you are going to make any changes in table structure

1 Like

This is very true, and has already bitten me once. Obviously there is room for improvement.

As a designer, not a developer, working out the best structure to save sequencer data is proving a headache! Luckily I’m back at work Monday and have an army of data specialists to talk to.

Currently I have a 2D array, with a sequence per row.

1 Like

hrm, i’m looking at the tabutil.save for the first time
works great! thanks @markeats for adding that.

NB though, the format for nested tables is kinda funky.

given this guy:

 a = { "one", {2, 3}, {four=4, fivesix={5,6}} }

calling tabutil.save(a, 'a_save.lua') produces a file like this:

return {
-- Table: {1}
{
   "one",
   {2},
   {3},
},
-- Table: {2}
{
   2,
   3,
},
-- Table: {3}
{
   ["fivesix"]={4},
   ["four"]=4,
},
-- Table: {4}
{
   5,
   6,
},
}

so it’s a kind of “flattened tree” - not sure if there is a more accurate technical term for this. it’s clear enough how it works, but not exactly intuitive to edit directly. (OTOH something i can definitely live with.)

i’m a little surprised; wonder if there is a way to simply serialize a table to something that looks more like its declaration in lua. (maybe making some assumptions like no metatables, no cycles.)

here’s a boatload of other table serialization methods implemented in lua, maybe there’s alternatives to consider:
http://lua-users.org/wiki/TableSerialization

2 Likes

FYI @artfwo fixed param:save / param:load to process key id’s instead of indexes, so it should perform well with table changes.

for save/loading param data i’d highly suggest using the built-in param functions. the user can also hold K1 while in the PARAM menu to save/load.

i know this doesn’t cover custom data ie sequences… many other options for that mentioned above.

2 Likes

To recent discussion about saving patterns and presets, I just finished adding @markeatsload/save/delete routines found in loom to my Strum script. My blunders aside, this works very well. Kudos.

Will something break in the future if I am saving/loading synth params using the above method?

1 Like

I have a very rudimentary 4 band parametric filter chain engine in a branch on my dust fork. It works, kind of.

WARNING: THIS MAY DAMAGE PLAYBACK EQUIPMENT

The scary message is because of an unknown bug I hit. It’s a strange one, so any help would be amazing.

Running the same SynthDef on my laptop always works as expected. Running it on the device has a strange, painful bug. The engine loads, then in the Lua REPL I can set the Q with engine.rq1(0.1) or for any of the other filters in the chain. But when the initial Q changes on some (but not all) of the filters, the engine explodes and causes a painful amount of noise on the outputs…for only about 5 seconds. Following that, the output falls back to normal and all further modulations of that parameter that caused the explosion work as expected.

I tested both with manual modulation via REPL and using params on the device through control specs. I made a sample script to load the engine and expose params.

The only clue I have is there is some way of setting a default for all the Q values that I have overlooked. This may have caused a divide by 0 (or nil) since the docs for BPeakEQ say “rq is the reciprocal of Q. bandwidth / cutoffFreq”

Thought this might be of interest to you Supercollider users as Norns inspiration:

3 Likes

@lazzarello yeah i’d recommend setting some default values for RQ args in the synthdef

otherwise i believe they are indeed set to 0 by default and that is indeed Bad News For Biquads

(side note, i find it misleading that the parameters are labelled “q” when they control RQ and thus work backwards.)

1 Like

Can you develop for norns directly in VS Code rather than Maiden? It’s such a nice editor I’d love to be able to save directly into norns, and also a local folder for git, rather than manually keeping Maiden and VS Code in sync with copy paste.

I’ve only work in Lua on Norns, but I do about as much coding in sublime text as I do in Maiden. I just use git to keep things synced between my mac and Norns…

If I understand the question this is how I edit the files in BBEdit. Open the folder where the file you want to edit is, using cyberduck, right-click on the file and choose Edit in…
(When you have chosen your favorite editor you just click on the file in cyberduck and press Command+K)

2 Likes

you can also use SSHFS (mount a file system over ssh)

on macos google “fuse”

4 Likes

afaik, one thing you’ll miss by using a text editor other than the Maiden editor is loading your script onto the device without copy + paste or rebooting.

2 Likes

I do about half of my norns-ing in maiden and the other half in sublime text 3. It’s pretty easy and quick to sync things up with git.

2 Likes