On my Android web browser, I can download a .love file and open it.
After downloading the file, I can open it in my file browser.
I can copy the file into Android using the USB port -- but I CANNOT open it there. Identical bits in storage.
And mobile browsers don't understand file:// So I need the internet to transfer data between two devices right next to me -- even WHEN I have the right wire.
Local-first?! I'd settle for local-somehow-anyhow.
< 60 LoC; it was a pretty nice experience to build it on Android using Lua+LÖVE+MiniIDE.
Check it out on the LÖVE Forums.
To recreate the above you need:
- To install LÖVE for your platform (really just Android or iOS since we're talking multitouch in this post.)
- Download a special build of MiniIDE containing Ivan's samples.
- Paste in the following 70-line script and hit 'Run':
g = love.graphics draw, line, circ, pt, color = g.draw, g.line, g.circle, g.points, g.setColor abs,min,max = math.abs, math.min, math.max audio = love.audio.newSource if od == nil then od,ou,omp,omr,okp,okr = love.draw, love.update, love.mousepressed, love.mousereleased, love.keypressed, love.keyreleased end W,H = g.getDimensions() -- visuals cs, N = {}, 100 function sq(x) return x*x end function dist2(x1,y1, x2,y2) return sq(x2-x1) + sq(y2-y1) end -- audio ts = {} function love.draw() -- od() for _,c in pairs(cs) do circ(c[1],c[2]) end end function circ(cx,cy) for x=cx-N,cx+N do for y=cy-N,cy+N do local dist = dist2(cx,cy, x,y) if dist < N*N then color(abs(x-cx)/N, abs(y-cy)/N, 0.5) --, dist/N/N) pt(x,y) end end end end function love.update(dt) ou(dt) local touches = love.touch.getTouches() for _,id in ipairs(touches) do if cs[id] then cs[id][1], cs[id][2] = love.touch.getPosition(id) ts[id]:setPitch(pitch(cs[id][2])) end end end function pitch(y) if y <= H/2 then return 2 - y*2/H -- vary pitch from 2 to 1 else return 1.5 - y/H -- vary pitch from 1 to 0.5 end end function love.keypressed(key, ...) okp(key, ...) escape() end function love.touchpressed(id, x,y, ...) cs[id] = {x,y} ts[id] = audio('ivanish/MaternalBowedGuitar.mp3', 'static') ts[id]:setLooping(true) ts[id]:play() end function love.touchreleased(id, ...) cs[id] = nil if ts[id] then ts[id]:stop() end ts[id] = nil end function escape() error('StopScript') end
One of those 70 lines contains 'ivanish', and I've been playing with that line by varying the sample. (Unfortunately there isn't a way to browse the list, so you have to look inside the love/zip file.)
Currently breaks MiniIDE; there's no way to edit its code once you run it :joy: You can still use the console, though!
[1] Video not recorded on tablet.
Zettelkasten versioning
1, 2, 3, ... 14, 14a, 14b, ... 14z, 14aa, ... 14ak1, 14ak2, ...
My versions are to communicate identity to users. That's it. Not value, not recency, not stability, not compatibility, not difference, not support status, just identity. Am I using the same version as you?
- Install LÖVE from the app store (see https://love2d.org)
- Download MiniIDE.love from https://love2d.org/forums/viewtopic.php?t=94852. I've been contributing to this app and vouch for it.
(MiniIDE has also been tested on iOS without limitations. But I gather LÖVE is quite tortuous to install on iOS, so you're on your own there..)
Read more on the Malleable Systems Forum.