Cannot use playdate.sound.signal setOffset() or setScale() Methods with controlsignal or LFO

I have only tried this in the Windows simulator (3.0.1).

Test Procedure

  1. Get a reference to a playdate.sound.controlsignal or LFO by any means
  2. Attempt to set the signal’s offset or scale using the signal:setOffset() or signal:setScale() methods

Expected Result

-The controlsignal or LFO can be offset or scaled

Actual Result

-Lua error: “method 'setScale' is not callable (a nil value)” or “method 'setOffset' is not callable (a nil value)”

Naturally I expected this to be valid since the API lists LFOs and controlsignals as signals– besides that they are essential functions for transforming CC automation events from MIDI scores. Using these methods with envelopes doesn’t seem to throw any errors, though I’m not sure if it’s actually working yet.


Example 1:

testSignal = playdate.sound.controlsignal.new()
testSignal:setOffset(1)
method 'setOffset' is not callable (a nil value)

Example 2:

testSignal = playdate.sound.lfo.new()
testSignal:setScale(2)
method 'setScale' is not callable (a nil value)

Example 3:

testSignal = playdate.sound.envelope.new()
testSignal:setOffset(1)
testSignal:setScale(2)

This example executes fine.

Thanks for catching that! I've added those and even though it's technically an API addition I've got it scheduled for 3.0.2. (By strict semantic versioning we'd have to bump it to 3.1 when we touch the API but I think it's okay to let this one squeak by.) Note that the LFO class does have those functions.. but they're named differently: setDepth() and setCenter(), to match standard synth nomenclature. In 3.0.2 I've got them available with the signal naming as well.

1 Like