Skip to content

syntax 2.0

Simon van der Veldt edited this page Apr 5, 2019 · 14 revisions

scripting syntax updates for 2.0

NEW

softcut

softcut is independent of the engine system.

softcut.enable(voice,value)

softcut.level(voice,value)
softcut.pan(voice,value)

softcut.level_input_cut(ch,voice,value)
softcut.level_cut_cut(src,dst,value)

softcut.rate(voice,val)

softcut.play(voice,val)
softcut.position(voice,val)
softcut.fade_time(voice,val)

softcut.loop(voice,val)
softcut.loop_start(voice,val)
softcut.loop_end(voice,val)

softcut.rec(voice,val)
softcut.rec_level(voice,val)
softcut.pre_level(voice,val)
softcut.rec_offset(voice,val)

softcut.voice_sync(src,dst,value)

softcut.level_slew_time(voice,val)
softcut.rate_slew_time(voice,val)

softcut.buffer(voice,index)
softcut.buffer_clear()
softcut.buffer_clear_channel(ch)
softcut.buffer_clear_region(start,stop)
softcut.buffer_clear_region_channel(ch,start,stop)
softcut.buffer_read_mono(file, start_src, start_dst, dur, ch_src, ch_dst)
softcut.buffer_read_stereo(file, start_src, start_dst, dur)

softcut.phase_quant(voice,value)
softcut.poll_start_phase()
softcut.poll_stop_phase()
softcut.event_phase(f) -- sets phase callback function

tape

audio.tape_play_open(file)
audio.tape_play_start()
audio.tape_play_stop()
audio.tape_record_open(file)
audio.tape_record_start()
audio.tape_record_stop()

mix

TODO cross-reference signal flow chart

FIXME this should likely be inside a params sub-group rather than direct-accessed?

audio.level_adc(l)
audio.level_dac(l)
audio.level_ext(l)
audio.level_monitor(l)
audio.level_tape(l)
audio.level_cut(l)

audio.monitor_mono()
audio.monitor_stereo()

audio.level_adc_cut(l)
audio.level_ext_cut(l)

audio.rev_on()
audio.rev_off()
audio.rev_param(name, val)
audio.level_ext_rev(l)
audio.level_monitor_rev(l)
audio.level_cut_rev(l)
audio.level_rev_dac(l)

audio.comp_on()
audio.comp_off()
audio.comp_param(name, val)
audio.comp_mix(val)

devices

  • arc
  • hid

BREAKING CHANGES

metro

  • metro.alloc() -> metro.init()

old initialize function syntax works ie:

cb = function(x) print(x) end
q = metro(cb, 1, -1)

but there is now a new syntax as well:

m = metro.init()
n = metro.init{event = function(x) print(x) end}
o = metro.init{time = 2, count = 10, event = function(x) print(x) end}
  • instance callback function renamed, ie: m.callback -> m.event

dust script fix

  • metro.alloc() -> metro.init()
  • m.callback -> m.event (where m is metro instance`)

devices / vports

  • instance methods use colon instead of dot, ie g.led(...) -> g:led(...)
  • grid callback function renamed g.event -> g.key
  • device attached() function no longer present. check g.device for nil instead.

dust script fix

  • all grid commands led, all, refresh must be changed from dot to colon
  • grid instances g.event -> g.key
  • grid dimensions g.rows() -> g.rows and g.cols() -> g.cols
  • g.attached() -> g.device
  • all midi commands must be changed from dot to colon

norns study must be updated!

softcut is no longer an SC engine

it's built-in. see the top of this document for commands. we can you help port softcut scripts, get in touch!

beatclock lib

  • for some scripts, menu list selection of ports needs to be updated to vport system

ie in awake line 156 below

154   params:add{type = "number", id = "midi_out_device", name = "midi out device",
155     min = 1, max = 4, default = 1,
156     action = function(value) midi_out_device = midi.connect(value) end}

include paths

libraries and include paths have been moved in 2.0, which means some 1.0 include paths (ie. for requiring engine lua libraries like require 'jah/ack' or require 'jah/formatters') has to be updated (ie. to require 'ack' and require 'formatters').

psets

psets read and written by params:read and params:write are not done so from the same folders as in 1.0 and the pset path need to be updated (if subdirectory was included in the pset path it's likely not needed anymore).

You can’t perform that action at this time.