monome / norns

norns is many sound instruments.
http://monome.org
GNU General Public License v3.0
621 stars 144 forks source link

softcut.defaults() is broken #988

Closed andr-ew closed 4 years ago

andr-ew commented 4 years ago

just looks like a typo, I assume - PR incoming

andr-ew commented 4 years ago

a PR !

https://github.com/monome/norns/pull/989

andr-ew commented 4 years ago

eeeep - sorry to beat a dead horse but the function is still broken I believe. I have this pasted in a script right now & it works

local SC = softcut

function SC.defaults()
   zeros = {}
   for i=1, SC.VOICE_COUNT do zeros[i] = 0 end

   local state = {}
   for i=1,SC.VOICE_COUNT do
     state[i] = {}

     state[i].enable = 0
     state[i].play = 0
     state[i].record = 0

     state[i].buffer = (i%2 + 1)
     state[i].level =0
     state[i].pan = 0

     state[i].level_input_cut = {0,0}
     state[i].level_cut_cut = zeros

     state[i].rate = 1
     state[i].loop_start = (i-1)*2
     state[i].loop_end = (i-1)*2+1
     state[i].loop = 1

     state[i].fade_time =  0.0005
     state[i].rec_level = 0
     state[i].pre_level = 0
     state[i].rec = 0
     state[i].rec_offset = -0.00015
     state[i].position = 0

     state[i].pre_filter_fc = 16000
     state[i].pre_filter_dry = 0
     state[i].pre_filter_lp = 1
     state[i].pre_filter_hp = 0
     state[i].pre_filter_bp = 0
     state[i].pre_filter_br = 0
     state[i].pre_filter_fc_mod = 1

     state[i].post_filter_fc = 12000
     state[i].post_filter_dry = 0
     state[i].post_filter_lp = 0
     state[i].post_filter_hp = 0
     state[i].post_filter_bp = 0
     state[i].post_filter_br = 0

     state[i].level_slew_time = 0.001
     state[i].rate_slew_time = 0.001
     state[i].phase_quant = 1
     state[i].phase_offset = 0
  end
  return state
end

using it in a lib rn hence all the bothering.

andr-ew commented 4 years ago

state[i] also wasn't initialized

sorry not sure how useful my random PRs are - just wanted to let u know