robbielyman / seamstress

seamstress is an art engine
GNU General Public License v3.0
129 stars 12 forks source link

feat: clean up 'number' params instantiation #85

Closed dndrks closed 1 year ago

dndrks commented 1 year ago

hiiii!

this PR addresses the conditions which led to @sonocircuit's note in the norns study group:

one thing that does not work on seamstress is returning the note value in the params instead of the number. this works on norns: params:add_number("root_note", "root note", 24, 84, 60, function(param) return mu.note_num_to_name(param:get(), true) end) but returns a concat error in seamstress

new

test script

local mu = require 'musicutil'

function init()
  params:add_number("norns_style-no_wrap_root_note", "root note", 24, 84, 60, function(param)
    return mu.note_num_to_name(param:get(), true)
  end)
  params:add_number("norns_style-wrap_root_note", "root note", 24, 84, 60, function(param)
    return mu.note_num_to_name(param:get(), true)
  end, true)
  params:add{
    type = "number",
    id = "wrap_root_note",
    name = "root note",
    min = 24,
    max = 84,
    default = 60,
    formatter = function(param)
      return mu.note_num_to_name(param:get(), true)
    end,
    wrap = true
  }
end

testing well over here, please lmk if there's anything wonky tho!!