Jump to content


Photo

[Fixed 2.8.2] Lua Api: ...plugin_Device:parameter() --Unknown Property


  • This topic is locked This topic is locked
2 replies to this topic

#1 JupiterXLI

JupiterXLI

    Member

  • Normal Members
  • PipPip
  • 40 posts

Posted 27 August 2012 - 07:17

Don't know if this is a bug or a documentation error.

-- Access to a single parameter by index. Use properties 'parameters' to iterate 
-- over all parameters and to query the parameter count.
renoise.song().instruments[].plugin_properties.plugin_device:parameter(index)
  -> [renoise.DeviceParameter object]

>>> oprint(renoise.song().instruments[1].plugin_properties.plugin_device:parameter(1))
*** [string "oprint(renoise.song().instruments[1].plugin..."]:1: unknown property or function 'parameter' for an object of type 'InstrumentDevice'
*** stack traceback:
***   [C]: in function '_error'
***   [string "do..."]:47: in function <[string "do..."]:35>
***   [string "oprint(renoise.song().instruments[1].plugin..."]:1: in main chunk

"renoise.song().instruments[].plugin_properties.plugin_device.parameters[].name" works just fine.

#2 vV

vV

    God's or Borg's Chief and Ruler of All Species

  • Moderator
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 16855 posts
  • Gender:Male
  • Location:Netherlands

Posted 27 August 2012 - 20:50




>>> oprint(renoise.song().instruments[3].plugin_properties.plugin_device.parameters[1])

class: DeviceParameter

 properties:

    is_automatable

    is_automated

    is_automated_observable

    is_midi_mapped

    is_midi_mapped_observable

    name

    polarity

    show_in_mixer

    show_in_mixer_observable

    time_quantum

    value

    value_default

    value_max

    value_min

    value_observable

    value_quantum

    value_string

    value_string_observable

 methods:

    __STRICT

    record_value


Vv....


cpu Intel Core i7-4820K @3.70GHz
chipset Intel X79 chipset
mem 32 Gb 2400Mhz
os Win 7 64-bit SP1, DirectX 11
audio ESI ESP1010e - > Driver rev:2.0.6.0
video nVidia Geforce GTX780 - > Driver rev:335.23


Renoise Official Manual

#3 taktik

taktik

    Renoise Developer

  • Admins
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 15040 posts
  • Gender:Male
  • Location:Berlin, Germany
  • Interests:füße waschen

Posted 28 August 2012 - 12:17

We indeed forgot to implement this guy. Will fix this.

Using "plugin_device.parameters[]" will do the job too. "parameter(i)" may be a bit more efficient depending on what exactly you do, but else does exactly the same thing.

If you are running into performance troubles, make a copy of "parameters" in "for" loops like:

local parameters = some_plugin_device.parameters
for something do
  parameters[i].something
end

-- instead of 
for something do
  some_plugin_device.parameters[i].something
end