Norns: sketches

Yay!

a quick thing…

I have started on porting the f0plugins from fredrik olofsson to norns engines. These are supercollider emulations of old game chips.

I’ve done a basic implementation of the Atari2600 and SN76489. Started on NES2, but that’s gonna take some serious work.

I started on Space Invaders a long while back and need to revisit. :slight_smile:

12 Likes

21 posts were split to a new topic: Sex positivity, word choice, &c

@okyeron That’s amazing, I would love the sounds to be really basic.
I’ll look into that :slight_smile: I’ve started looking at how the other applications handle sound synthesis.

I’ve changed the name, I didn’t realized it had such that kind of baggage around synths. That’s unfortunate.

@crim I will look into that, I want that too :slight_smile:

8 Likes

Improved the interface to fit with the classic style of the game.

3 Likes

i moved a lot of posts about the old name (“Porns”) to a new topic:

if you have things to say about the old name, that would be the place

7 Likes

Came for the pr0nz, stayed for the Pong. Glad you are taking part in norns development! Much looking forward to seeing what else you come up with!

6 Likes

this looks awesome. i think it’d be really cool if the x and y positions of the ball were mapped to midi or modulated some synth engine or effects params. I have a dream of many little norns games where all the controls and animations are also modulators.

9 Likes

I have a lot of neat little sketches that shouldn’t really have their own threads, so I will post them here, and you are all welcome to do the same :slight_smile:

Here’s one:

Etch N Sketch

local viewport = { width = 128, height = 64 }
local focus = { x = 0, y = 0, is_drawing = true }

-- Main

function init()
  -- Render Style
  screen.level(15)
  screen.aa(0)
  screen.line_width(1)
  -- Center focus
  focus.x = 0
  focus.y = viewport.height-1
  -- Render
  erase()
end

function toggle_drawing()
  if focus.is_drawing == true then
    focus.is_drawing = false
  else
    focus.is_drawing = true
  end
end

-- Interactions

function key(id,state)
  if id == 2 and state == 1 then
    erase()
  elseif id == 3 and state == 1 then
     toggle_drawing()
  end
end

function enc(id,delta)
  if id == 2 then
    focus.x = clamp(focus.x + delta,0,viewport.width-1)
  elseif id == 3 then
    focus.y = clamp(focus.y - delta,0,viewport.height-1)
  end
  redraw()
end

-- Render

function erase()
  screen.clear()
  draw_focus()
  screen.update()
end

function draw_focus()
  if focus.is_drawing == true then
    screen.pixel(focus.x,focus.y)
  end
  screen.fill()
end

function redraw()
  draw_focus()
  screen.update()
end

-- Utils

function clamp(val,min,max)
  return val < min and min or val > max and max or val
end
17 Likes

Makes me think of the OP-1 sketch sequencer :slight_smile:

3 Likes

@neauoire I love this! now to make it sequence lol

btw, re:

-- Utils
function clamp(val,min,max)
  return val < min and min or val > max and max or val
end

there is a norns util for clamping

util.clamp(value, min, max)
3 Likes

I’m working on something MASSIVE.

I should have a demo tomorrow. This needs a grid. Can’t wait to show you have I’ve been cooking.

24 Likes

Hype is real in 20 characters

1 Like

I’m glad to be spending a month in Europe, but all this time away from Norns - especially in light of @neauoire’s recent work - has been annoying.

5 Likes

head explodes in 255 chars
(the first stands for speachless)

1 Like

This is why I am bringing Norns with me to Europe :wink:

6 Likes

Sorry for building hype and not delivering, I’ve been going back and forth between two designs yesterday, but I think I got it now. Tonight I definitely will have a something to show for this :fist:

12 Likes

scripts within scripts! let’s all go down the rabbit hole together… :rabbit2:

4 Likes
10 Likes

That’s so complex my head hurts, but i’ll dive into it!

I built one of my favourite visual hello world in Norns

-- graph
--
-- graph sketch
-- key 2 adds node
-- key 3 removes node
-- enc 3 controls draw distance
--

local nodes = {}
local thresh = 30

function init()
  nodes = {
    _random_node(),
    _random_node(),
    _random_node(),
    }
end

function key(n,z)
  if n == 2 and z == 1 then
    -- add node
    table.insert(nodes, _random_node())
  end
  if n == 3 and z == 1 and #nodes > 0 then
    table.remove(nodes,1)
  end
end

function enc(n,d)
  if n==3 then
    -- clamp number of notes from 1 to 4
    thresh = math.min(128,(math.max(thresh + d,1)))
  end
  redraw()
end

function run()
  for i=1, #nodes do
    velocity = nodes[i].velocity
    
    nodes[i].location[1] = nodes[i].location[1] + velocity[1]
    nodes[i].location[2] = nodes[i].location[2] + velocity[2]
    
    x = nodes[i].location[1]
    y = nodes[i].location[2] 
    if (x < 0 or x > 128) then
      nodes[i].velocity[1] = nodes[i].velocity[1] * -1
    end
    
    if (y < 0 or y > 64) then
      nodes[i].velocity[2] = nodes[i].velocity[2] * -1
    end
  end
end
  
function redraw()
  screen.clear()
  screen.level(7)
  screen.aa(1)
  screen.line_width(1)
  
  for i=1, #nodes do
    -- draw
    for j=i, #nodes do
      x1 = nodes[i].location[1]
      y1 = nodes[i].location[2]
      x2 = nodes[j].location[1]
      y2 = nodes[j].location[2]
     if (_len(x1,y1,x2,y1) < thresh) then
        _line(x1,y1,x2,y2)
      end
    end
  end
  
    
  screen.update()
end

function update(sec)
  run()
  redraw()
end
  
function _random_node()
  return {
    location={math.random(128), math.random(64)},
    velocity={math.random(4) - 2, math.random(4) - 2}
  }
end

function _line(x1,y1,x2,y2)
  screen.move(x1,y1)
  screen.line(x2,y2)
  screen.close()
  screen.stroke()
end

function _len(x1,y1,x2,y2)
  return math.sqrt(
    math.pow(x2 - x1 ,2) +
    math.pow(y2 - y1 ,2)
    )
end

-- Interval

re = metro.init()
re.time = 1.0 / 15
re.event = function()
  update()
end
re:start()
7 Likes