step is the output quantum

i gather that at some point you are calling something like

params:delta("DelayTime", 1)

the delta method i hard-coded to incremement in steps of 1/100 of the range (maxval - minval), times the increment.

but the increment passed to delta doesn’t have to be an integer, so you can work around this in scripts by scaling the input to delta; unfortunately that’s of no use in the params menu.

i mentioned this a bit here, it would be nice to have an input quantum:

opend GH issue.

2 Likes

Aha! Thanks for the detailed response!

This is also crow related (although I guess a similar situation can occur when using a MIDI to CV adapter as well), but I think this is the best topic for this question.

I was wondering for those who have written something that outputs pitch/voltages for modular/eurorack how you handle the different types of CV inputs on modules?

I’m mainly wondering about the difference between modules that only take a positive voltage as pitch input vs modules that support both positive and negative voltage.

I was thinking of putting together a super basic norns + lua tutorial yesterday, which led me to another, probably more interesting and useful idea…a game of exquisite corpse in the scripting realm :slight_smile:

The basic idea is that I (or someone) would create a basic tutorial to get started (could be video or written), and then someone picks up where I left off and keeps building the script, turning their work into a second tutorial, and so on and so forth. Whatever I explore and develop in my initial tutorial is by no means set in stone; future participants have the freedom to take the script in a completely different direction.

What I find potentially interesting about the idea is that anyone can participate, and each successive pass doesn’t necessarily have to push the script into further complexity (although it could do that, too). So long as each one sheds light on something new, that’s cool.

Does that sound fun to anyone else? What would we end up with?!

9 Likes

that sounds very fun to me

could be a live streaming thing

2 Likes

Totally! Live streaming scares the shit out of me, personally, but that shouldn’t stop anyone from going that route to share their work/tutorial :slight_smile:

EDIT — I’ll try to record a first installment today or tomorrow, and then I’ll create a (wiki?) thread with a sign-up sheet.

4 Likes

What’s your git workflow?

I’ve been connected to smb, then clone my repo in /dust/code/mything. This seems to be the best way? Though I don’t really like having my git stuff in there that I wouldn’t have bundled with the actual release. So maybe I should have this be /dust/code/mythingdev and then once mything is in released and in maiden don’t touch that at all?

soooo

lets say i’m weirdly curious about how to visualize the two orbiting “tape” leds from the ob-4 for an interface

how might i script something that simple in lua?

2 Likes

Is that possible with trigonometry? For the x,y values of the individual points: x = rsin(alpha), y = rcos(alpha). Where r is the radius and alpha is an angle between 0 and 360

I know this is not a script yet, but a geometric approach.

3 Likes

https://github.com/bgc/bgc_dust/blob/master/lib/ui_utils.lua <- this could be a starting point for that.
my shield is still not working, if it was i would code those, seems fairly simple.

from my code you just take out the arc in draw knob and put to squares, 180 degrees apart (or PI radians)

1 Like

in lua that should look something like:

loop_time = 3 --(seconds)
radius = 10
framerate = 1/30 -- (30 frames per second == 1/30th second per frame)

metro.init(function(tick_count)
  elapsed_time = tick_count / framerate
  theta = elapsed_time  / loop_time * 2 * math.pi
  pixel_x = math.cos(theta) * radius
  pixel_y = math.sin(theta) * radius

  --- draw the pixel
end, framerate)

(probably : ) )

3 Likes

I don’t have a norns to try it (arrives next week, I am sketching this in p5.js), but maybe also the higher level graphics functions such as screen:arc() would simplify things by letting the computer do the math :slight_smile: I am imagining something like

loop_time = 3
framerate = 1/30
pixel_size = 1
speed = 360/loop_time * frame_rate

metro.init(function(tick_count)
    screen:arc(10, 10, radius, tick_count * speed % 360, tick_count % 360 + pixel_size)

end, framerate)
2 Likes

thanks yall

when i have time to test i’ll report back but this will definitely help guide my attempts

Barycenter is based off this motion / idea + a couple nested layers of the same. Cosine & Sine will get you one side, the inverse (1 - Cosine, or 1 - sine) will get you the opposite point.

o[1].x = viewport.width/2 + (math.cos(delta) * radius)
o[1].y = viewport.height/2 + (math.sin(delta) * radius)
o[2].x = viewport.width/2 + (1 - math.cos(delta) * radius)
o[2].y = viewport.height/2 + (1 - math.sin(delta) * radius)

2 Likes

@eigen ran into an issue with a script where an animation was not wired up quite correctly, causing flickering when the norns global menu was open. @tyleretters came up with the fix, which was to call the global (userspace) redraw() function, rather than a function in a custom module, on the animation clock. I was not aware before that it had to be set up this way. Is this already documented anywhere, and if not, where would be the appropriate place to add the docs? I apologize if this is the wrong thread for the question.

1 Like

it is not documented, but is on the todo list.

generally, never touch the screen outside of redraw()

there are some backend changes that could be added to protect against this, i will make an issue

2 Likes

Thank you! If I can help with docs or Lua (I’m a little shy on the C/C++ side of things), I’m happy to.

extremely dumb question:

i have a table of numbers. i want to divide it evenly (as possible) into n subtables where each subtable is 1/nth the size of the big table:

big_table={3,29,55,13,38,25}
divider = 2

[missing brain here]

lil_table_1={3,29,55}
lil_table_2={13,38,25}

and then, if i were to change it to divider = 3 , return 3 tables of two values instead.

i can definitely figure this out, but knowing how easy it must be to do––and also how long i’ve been staring at maiden––it’s totally plausible that someone here might be able to answer me before i work it out.

i know it probably involves table.unpack(big_table,something,something) and maybe also the % operator. just cant find the logic in my brain.

Maybe not particularly Lua specific as i cant remember table funcs off the top of my head, but I would just do this in a for loop. I reckon creating nested table within a liltables var for each time the index wraps around the divisor (modulo) could achieve this

1 Like

totally different from the rabbit hole i was going down and this feels like it’s going to work. modulo remains one of the most difficult things for my hobbiest brain to remember how to use.

thank you!!!

1 Like