User:Contribution/Chanofreq Project: Difference between revisions
Contribution (talk | contribs) |
Contribution (talk | contribs) |
||
| Line 18: | Line 18: | ||
* '''X:''' An integer ≥ 1, representing the MIDI channel. | * '''X:''' An integer ≥ 1, representing the MIDI channel. | ||
* '''Y:''' An integer ≥ 0, representing the note number. | * '''Y:''' An integer ≥ 0, representing the note number. | ||
* '''Z:''' A decimal number such as '''minfreq''' ≤ Z < '''maxfreq''', representing the frequency in Hertz. This value is encoded by the parser as a positive integer with a bit depth defined by '''bitfreq'''. Each increment of this integer corresponds to a frequency increment of (maxfreq - minfreq) / 2^bitfreq. Default settings are minfreq = 0 Hz, maxfreq = 21474.83648 Hz, and bitfreq = 32-bit; thus, Z has a precision of five decimal places with an additional sixth decimal place that must be either 0 or 5. | * '''Z:''' A decimal number such as '''minfreq''' ≤ Z < '''maxfreq''', representing the frequency in Hertz. This value is encoded by the parser as a positive integer with a bit depth defined by '''bitfreq'''. | ||
Each increment of this integer corresponds to a frequency increment of (maxfreq - minfreq) / 2^bitfreq. | |||
parser_frequency = int(((f - minfreq) * (2 ** bitfreq) / (maxfreq - minfreq)) + 0.5) | |||
Default settings are minfreq = 0 Hz, maxfreq = 21474.83648 Hz, and bitfreq = 32-bit; thus, Z has a precision of five decimal places with an additional sixth decimal place that must be either 0 or 5. | |||
Commands can be separated by a semicolon (';') or a newline. | Commands can be separated by a semicolon (';') or a newline. | ||