I really appreciate how you contributed the 3D printable open PB mount, so I made you a video explaining how you might think about designing it (and working code below).
Square wave approach:
export function beforeRender(delta) {
t1 = time(2 / 65.536) // 2 seconds to repeat
}
export function render(index) {
pos = index/pixelCount
s = square(pos - t1, .5) // .5 => 50% blue
hsv(.666, s, 1)
}
More flexible sawtooth wave (time()) approach:
var speed
export function sliderSpeed (_v) { speed = _v }
export function beforeRender(delta) {
t1 = time(.1 / speed / 65.536)
}
export function render(index) {
pos = index/pixelCount
v = (1 + pos * 3 - t1) % 1 // 3 is the number of repetitions we see at once
// .95 is where white starts (5% white)
// .15 is where any brightness starts (15% black)
// The remainder is blue
hsv(.666, v < .95, v > .15)
}
@jpm, @jeff has been working a LOT on doing exactly that for all of the default patterns that ship with v3, and has a repo for these in his github.
At some point when my hair isn’t on fire, we’ll run the entire pattern site database from a github repo where folks can help contribute clarifications and improvements so they should keep getting better and better!
I too am blown away with the explanations and comments. Very cool @jeff!