Bistro

thank you @dan_derks! :bowing_man:

Midi out is wonderful. Thank you @dan_derks !

Unfortunately, still having the issue with everything freezing when changing away from the play page.

1 Like

Same here bistro freezes when changing something in the other pages than play

1 Like

I just updated Bistro for use with midigrid and while the script loads with no errors, no lights on the launch pad mini mk3s. When I turn encoder 2 on the Norns, these are the errors in Maiden (over and over)

	/home/we/norns/lua/core/encoders.lua:60: in function 'core/encoders.process'
lua: 
/home/we/norns/lua/core/paramset.lua:361: attempt to concatenate a nil value (local 'index')
stack traceback:
	/home/we/norns/lua/core/paramset.lua:361: in function 'core/paramset.lookup_param'
	/home/we/norns/lua/core/paramset.lua:280: in function 'core/paramset.delta'
	/home/we/norns/lua/core/menu/params.lua:325: in function 'core/menu/params.enc'
	/home/we/norns/lua/core/menu.lua:113: in function 'core/encoders.callback'
	/home/we/norns/lua/core/encoders.lua:60: in function 'core/encoders.process'
lua: 
/home/we/norns/lua/core/paramset.lua:361: attempt to concatenate a nil value (local 'index')
stack traceback:
	/home/we/norns/lua/core/paramset.lua:361: in function 'core/paramset.lookup_param'
	/home/we/norns/lua/core/paramset.lua:280: in function 'core/paramset.delta'
	/home/we/norns/lua/core/menu/params.lua:325: in function 'core/menu/params.enc'
	/home/we/norns/lua/core/menu.lua:113: in function 'core/encoders.callback'
	/home/we/norns/lua/core/encoders.lua:60: in function 'core/encoders.process'
lua: 
/home/we/norns/lua/core/paramset.lua:361: attempt to concatenate a nil value (local 'index')
stack traceback:
	/home/we/norns/lua/core/paramset.lua:361: in function 'core/paramset.lookup_param'
	/home/we/norns/lua/core/paramset.lua:280: in function 'core/paramset.delta'
	/home/we/norns/lua/core/menu/params.lua:325: in function 'core/menu/params.enc'
	/home/we/norns/lua/core/menu.lua:113: in function 'core/encoders.callback'
	/home/we/norns/lua/core/encoders.lua:60: in function 'core/encoders.process'

and more errors on encoder 3 as well:

	/home/we/norns/lua/core/paramset.lua:280: in function 'core/paramset.delta'
	/home/we/dust/code/bistro/bistro.lua:264: in function 'enc'
	/home/we/norns/lua/core/encoders.lua:60: in function 'core/encoders.process'
lua: 
/home/we/norns/lua/core/paramset.lua:361: invalid paramset index: pw
stack traceback:
	[C]: in function 'error'
	/home/we/norns/lua/core/paramset.lua:361: in function 'core/paramset.lookup_param'
	/home/we/norns/lua/core/paramset.lua:280: in function 'core/paramset.delta'
	/home/we/dust/code/bistro/bistro.lua:264: in function 'enc'
	/home/we/norns/lua/core/encoders.lua:60: in function 'core/encoders.process'
lua: 
/home/we/norns/lua/core/paramset.lua:361: invalid paramset index: pw
stack traceback:
	[C]: in function 'error'
	/home/we/norns/lua/core/paramset.lua:361: in function 'core/paramset.lookup_param'
	/home/we/norns/lua/core/paramset.lua:280: in function 'core/paramset.delta'
	/home/we/dust/code/bistro/bistro.lua:264: in function 'enc'
	/home/we/norns/lua/core/encoders.lua:60: in function 'core/encoders.process'

UPDATE:
Following up on this thread here: I’ve updated the script since my initial post and still getting the same errors.

Has anyone gotten bistro to work with the midigrid library?

If I understand correctly, all that is needed for midigrid support is updating local g on line 13 of bistro.lua to the following: local g = util.file_exists(_path.code.."midigrid") and include "midigrid/lib/mg_128" or grid

NOTE: the same above errors occur with encoders when the midigrid support code is removed and nothing is connected. On Parameters/EDIT/pattern data > Turning E2 reports same errors as above and E3 crashes the params page altogether (blank screen)…

For those struggling with freeze after switching pages…

I found that it is the third page “Lengths” causing the trouble. If you can live with not changing lenghts of patterns you may change line 16 in the Bistro.lua and delete

, “LENGTHS”

from the line. save. run. Presto. No more freezees. consider it a (temporary) workaround.

4 Likes

