More actions
Created page with "== Command language == The Ekdahl FAR is entirely controlled by ''commands'', these ''commands'' decide everything that the instrument is doing, whether it is playing a melody or changing an internal parameter. When a MIDI event occurs or a new CV / knob value is read, the ''commands'' associated with it will be internally sent. This can be things like "engage hammer" or "set the fundamental frequency" etc. Some of the available ''commands'' are mainly used for calib..." |
No edit summary |
||
Line 11: | Line 11: | ||
The ''commands'' are invoked using a ''plain text approach'', most commands have both a ''long name'' and a ''short name'' which are interchangeable. A ''command'' may have one or more ''parameters'' associated with it, these ''parameters'' can be of different types; 16-bit numbers (values 0 - 65535), floating point numbers (values with decimals), booleans (0 for 'false', 1 for 'true') and strings (text). Some commands are ''conditional'', meaning they will only execute if a parameter equates to '1' ('true'). | The ''commands'' are invoked using a ''plain text approach'', most commands have both a ''long name'' and a ''short name'' which are interchangeable. A ''command'' may have one or more ''parameters'' associated with it, these ''parameters'' can be of different types; 16-bit numbers (values 0 - 65535), floating point numbers (values with decimals), booleans (0 for 'false', 1 for 'true') and strings (text). Some commands are ''conditional'', meaning they will only execute if a parameter equates to '1' ('true'). | ||
The way ''commands'' are written in order to be executed is ''commandname:parameter1:parameter2:parameter3 [etc]'', several commands be executed in sequence by separating them with a comma (','). If for instance we would like to start the ''bowing wheel'' and set its frequency to 82.5 Hertz we could send the Ekdahl FAR the following | The way ''commands'' are written in order to be executed is ''commandname:parameter1:parameter2:parameter3 [etc]'', several commands be executed in sequence by separating them with a comma (','), a bunch of commands strung together is called a ''command string''. If for instance we would like to start the ''bowing wheel'' and set its frequency to 82.5 Hertz we could send the Ekdahl FAR the following ''command string''<pre> | ||
bowmotorrun:1, bowcontrolfrequecy:82.5 | bowmotorrun:1, bowcontrolfrequecy:82.5 | ||
</pre>We could also use the ''short names'' for the commands<pre> | </pre>We could also use the ''short names'' for the commands<pre>bmr:1,bcf:82.5</pre>Both ''bowmotorrun'' and ''bowcontrolfrequency'' takes one ''parameter'' each, ''bowmotorrun''s is ''conditional'' and unless the first ''parameter'' is equal to '1' the motor will not start. The first ''parameter'' of ''bowcontrolfrequency'' sets the frequency of the ''bowing wheel'', the instrument may not execute a ''command'' if it decides that the given ''parameters'' are outside of the working range or they are missing. | ||
bmr:1,bcf:82.5 | |||
</pre>Both ''bowmotorrun'' and ''bowcontrolfrequency'' takes one ''parameter'' each, ''bowmotorrun''s is ''conditional'' and unless the first ''parameter'' is equal to '1' the motor will not start. The first ''parameter'' of ''bowcontrolfrequency'' sets the frequency of the ''bowing wheel'', the instrument may not execute a ''command'' if it decides that the given ''parameters'' are outside of the working range or they are missing. | |||
To test out a ''command'' you can send it directly to the Ekdahl FAR using the ''Console'' in the ''Configuration utility''. | To test out a ''command'' you can send it directly to the Ekdahl FAR using the ''Console'' in the ''Configuration utility''. | ||
Line 24: | Line 22: | ||
What makes the ''Command language'' truly powerful is the concept of ''variables, functions'' and ''equations''. All ''parameters'' that take numerical values can use any combination of ''variables, functions'' or ''equations.'' | What makes the ''Command language'' truly powerful is the concept of ''variables, functions'' and ''equations''. All ''parameters'' that take numerical values can use any combination of ''variables, functions'' or ''equations.'' | ||
For instance, we can use the previous example and instead write our ''command string'' as follows<pre> | |||
bowmotorrun:1,bowcontrolfrequency:82.5+note*20 | |||
</pre>This example requires of course that the ''variable'' ''note'' exists in the current context. | |||
===== Variables ===== | |||
There are two types of ''variables'' in the Ekdahl FAR; ''global variables'' and ''event variables''. | There are two types of ''variables'' in the Ekdahl FAR; ''global variables'' and ''event variables''. | ||
''Global variables'' are variables that are always available and will exist in any context. The ''global variables'' that are incorporated in the ''firmware'' as of this writing (2025-01-21) are: | ''Global variables'' are variables that are always available and will exist in any context. The ''global variables'' that are incorporated in the ''firmware'' as of this writing (2025-01-21) are: | ||
* notecount - Contains the number of ''MIDI'' keys that are being held down, | * notecount - Contains the number of ''MIDI'' keys that are being held down, i.e. all ''Note on messages'' received that haven't gotten a paired ''Note off message'' yet | ||
* uv0 - uv9 - These are ''user variables'' and can be set at any point using the ''globaluservariable command'' with the first ''parameter'' being which variable to set (0-9) and the second ''parameter'' being the value (float). | * uv0 - uv9 - These are ''user variables'' and can be set at any point using the ''globaluservariable command'' with the first ''parameter'' being which variable to set (0-9) and the second ''parameter'' being the value (float). | ||