User:Contribution/Chanofreq Project: Difference between revisions

Contribution (talk | contribs)
Contribution (talk | contribs)
No edit summary
Line 14: Line 14:


== File Structure ==
== File Structure ==
A Chanofreq file is a straightforward text file with instructions formatted as follows:
A Chanofreq file is a straightforward text file with commands formatted as follows:


  channel X note Y frequency Z
  channel X note Y frequency Z


* '''X:''' An integer ≥ 1.
* '''X:''' An integer ≥ 1 (representing the MIDI channel).
* '''Y:''' An integer ≥ 0.
* '''Y:''' An integer ≥ 0 (representing the note number).
* '''Z:''' A 64-bit floating-point number > 0.
* '''Z:''' A 64-bit floating-point number > 0 (representing the frequency in Hertz).


Instructions can be separated either by a semicolon (";") or a newline.
Commands can be separated either by a semicolon (";") or a newline.


Examples:
Examples:
Line 29: Line 29:


== Syntax ==
== Syntax ==
Channels
To specify tuning for MIDI-controlled instruments, use:
  channel X note Y frequency Z
  channel X note Y frequency Z
For instruments with internal notes that are not MIDI-controlled (such as built-in sequencer or keyboard), use the following instruction:
For instruments with internal notes not controlled via MIDI (like those with built-in sequencers or keyboards), use:
  internal note Y frequency Z
  internal note Y frequency Z
To assign a fallback frequency to any note Y that remains unspecified in the whole file, regardless of the MIDI channel or if it is internal:
To set a fallback frequency for any unspecified note Y across all channels and internal settings:
  default note Y frequency Z
  default note Y frequency Z
Comments
Comments:
  /*Inline comment*/
  /*Inline comment*/
   
   
Line 42: Line 42:


== Behavior on Loading ==
== Behavior on Loading ==
When the file is loaded, all notes are initially deactivated. Each instruction activates or updates the frequency of a note.  
When a Chanofreq file is loaded, all notes are initially set to an inactive state. As the file is processed, each channel and internal command activates the corresponding note and assigns it a specified frequency. If a command specifies a frequency for a note that is already active, the note's frequency is updated to the new value. The same process applies to any default settings specified in the file. Once the file has been fully processed, any notes that remain unspecified are set to the default frequency, if one is provided. If no default frequency is defined, the unspecified notes remain inactive.


== Planned Projects ==
== Planned Projects ==