alright, turns out my previous comments about impossible support of non-square grids where moot.
(i didn’t know how press cafe works, i.e. patterns are not locked to colums but rows. bistro's switch to a horizontal view IS the correct way to support 128 grids).

turns out it appeared to be a small bug near the end of the code (hard to debug if you code on a 64).

i just did a PR.

9 Likes

Great news - appreciate the 128 debugging as I don’t own one myself. I’ll merge this later today when I get back home. Thanks!!

6 Likes

Just merged the PR for 128 support. Thanks again @eigen, really appreciate the help.

6 Likes

I updated my post above - it seems like bistro still has some issues after this latest update?

The encoder errors come from the fact that they are assigned to parameters that don’t exist.

Following parameters can be found in the karplus_rings.lua file:

karplus_rings.lua
-- karplus_rings

local cs = require 'controlspec'

local karplus_rings = {}

function karplus_rings.params()
  params:add {
    type = 'control',
    id = 'amp',
    name = 'amp',
    controlspec = cs.new(0, 1, 'lin', 0, 0.75, ''),
    action = engine.amp
  }

  params:add {
    type = 'control',
    id = 'damping',
    name = 'damping',
    controlspec = cs.new(0.1, 10, 'lin', 0, 3.6, 's'),
    action = engine.decay
  }

  params:add {
    type = 'control',
    id = 'brightness',
    name = 'brightness',
    controlspec = cs.new(0, 1, 'lin', 0, 0.11, ''),
    action = engine.coef
  }

  params:add {
    type = 'control',
    id = 'lpf_freq',
    name = 'lpf_freq',
    controlspec = cs.new(100, 10000, 'lin', 0, 3600, ''),
    action = engine.lpf_freq
  }

  params:add {
    type = 'control',
    id = 'lpf_gain',
    name = 'lpf_gain',
    controlspec = cs.new(0, 3.2, 'lin', 0, 0.5, ''),
    action = engine.lpf_gain
  }

  params:add {
    type = 'control',
    id = 'bpf_freq',
    name = 'bpf_freq',
    controlspec = cs.new(100, 9000, 'lin', 0, 1200, ''),
    action = engine.bpf_freq
  }

  params:add {
    type = 'control',
    id = 'bpf_res',
    name = 'bpf_res',
    controlspec = cs.new(0.05, 2.5, 'lin', 0, 0.5, ''),
    action = engine.bpf_res
  }
end

return karplus_rings

if you change "cutoff" and "pw" in the snippet below (line 259) to any of the parameter id’s found in the karplus_rings.lua file the errors you mention disappear.

  if page == 1 then
    -- PLAY
    if n == 2 then
      params:delta("cutoff", d)
    elseif n == 3 then
      params:delta("pw", d)
    end
  end

not sure what would make sense… maybe something like this:

  if page == 1 then
    -- PLAY
    if n == 2 then
      params:delta("lpf_freq", d)
    elseif n == 3 then
      params:delta("damping", d)
    end
  end

Ok, thank you so much for finding out how to resolve the errors. So is this a bug in bistro then? I haven’t been able to run it on my norns yet - I just noticed these errors in maiden when trying to get the script running with midigrid.

after updating to the newest shield firmware, this doesn’t load anymore with the karplus missing message, BUT I cannot find WE anymore in maiden?

hi Markus!

re: we:

in response to this, I worked with @GoneCaving to migrate the Karplus engine into the awake-rings project! a quick install of awake-rings via maiden (or ;install https://github.com/GoneCaving/awake-rings) and a RESTART should get you going!

2 Likes

thanks for that! Unfortunately it didn’t work and my knowledge is too limited to understand the error message

# script clear
# script load: /home/we/dust/code/bistro/bistro.lua
### MISSING INCLUDE: we/lib/karplus_rings
### SCRIPT ERROR: load fail
/home/we/dust/code/bistro/bistro.lua:9: MISSING INCLUDE: we/lib/karplus_rings
stack traceback:
	/home/we/norns/lua/core/norns.lua:146: in function </home/we/norns/lua/core/norns.lua:146>
	[C]: in function 'error'
	/home/we/norns/lua/core/startup.lua:48: in function 'include'
	/home/we/dust/code/bistro/bistro.lua:9: in main chunk
	[C]: in function 'dofile'
	/home/we/norns/lua/core/script.lua:192: in function </home/we/norns/lua/core/script.lua:192>
	[C]: in function 'xpcall'
	/home/we/norns/lua/core/norns.lua:147: in field 'try'
	/home/we/norns/lua/core/script.lua:192: in function 'core/script.load'
	/home/we/norns/lua/core/menu/preview.lua:23: in function 'core/menu/preview.key'
	/home/we/norns/lua/core/menu.lua:143: in function </home/we/norns/lua/core/menu.lua:120>
# script clear
lua: /home/we/norns/lua/core/clock.lua:59: bad argument #1 to 'resume' (thread expected)
stack traceback:
	[C]: in function 'coroutine.resume'
	/home/we/norns/lua/core/clock.lua:59: in function 'core/clock.resume'

ah, we’re halfway there! totally forgot about that file at we/lib/karplus_rings.lua! i’ve suggested adding it to the awake-rings repo, which should require just a small change to the bistro script: add lua file for parameters! by dndrks · Pull Request #5 · GoneCaving/awake-rings · GitHub

2 Likes

Thanks @dan_derks, I’ve merged that PR. Your help in keeping this working for everyone is very much appreciated!

4 Likes

rad, happy to help!
@Markus , if you wanna get groovin’ before the bistro PR is approved:

  • update awake-rings via maiden, which will grab the additional file (thank you @GoneCaving for the quick approval!)
  • change line 9 in bistro to:
    local rings = include("awake-rings/lib/karplus_rings")
2 Likes

merged, thanks dan! (in twenty chars I guess, which I could have sworn I’d hit)


BOLD WARNING THING FOR NEW USERS

Please install awake-rings in addition to bistro when first using this script!

I’d add it to the top post but it’s too old to edit :slight_smile:

3 Likes

made it a wiki, so it should be historically editable!

2 Likes

Thanks so much @cfd90, @GoneCaving and @dan_derks! It works now :slight_smile:

5 Likes