| grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object-Free API » SelectionNext() | Version 2.2 |
SelectionNext 関数は、引数で指定されたインデックス番号に基づいて、セレクション内の次のフィクスチャに関する整数セットを返します。これには、パッチ・インデックス番号と、Selection Grid 内の XYZ グリッド値が含まれます。
返される4つの整数をすべて使う必要はありませんが、それらは順番に返されます。
現在のセレクションにあるすべてのフィクスチャのパッチ・インデックス番号とグリッド位置を出力します。
Lua |
return function() -- Store the return in a local variable local fixtureIndex, gridX, gridY, gridZ = SelectionFirst() -- Cancel the plugin if no fixture is selected assert(fixtureIndex,"Please select a (range of) fixture(s) and try again.") -- Loop that prints the index and gridpositions of all the fixtures in the selection while fixtureIndex do Printf('The fixture has index number: %i and gridposition %i / %i / %i', fixtureIndex, gridX, gridY, gridZ); -- Here is SelectionNext actually used to find the next fixture in the selection fixtureIndex, gridX, gridY, gridZ = SelectionNext(fixtureIndex) end end |