Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
blocks:lighting:fixture_definitions [2018-01-25 08:07]
admin [File Format]
blocks:lighting:fixture_definitions [2021-03-05 12:26] (current)
admin Link to app note in case something else links here.
Line 1: Line 1:
-====== Blocks Lighting Fixture Definitions ====== +This page has movedand is now found [[blocks:app-note:art-net-dmx|here]].
- +
-A fixture definition describes a lighting instrumentsuch as a multi-color light or a moving-head light, controllable over Artnet/DMX-512. Using such a definition makes it easier to use by assigning meaningful names to its functions, rather than working with raw DMX channel numbers.  +
- +
-A set of lighting fixture definitions usable with PIXILAB Blocks can be found here: +
- +
-https://github.com/pixilab/blocks-fixtures +
- +
-To use any of these definitions, do as follows: +
- +
-  Download the entire github repo as a ZIP and unpack (or clone the repo if yu're familiar with git). +
-  - Copy the desired brand name folder(s) into the //fixtures// directory located inside your PIXILAN-root directory. +
- +
-The fixture definitions now appear grouped by brand and model under //Manage, Artnet// in Blocks.  +
- +
-A few basic and common fixture types can be found under the //Generic// brand. Due to the simple file format, it's quite easy to add a definition for other fixtures you want to use with Blocks, based on the information found below. +
- +
-**NOTE:** These definitions were partially derived from the excellent //Open Fixtures Library// found at https://open-fixture-library.herokuapp.com +
-==== Folder/File Structure ==== +
- +
-The //fixtures// directory holds a simple folder/file structure: +
- +
-  * It contains one subdirectory per supported brand, plus one named //Generic//, containing a few common definitions that aren't brand specific. +
-  * Inside each subdirectory, there's a description file for each fixture, with the fixture's model name. These files have a //.json// extension, and are formatted according to the JSON standard. +
- +
-==== File Format ==== +
- +
-The format of the data in each description file is defined by the following types (using //[[https://www.typescriptlang.org/docs/handbook/interfaces.html|typescript]]// notation), where the top level object is of the FixtureDescriptor type: +
- +
-<code> +
-interface FixtureDescriptor { +
-  channels: Channel[];  // The channels supported by this fixture +
-  note: string;  // Notes related to this fixture +
-+
- +
-interface Channel extends Named { +
-  type: ChannelTypes; +
-  defaultValue?: number; // What value to set channel to on system start-up (not normalized) +
-  normalized?: boolean; // Exposed as 0...1 value (else with its full range depending on resolution) +
-  hidden?: boolean; // Not shown in UI (used to represent "gaps" in the channel sequence) +
-  ranges?: Range[]; // When type is Ranges +
-+
- +
-type ChannelTypes = 'Analog//8'|'Analog//16'|'Analog//24'|'Ranges'; +
- +
-interface Range extends Named { +
-  first: number; last: number;  // First and last value corresponding to this mode +
-  discrete?: boolean; // Is discrete (single enum) value only, with no "range" within +
-+
-</code> +
- +
-Each FixtureDescriptor contains a list of channels. A channel can be of one of four types, where the first three represent an analog value wth 8, 16 or 24 bits resolution (mapping to one, two or three DMX channels). Such an analog value can also accept the following optional properties: +
- +
-  * **defaultValue** specifies the initial value of the channel. If not specified, the initial value will be zero. +
-  * **normalized** set to true indicates that the value will be presented as 0...1 in the user interface. If not specified, or set to false, the value will be represented by its full numeric span (e.g., 0...255 for an 8-bit channel, 0...65535 for a 16-bit channel) +
-  * **hidden** set to true hides the channel from the user interface, thereby blocking out "unused" slots in the channel space. +
- +
-Alternatively the type is defined as 'Ranges', which describes a channel divided into sub-ranges,  consisting of a number of consecutive values. These ranges are defined in the //ranges// array, specifying the lower and upper limits of each range.  +
- +
-If a range describes a single state (e.g., "strobe off"), the //discrete// flag is set to indicate this. Otherwise, the range is considered to also have a numeric value, mapping into whatever range is specified (e.g., a varying "strobe rate"). +
-==== Example File ==== +
- +
-Here's an example of what the content of a description file can look like, taken from the generic //Pan Tilt// model: +
- +
-<code> +
-+
-  "note": "Moving Head, 8-bit", +
-  "channels":+
-    { +
-      "name": "Pan", +
-      "type": "Analog_8", +
-      "normalized": true, +
-      "defaultValue": 127 +
-    }, { +
-      "name": "Tilt", +
-      "type": "Analog_8", +
-      "normalized": true, +
-      "defaultValue": 127 +
-    } +
-  ] +
-+
-</code>+