User Tools

Site Tools


apiref

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
apiref [2015/07/15 16:16]
richard
apiref [2015/07/15 16:18] (current)
richard
Line 44: Line 44:
 ---- ----
  
-===== Role(//name // string [null=auto assigned], ​//data//  ​object) =====+===== Role(name string [null=auto assigned], data object) =====
  
 Roles allow multiple performers to be grouped with the same events. //data // is optional and can contain any or all of the properties: //​key//,//​instrument//,​ //clef//, //​preamble//,​ //​maxPerformers// ​ which have the same definition as the accessible properties (below) after construction . Roles allow multiple performers to be grouped with the same events. //data // is optional and can contain any or all of the properties: //​key//,//​instrument//,​ //clef//, //​preamble//,​ //​maxPerformers// ​ which have the same definition as the accessible properties (below) after construction .
Line 86: Line 86:
 ==== Common Parameters ==== ==== Common Parameters ====
  
-**The order of __//name //__and //data // can be interchanged.**+**The order of**** //name // ****and ​//data // can be interchanged.**
   * //name // string, the name of the event, auto-assigned if null.   * //name // string, the name of the event, auto-assigned if null.
   * //​data// ​ object, optional, containing the following. These reflect parameters given in //new Performance()// ​ and fallback to the default described in the Performance reference if not supplied.   * //​data// ​ object, optional, containing the following. These reflect parameters given in //new Performance()// ​ and fallback to the default described in the Performance reference if not supplied.
Line 111: Line 111:
   * //​throbAdapt// ​ bool   * //​throbAdapt// ​ bool
  
-===== TextEvent(//text // string, ​//name // string [null=auto assigned], ​//data // object) =====+===== TextEvent(text string, name string [null=auto assigned], data object) =====
  
 ==== Parameters ==== ==== Parameters ====
Line 125: Line 125:
 </​code>​ </​code>​
  
-===== HtmlEvent(//html // string, ​//name // string [null=auto assigned], ​//data // object) =====+===== HtmlEvent(html string, name string [null=auto assigned], data object) =====
  
 ==== Parameters ==== ==== Parameters ====
Line 138: Line 138:
 new HtmlEvent("<​h1>​Hello<​small>​World</​small></​h1>",​ {throb: false}); new HtmlEvent("<​h1>​Hello<​small>​World</​small></​h1>",​ {throb: false});
 </​code>​ </​code>​
-===== ScoreEvent(//score // string, ​//name // string [null=auto assigned], ​//data // object) =====+===== ScoreEvent(score string, name string [null=auto assigned], data object) =====
  
 ==== Parameters ==== ==== Parameters ====
Line 153: Line 153:
 </​code>​ </​code>​
  
-===== ImageEvent(//imageName ​// string, ​//name // string [null=auto assigned], ​//data // object) =====+===== ImageEvent(imageName string, name string [null=auto assigned], data object) =====
  
 ==== Parameters ==== ==== Parameters ====
Line 166: Line 166:
 new ImageEvent("​hello.jpg"​);​ new ImageEvent("​hello.jpg"​);​
 </​code>​ </​code>​
-===== ScriptEvent(//initScript ​// mixed, ​//runScript ​// mixed //name // string [null=auto assigned], ​//data // object) =====+===== ScriptEvent(initScript mixed, runScript mixed name string [null=auto assigned], data object) =====
  
 ==== Parameters ==== ==== Parameters ====
Line 212: Line 212:
 As with Events, the order of //​name// ​ and //​data// ​ can be interchanged. As with Events, the order of //​name// ​ and //​data// ​ can be interchanged.
  
-===== KeyboardTrigger(//role//  ​mixed//, name // string [null=auto assigned], ​//data // object) =====+===== KeyboardTrigger(role mixed, name string [null=auto assigned], data object) =====
  
 ==== Parameters ==== ==== Parameters ====
Line 233: Line 233:
 ---- ----
  
-====== perform(//role//  ​mixed, ​//event // mixed, ​//duration ​// mixed) ======+====== perform(role mixed, event mixed, duration mixed) ======
  
 Instructs the role to perform an event for a specified duration in milliseconds. \\ //​role// ​ can be the name of a role, or a variable referencing the actual role object (eg //​roles.Lead //) \\ //​event// ​ can be the name of an event as a string, or a variable referencing the actual event object (eg. //​events.ev1//​). \\ //duration // may be a numerical value or a reference to a trigger. If a trigger is used, the event will be held with no specific duration until the trigger condition is met. \\ Instructs the role to perform an event for a specified duration in milliseconds. \\ //​role// ​ can be the name of a role, or a variable referencing the actual role object (eg //​roles.Lead //) \\ //​event// ​ can be the name of an event as a string, or a variable referencing the actual event object (eg. //​events.ev1//​). \\ //duration // may be a numerical value or a reference to a trigger. If a trigger is used, the event will be held with no specific duration until the trigger condition is met. \\
Line 242: Line 242:
 perform(roles.Bass,​ "​event1",​ 5000); perform(roles.Bass,​ "​event1",​ 5000);
 </​code>​ </​code>​
-====== delegate(//role//  ​mixed, ​//exec//  ​function) ======+====== delegate(role mixed, exec function) ======
  
 Executes code specifically in the control thread of a role. \\ //​role// ​ can be the name of a role as a string or a variable referencing the actual role object (eg //​roles.Lead //) Executes code specifically in the control thread of a role. \\ //​role// ​ can be the name of a role as a string or a variable referencing the actual role object (eg //​roles.Lead //)
Line 256: Line 256:
 ====== dftool ====== ====== dftool ======
  
-===== dftool.rand(//param//  ​mixed, ​//param // int) =====+===== dftool.rand(param mixed, param int) =====
  
 Depending on the argument type(s), a different result will be returned. Only one permutation requires the second argument to be given: Depending on the argument type(s), a different result will be returned. Only one permutation requires the second argument to be given:
apiref.txt ยท Last modified: 2015/07/15 16:18 by richard