More actions
No edit summary |
No edit summary |
||
| Line 13: | Line 13: | ||
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''. | 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''. | ||
Since version 1.1 of the Ekdahl FAR Firmware, all commands are grouped in a hierarchical fashion according to their ''modules'' and each ladder in the hierarchy is separated by a period ("."), this works very much like folders or directories in a regular computer. Every ''module'' can contain both ''commands'' and other ''modules''. | Since version 1.1 of the Ekdahl FAR Firmware, all commands are grouped in a hierarchical fashion according to their ''modules'' and each ladder in the hierarchy is separated by a period ("."), this works very much like folders or directories in a regular computer. Every ''module'' can contain both ''commands'' and other ''modules''. For instance, everything associated with the ''bowing wheel'' is now collected under "bowingwheel" ''module''. That in turn contains a "dcmotor" ''module'' which handles direct control of the bowing motor. It also has a "pid" ''module'' that handles bow frequency among other thing. | ||
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>FAR < 1.1: | 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>FAR < 1.1: | ||
| Line 25: | Line 25: | ||
FAR 1.1: | FAR 1.1: | ||
bw.dcm.ru:1, bw.pid.tf:82.5</pre>Both | bw.dcm.ru:1, bw.pid.tf:82.5</pre>Both "bowmotorrun" / "bowingwheel.dcmotor.run" and "bowcontrolfrequency" / "bowingwheel.pid.targetfrequency" takes one ''parameter'' each, ''"''bowmotorrun" / "bowingwheel.dcmotor.run" is ''conditional'' and unless the first ''parameter'' is equal to '1' the motor will not start. The first ''parameter'' of "bowcontrolfrequency" / "bowingwheel.pid.targetfrequency" 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. | ||
The addition of the hierarchy in the FAR 1.1 firmware isn't just to be able to group commands, but it's also to make the FAR not limited to a single set of ''modules'' (and is the first stepping stone to a ''modular'' Ekdahl FAR). In fact, you could have 12 different bowing wheel ''modules'' for 12 different strings, these would then be addressed as | The addition of the hierarchy in the FAR 1.1 firmware isn't just to be able to group commands, but it's also to make the FAR not limited to a single set of ''modules'' (and is the first stepping stone to a ''modular'' Ekdahl FAR). In fact, you could have 12 different bowing wheel ''modules'' for 12 different strings, these would then be addressed as "bowingwheel[0].command"'', "''bowingwheel[1].command" etc. Anyone familiar with C programming notices that this is the standard way of ''indexing'' an array; using brackets ("[ ]"). When addressing a module without ''indexing'' as in the example above, the FAR will do one or two things; either use the first object ("[0]") or, if the object is ''selectable'' it will use the previously selected object. To make things smoother a command can be executed on several objects at once by using ranges ("[0-4]") and comma separation ("[0, 3, 5-6]"). | ||
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 45: | Line 45: | ||
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 | ''Global variables'' are variables that are always valid, 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, i.e. all ''Note on messages'' received that haven't gotten a paired ''Note off message'' yet | * '''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 | ||
| Line 61: | Line 61: | ||
* '''pitch''' - Set by the ''Pitch bend MIDI message'' | * '''pitch''' - Set by the ''Pitch bend MIDI message'' | ||
* '''program''' - Set by the ''Program change MIDI message'' | * '''program''' - Set by the ''Program change MIDI message'' | ||
These variables will contain whatever data is relevant to the | These variables will contain whatever data is relevant to the last event that occurred and may be overwritten by the next event. | ||
===== Functions ===== | ===== Functions ===== | ||
| Line 95: | Line 95: | ||
</pre>The previous statements starts the ''bowing wheel'' and sets the frequency of the wheel to ''8.17579875 * 2^(1/12 * note)''. A middle 'C' according to ''MIDI'' has a ''note value'' of 36, meaning if we substitute ''note'' with 36 we get the equation ''8.17579875 * 2^(1/12 * 36)'' which comes out to ''~65.4'' Hertz. | </pre>The previous statements starts the ''bowing wheel'' and sets the frequency of the wheel to ''8.17579875 * 2^(1/12 * note)''. A middle 'C' according to ''MIDI'' has a ''note value'' of 36, meaning if we substitute ''note'' with 36 we get the equation ''8.17579875 * 2^(1/12 * 36)'' which comes out to ''~65.4'' Hertz. | ||
Note that the first ''parameter'' for ''bowcontrolfrequency / bowingwheel.pid.targetfrequency | Note that the first ''parameter'' for ''"''bowcontrolfrequency" / "bowingwheel.pid.targetfrequency" is put in between double quotes ("). This is because the "pow''"-''function requires the use of a comma (",") in order to separate in between its two required inputs; ''x'' and ''y''. In order for the Ekdahl FAR to know that this comma does not signal the beginning of a new ''command,'' we use quotes. Single (') and double (") quotes can be used and nested in all ''parameters'' and are <u>required</u> in a lot of circumstances, improper nesting or not using quotes can lead to the instrument not understanding the ''command string'' correctly. | ||
== Return messages == | == Return messages == | ||
| Line 112: | Line 112: | ||
===== Explicitly requesting information ===== | ===== Explicitly requesting information ===== | ||
By using the special command | By using the special command "requestinfo" / "rqi" one can request the information stored by a certain ''command'' or a state of the Ekdahl FAR. The "rqi"-command is executed in the convention "rqi:commandname:optional parameters". | ||
To go back to our example of setting the bowing frequency using the '' | To go back to our example of setting the bowing frequency using the ''"''bowcontrolfrequency" / "bowingwheel.pid.targetfrequency"-command we can ask the Ekdahl FAR what the bowing frequency is set to by writing<pre> | ||
FAR < 1.1: | FAR < 1.1: | ||
rqi:bowcontrolfrequency | rqi:bowcontrolfrequency | ||
| Line 126: | Line 126: | ||
FAR 1.1: | FAR 1.1: | ||
[irq]bw[0].pid[0].tf:82.5 | [irq]bw[0].pid[0].tf:82.5 | ||
</pre>Where '[irq]' denotes that the message returned is in the ''info request-''category, that it pertains to the command | </pre>Where '[irq]' denotes that the message returned is in the ''info request-''category, that it pertains to the command "bcf" / "bw.pid.tf" and has the value ''82.5''. Note that the returned ''command'' sent by an "rqi"-command always uses the ''short name'' in order to preserve bandwidth. In the FAR 1.1 the return statement always returns the ''index'' of the ''module''(s) in question. | ||
Most commands do not require any ''parameters'' when using the | Most commands do not require any ''parameters'' when using the "rqi"-command. The ''"''adcread" / "controlbox.datareturn"-command is an example of a ''command'' that <u>does</u> require a ''parameter'' when used with "rqi". The "adcread" / "controlbox.datareturn"''-''command returns the last value read by the ''analog-to-digital converter'' in the ''Control box'', because there are 8 different channels the first ''parameter'' sets which channel to return the data for, hence executing the ''command''<pre> | ||
FAR < 1.1: | FAR < 1.1: | ||
rqi:adcr:3 | rqi:adcr:3 | ||
| Line 137: | Line 137: | ||
== MIDI mapping == | == MIDI mapping == | ||
The way ''MIDI'' works int the Ekdahl FAR is that each ''MIDI message'' is associated with a certain ''command string'' and the ''MIDI message'' will also update some of the internal ''variables''. Any time the associated ''MIDI message'' is received the Ekdahl FAR will execute the ''commands'' that have been associated with that ''MIDI message''. Several ''MIDI configurations'' can be stored and recalled at any time, each with a different set of ''commands'' associated with each ''MIDI message''. | |||
'''FAR < 1.1:''' | '''FAR < 1.1:''' | ||
| Line 143: | Line 143: | ||
'''FAR < 1.1''' | '''FAR < 1.1''' | ||
The ''command'' responsible for mapping ''command strings'' to different ''MIDI messages'' is | The ''command'' responsible for mapping ''command strings'' to different ''MIDI messages'' is "midieventhandler" or "mev" for short. The first ''parameter'' of "mev" is the type of ''MIDI message'' that we want to remap; | ||
* '''noteon''' - Note on | * '''noteon''' - Note on | ||
| Line 157: | Line 157: | ||
'''FAR 1.1''' | '''FAR 1.1''' | ||
The '' | The "bowingwheel"-''module'' contains a ''module'' called "midiconfigurationhandler" that handles the loading and switching in between different ''MIDI configurations''. The "midiconfigurationhandler"''-module'' has one or more ''"''midiconfiguration"-''modules'', each having its own ''MIDI'' settings. In order to change the ''command mapping'' for a ''MIDI message'' in a specific ''MIDI configuration'', the following ''commands'' are used; | ||
* '''noteon/non''':''commands'' - Sets the ''commands'' executed for a 'note on' ''MIDI message'' | * '''noteon/non''':''commands'' - Sets the ''commands'' executed for a 'note on' ''MIDI message'' | ||
| Line 167: | Line 167: | ||
* '''continuouscontrollerdata/ccd''''':controller:commands'' - Sets the ''commands'' executed for 'continuous controller' no ''controller'' | * '''continuouscontrollerdata/ccd''''':controller:commands'' - Sets the ''commands'' executed for 'continuous controller' no ''controller'' | ||
We can of course use the ''"''rqi"-''command'' to check the current mapping, below we are asking what the current ''command string'' associated with the ''pitch bend'' ''MIDI message'' is in the currently selected ''MIDI configuration''.<pre> | |||
FAR < 1.1: | |||
rqi:midieventhandler:pb | |||
FAR 1.1: | |||
rqi:bowingwheel.midiconfigurationhandler.midiconfiguration.pitchbend | |||
</pre>This may return something like<pre> | |||
FAR < 1.1: | FAR < 1.1: | ||
[irq]mev:pb:"bchsh:pitch*4" | |||
FAR 1.1: | FAR 1.1: | ||
[irq]bw[0].mcf[0].mc[0].pb:"bowingwheel.harmonicserieshandler.harmonicseries.shift:pitch*4" | |||
</pre> | </pre>The first part of the return message tells us that the incoming message is of "rqi"-type ("[irq]") which means it's responding to a information request ''command'' sent. The second part tells us what ''command'' the data pertains to, and any ''parameters'' that may be pertinent. The third part of the message is the actual data stored. | ||
[ | |||
For the FAR < 1.1 the data returned is for the ''command'' "mev" with the first ''parameter'' set to "pb", the ''command reference'' tells us this means the ''command'' "midieventhandler" and the ''parameter'' "pb" indicates this has to do with the ''pitch bend''. The data is "bchsh*4". | |||
For the FAR 1.1 the data returned is for the ''command'' "bw[0].mcf[0].mc[0].pb" (bowinwheel[0].midiconfigurationhandler[0].midiconfiguration[0].pitchbend) and the data is "bowingwheel.harmonicserieshandler.harmonicseries.shift:pitch*4". Note here that if we have several different ''MIDI configurations'' stored and we're currently using configuration number 2, the returned message would have been "bw[0].mcf[0].mc[2].pb". | |||
that the ''pitch bend MIDI message'' is executing a "bchsh" / "-command with the parameter ''pitch*4''. Looking in the ''command reference'' we can see that ''bchsh'' is the ''short name'' of the ''bowcontrolharmonicshift''-command which shifts the frequency of the ''bowing wheel'' from the current frequency, the first (and only) parameter sets how much we want to shift it (depends on the ''bowcontrolharmonicshiftrange command''). | |||
If we look in the list of ''[[The Ekdahl FAR - Command langue#Variables|variables]]'' above we can see that the ''pitch bend MIDI message'' will set the ''pitch variable'' which is indeed used. Now what is the '''*4''<nowiki/>' all about? Well the ''bchsh''-command expects a ''16-bit signed'' value, meaning that a full ''harmonic shift'' downwards is equal to -32767, a full ''harmonic shift'' upwards is 32767 and no ''harmonic shift'' is 0. The ''pitch bend MIDI message'' however is only 14-bits, meaning its range is -8192 to 8192, so in order to be able to use the entire range we have to multiply ''pitch'' by 4. | If we look in the list of ''[[The Ekdahl FAR - Command langue#Variables|variables]]'' above we can see that the ''pitch bend MIDI message'' will set the ''pitch variable'' which is indeed used. Now what is the '''*4''<nowiki/>' all about? Well the ''bchsh''-command expects a ''16-bit signed'' value, meaning that a full ''harmonic shift'' downwards is equal to -32767, a full ''harmonic shift'' upwards is 32767 and no ''harmonic shift'' is 0. The ''pitch bend MIDI message'' however is only 14-bits, meaning its range is -8192 to 8192, so in order to be able to use the entire range we have to multiply ''pitch'' by 4. | ||