New Tuning Method: Difference between revisions
Wikispaces>TallKite **Imported revision 481798026 - Original comment: ** |
Wikispaces>TallKite **Imported revision 483791856 - Original comment: ** |
||
| Line 1: | Line 1: | ||
<h2>IMPORTED REVISION FROM WIKISPACES</h2> | <h2>IMPORTED REVISION FROM WIKISPACES</h2> | ||
This is an imported revision from Wikispaces. The revision metadata is included below for reference:<br> | This is an imported revision from Wikispaces. The revision metadata is included below for reference:<br> | ||
: This revision was by author [[User:TallKite|TallKite]] and made on <tt>2014-01- | : This revision was by author [[User:TallKite|TallKite]] and made on <tt>2014-01-18 22:07:59 UTC</tt>.<br> | ||
: The original revision id was <tt> | : The original revision id was <tt>483791856</tt>.<br> | ||
: The revision comment was: <tt></tt><br> | : The revision comment was: <tt></tt><br> | ||
The revision contents are below, presented both in the original Wikispaces Wikitext format, and in HTML exactly as Wikispaces rendered it.<br> | The revision contents are below, presented both in the original Wikispaces Wikitext format, and in HTML exactly as Wikispaces rendered it.<br> | ||
| Line 32: | Line 32: | ||
There are 3 parts to a tuning message: the input note, the output note, and the pitch bend. The input note is a midi note number which specifies a physical **__key__** on the controller. The output note is a midi note number which specifies a __**pitch**__ in the standard A-440 12-ET tuning. The pitch bend specifies how much to bend the output pitch. Upon receiving the input note, the synth produces this frequency: | There are 3 parts to a tuning message: the input note, the output note, and the pitch bend. The input note is a midi note number which specifies a physical **__key__** on the controller. The output note is a midi note number which specifies a __**pitch**__ in the standard A-440 12-ET tuning. The pitch bend specifies how much to bend the output pitch. Upon receiving the input note, the synth produces this frequency: | ||
frequency = 440 * 2 ^ [ (outputNote - 69) / 12 + (pitchBend / 8192 - 1) / | frequency = 440 * 2 ^ [ (outputNote - 69) / 12 + (pitchBend / 8192 - 1) / 24 ] | ||
The pitch bend range is "hard-wired" to 2 | The pitch bend range is "hard-wired" to 1/2 of a semitone = 50¢, one twenty-fourth of an octave, hence the 24 at the end of the equation. If the physical pitch bend wheel is moved, that bend would be added onto the tuning bend. The physical pitch bend wheel is not hard-wired to 2 semitones and is governed by the usual pitch bend range. | ||
Because microtonalists use array keyboards, there may be a full 128 keys in use. Any input key can be mapped to any output frequency. Because alternate tunings can have more than 12 notes per octave, more than one input note may be be mapped to the same output note. Therefore the pitch bend is associated with the input note, not the output note. Specifying an output note is optional. If none is specified, the output note is understood to be the same as the input note. | Because microtonalists use array keyboards, there may be a full 128 keys in use. Any input key can be mapped to any output frequency. Because alternate tunings can have more than 12 notes per octave, more than one input note may be be mapped to the same output note. Therefore the pitch bend is associated with the input note, not the output note. Specifying an output note is optional. If none is specified, the output note is understood to be the same as the input note. | ||
| Line 53: | Line 53: | ||
**__Implementation__:** | **__Implementation__:** | ||
The new method uses keyswitches for the 5 highest keys, 123-127. If middle C is C4, these are notes D#9 to G9. These keyswitches are generated by software, not played by the musician. The velocity of the keyswitches is not actually a velocity, but 1 byte of tuning information. Keyswitch F#9's velocity is actually the input note, keyswitch F9's velocity is the output note, and keyswitches E9 and D#9's velocities are the pitch bend, in the exact same format as the 2 data bytes of the standard midi pitch bend message. This makes it easier for the synth developer or designer, because he has already written code that handles physical pitch bend wheel movement, and can just reuse it to handle tuning keyswitches. | The new method uses keyswitches for the 5 highest keys, 123-127. If middle C is C4, these are notes D#9 to G9. These keyswitches are generated by software, not played by the musician. The velocity of the keyswitches is not actually a velocity, but 1 byte of tuning information. Keyswitch F#9's velocity is actually the input note, keyswitch F9's velocity is the output note, and keyswitches E9 and D#9's velocities are the pitch bend, in the exact same format as the 2 7-bit data bytes of the standard midi pitch bend message. This makes it easier for the synth developer or designer, because he has already written code that handles physical pitch bend wheel movement, and can just reuse it to handle tuning keyswitches. Because the keyswitch bend range is fixed at 50¢, the tuning resolution is 0.0061¢. Thus 00 00 = -50¢, 40 00 = 0¢, and 7F FF = +49.9939¢. | ||
Each keyswitch note-on needs to have a matching note-off, to avoid being misinterpreted and possibly blocked by the DAW or other environment. To this end, a zero-velocity note-on follows immediately. To bend note nn on channel | Each keyswitch note-on needs to have a matching note-off, to avoid being misinterpreted and possibly blocked by the DAW or other environment. To this end, a zero-velocity note-on follows immediately. To bend note nn on channel x to note mm with bend of yyzz would take up to 4 note-on messages and 4 note-off messages. In hexadecimal the midi looks like this: | ||
F#9 note-on/note-off: | F#9 note-on/note-off: 9x 7E nn 7E 00 (input note, only needs to be sent when the input note changes) | ||
F9 note-on/note-off: | F9 note-on/note-off: 9x 7D mm 7D 00 (output note, optional) | ||
E9 note-on/note-off: | E9 note-on/note-off: 9x 7C yy 7C 00 (coarse bend, optional) | ||
D#9 note-on/note-off: | D#9 note-on/note-off: 9x 7B zz 7B 00 (fine bend, required) | ||
These messages are always sent in this order. Some of the "9x" bytes can be omitted via running status. If the F#9 input note keyswitch is omitted, additional output note and bend messages continue to affect the current input note, overwriting previous output note and bend messages. If no F#9 keyswitch is received, the current input note defaults to note #0. The F9 output note keyswitch is optional and would generally be omitted for 12-notes-per-octave tunings. The E9 coarse bend could be omitted for slight pitch bends that don't change the MSB of the pitch bend. The required D#9 fine bend functions as an "end of tuning message" marker, and the synth waits until receiving this keyswitch to actually apply the new tuning. The midi stream for pitch glides will be reduced to mostly fine bends, with coarse bends whenever the MSB boundary is crossed, and output note updates whenever the note boundary is crossed. | |||
The G9 keyswitch with velocity 1 resets the tuning of all notes. On receiving this message, the synth should reset all notes on that channel back to standard tuning. To reset all notes on channel x: | |||
G9 note-on/note-off: 9x 7F 01 7F 00 (reset all notes on channel c) | |||
Because note-ons with velocity zero are interpreted as note-offs, a message conveying a zero value for the note or the bend must be transmitted via the G9 keyswitch, using velocities 123 through 126, like so: | |||
G9 note-on/note-off: 9x 7F 7E 7F 00 (set input note to #0) | |||
G9 note-on/note-off: 9x 7F 7D 7F 00 (set output note to the C five octaves below middle-C) | |||
G9 note-on/note-off: 9x 7F 7C 7F 00 (set coarse bend to -50¢) | |||
G9 note-on/note-off: 9x 7F 7B 7F 00 (set fine bend to 0¢) | |||
Thus 9x 7F 7B 7F 00 replaces 9x 7B 00 7B 00, 9x 7F 7C 7F 00 replaces 9x 7C 00 7C 00, etc. | |||
To reset an individual note nn on channel x to standard pitch (assuming nn > 0), and using running status: | |||
F#9 note-on/note-off: 9x 7E nn 7E 00 (set input note) | |||
F#9 note-on/note-off: | |||
F9 note-on/note-off: 7D nn 7D 00 (set output note to input note) | F9 note-on/note-off: 7D nn 7D 00 (set output note to input note) | ||
E9 note-on/note-off: 7C 40 7C 00 (set coarse bend to 0¢) | E9 note-on/note-off: 7C 40 7C 00 (set coarse bend to 0¢) | ||
G9 note-on/note-off: 7F | G9 note-on/note-off: 7F 7B 7F 00 (set fine bend to 0¢) | ||
Note that in this last example, the G9 keyswitch with a velocity of 7B indicates "end of tuning message". | |||
To set a switchable multi-timbral synth to mono-tunable mode or multi-tunable mode: | To set a switchable multi-timbral synth to mono-tunable mode or multi-tunable mode: | ||
G9 note-on/note-off: | G9 note-on/note-off: 9x 7F 06 7F 00 (set to mono-tunable) | ||
G9 note-on/note-off: | G9 note-on/note-off: 9x 7F 07 7F 00 (set to multi-tunable) | ||
Robert Walker has written a Kontakt script that implements this method for most Kontakt instruments. The script is still in beta: [[@http://robertinventor.com/ftswiki/High_numbered_keyswitches_retuning]] | Robert Walker has written a Kontakt script that implements this method for most Kontakt instruments. The script is still in beta: [[@http://robertinventor.com/ftswiki/High_numbered_keyswitches_retuning]] | ||
| Line 101: | Line 101: | ||
---- | ---- | ||
Footnote on FL Studio sysex | Footnote on FL Studio sysex incompatibility, which is undocumented. | ||
http://forum.image-line.com/viewtopic.php?p=824112 | http://forum.image-line.com/viewtopic.php?p=824112 | ||
(official FL Studio forum, must register to view the full thread) | (official FL Studio forum, must register to view the full thread) | ||
| Line 144: | Line 144: | ||
RPN LSB: Bc 64 0 | RPN LSB: Bc 64 0 | ||
RPN parameters currently in use: | |||
RPN 0,0 pitch bend range | RPN 0,0 pitch bend range | ||
RPN 0,1 channel fine tuning | RPN 0,1 channel fine tuning | ||
| Line 159: | Line 157: | ||
RPN 127,127 null parameter (disables all 4 data entry commands) | RPN 127,127 null parameter (disables all 4 data entry commands) | ||
Possible extension: | |||
An additional RPN block. MSB = 103, would reset the pitch of a single note. The RPN LSB specifies the note. The data MSB/LSB/inc/dec messages are not needed. To reset note nn on channel c: | An additional RPN block. MSB = 103, would reset the pitch of a single note. The RPN LSB specifies the note. The data MSB/LSB/inc/dec messages are not needed. To reset note nn on channel c: | ||
RPN MSB: Bc 65 67 (note reset RPN) | RPN MSB: Bc 65 67 (note reset RPN) | ||
| Line 187: | Line 181: | ||
There are 3 parts to a tuning message: the input note, the output note, and the pitch bend. The input note is a midi note number which specifies a physical <strong><u>key</u></strong> on the controller. The output note is a midi note number which specifies a <u><strong>pitch</strong></u> in the standard A-440 12-ET tuning. The pitch bend specifies how much to bend the output pitch. Upon receiving the input note, the synth produces this frequency:<br /> | There are 3 parts to a tuning message: the input note, the output note, and the pitch bend. The input note is a midi note number which specifies a physical <strong><u>key</u></strong> on the controller. The output note is a midi note number which specifies a <u><strong>pitch</strong></u> in the standard A-440 12-ET tuning. The pitch bend specifies how much to bend the output pitch. Upon receiving the input note, the synth produces this frequency:<br /> | ||
<br /> | <br /> | ||
frequency = 440 * 2 ^ [ (outputNote - 69) / 12 + (pitchBend / 8192 - 1) / | frequency = 440 * 2 ^ [ (outputNote - 69) / 12 + (pitchBend / 8192 - 1) / 24 ]<br /> | ||
<br /> | <br /> | ||
The pitch bend range is &quot;hard-wired&quot; to 2 | The pitch bend range is &quot;hard-wired&quot; to 1/2 of a semitone = 50¢, one twenty-fourth of an octave, hence the 24 at the end of the equation. If the physical pitch bend wheel is moved, that bend would be added onto the tuning bend. The physical pitch bend wheel is not hard-wired to 2 semitones and is governed by the usual pitch bend range.<br /> | ||
<br /> | <br /> | ||
Because microtonalists use array keyboards, there may be a full 128 keys in use. Any input key can be mapped to any output frequency. Because alternate tunings can have more than 12 notes per octave, more than one input note may be be mapped to the same output note. Therefore the pitch bend is associated with the input note, not the output note. Specifying an output note is optional. If none is specified, the output note is understood to be the same as the input note.<br /> | Because microtonalists use array keyboards, there may be a full 128 keys in use. Any input key can be mapped to any output frequency. Because alternate tunings can have more than 12 notes per octave, more than one input note may be be mapped to the same output note. Therefore the pitch bend is associated with the input note, not the output note. Specifying an output note is optional. If none is specified, the output note is understood to be the same as the input note.<br /> | ||
| Line 205: | Line 199: | ||
<strong><u>Implementation</u>:</strong><br /> | <strong><u>Implementation</u>:</strong><br /> | ||
<br /> | <br /> | ||
The new method uses keyswitches for the 5 highest keys, 123-127. If middle C is C4, these are notes D#9 to G9. These keyswitches are generated by software, not played by the musician. The velocity of the keyswitches is not actually a velocity, but 1 byte of tuning information. Keyswitch F#9's velocity is actually the input note, keyswitch F9's velocity is the output note, and keyswitches E9 and D#9's velocities are the pitch bend, in the exact same format as the 2 data bytes of the standard midi pitch bend message. This makes it easier for the synth developer or designer, because he has already written code that handles physical pitch bend wheel movement, and can just reuse it to handle tuning keyswitches. | The new method uses keyswitches for the 5 highest keys, 123-127. If middle C is C4, these are notes D#9 to G9. These keyswitches are generated by software, not played by the musician. The velocity of the keyswitches is not actually a velocity, but 1 byte of tuning information. Keyswitch F#9's velocity is actually the input note, keyswitch F9's velocity is the output note, and keyswitches E9 and D#9's velocities are the pitch bend, in the exact same format as the 2 7-bit data bytes of the standard midi pitch bend message. This makes it easier for the synth developer or designer, because he has already written code that handles physical pitch bend wheel movement, and can just reuse it to handle tuning keyswitches. Because the keyswitch bend range is fixed at 50¢, the tuning resolution is 0.0061¢. Thus 00 00 = -50¢, 40 00 = 0¢, and 7F FF = +49.9939¢.<br /> | ||
<br /> | <br /> | ||
Each keyswitch note-on needs to have a matching note-off, to avoid being misinterpreted and possibly blocked by the DAW or other environment. To this end, a zero-velocity note-on follows immediately. To bend note nn on channel x to note mm with bend of yyzz would take up to 4 note-on messages and 4 note-off messages. In hexadecimal the midi looks like this:<br /> | |||
<br /> | <br /> | ||
(< | F#9 note-on/note-off: 9x 7E nn 7E 00 (input note, only needs to be sent when the input note changes)<br /> | ||
F9 note-on/note-off: 9x 7D mm 7D 00 (output note, optional)<br /> | |||
E9 note-on/note-off: 9x 7C yy 7C 00 (coarse bend, optional)<br /> | |||
D#9 note-on/note-off: 9x 7B zz 7B 00 (fine bend, required)<br /> | |||
<br /> | <br /> | ||
These messages are always sent in this order. Some of the &quot; | These messages are always sent in this order. Some of the &quot;9x&quot; bytes can be omitted via running status. If the F#9 input note keyswitch is omitted, additional output note and bend messages continue to affect the current input note, overwriting previous output note and bend messages. If no F#9 keyswitch is received, the current input note defaults to note #0. The F9 output note keyswitch is optional and would generally be omitted for 12-notes-per-octave tunings. The E9 coarse bend could be omitted for slight pitch bends that don't change the MSB of the pitch bend. The required D#9 fine bend functions as an &quot;end of tuning message&quot; marker, and the synth waits until receiving this keyswitch to actually apply the new tuning. The midi stream for pitch glides will be reduced to mostly fine bends, with coarse bends whenever the MSB boundary is crossed, and output note updates whenever the note boundary is crossed.<br /> | ||
<br /> | <br /> | ||
The G9 keyswitch with velocity 1 resets the tuning of all notes. On receiving this message, the synth should reset all notes on that channel back to standard tuning. To reset all notes on channel | The G9 keyswitch with velocity 1 resets the tuning of all notes. On receiving this message, the synth should reset all notes on that channel back to standard tuning. To reset all notes on channel x:<br /> | ||
<br /> | <br /> | ||
G9 note-on/note-off: | G9 note-on/note-off: 9x 7F 01 7F 00 (reset all notes on channel c)<br /> | ||
<br /> | <br /> | ||
Because note-ons with velocity zero are interpreted as note-offs, a message conveying a zero value for the note or the bend must be transmitted via the G9 keyswitch, using velocities 126 | Because note-ons with velocity zero are interpreted as note-offs, a message conveying a zero value for the note or the bend must be transmitted via the G9 keyswitch, using velocities 123 through 126, like so:<br /> | ||
<br /> | <br /> | ||
G9 note-on/note-off: | G9 note-on/note-off: 9x 7F 7E 7F 00 (set input note to #0)<br /> | ||
G9 note-on/note-off: | G9 note-on/note-off: 9x 7F 7D 7F 00 (set output note to the C five octaves below middle-C)<br /> | ||
G9 note-on/note-off: | G9 note-on/note-off: 9x 7F 7C 7F 00 (set coarse bend to -50¢)<br /> | ||
G9 note-on/note-off: | G9 note-on/note-off: 9x 7F 7B 7F 00 (set fine bend to 0¢)<br /> | ||
<br /> | <br /> | ||
Thus | Thus 9x 7F 7B 7F 00 replaces 9x 7B 00 7B 00, 9x 7F 7C 7F 00 replaces 9x 7C 00 7C 00, etc.<br /> | ||
<br /> | <br /> | ||
To reset an individual note nn on channel | To reset an individual note nn on channel x to standard pitch (assuming nn &gt; 0), and using running status:<br /> | ||
<br /> | <br /> | ||
F#9 note-on/note-off: | F#9 note-on/note-off: 9x 7E nn 7E 00 (set input note)<br /> | ||
F9 note-on/note-off: 7D nn 7D 00 (set output note to input note)<br /> | F9 note-on/note-off: 7D nn 7D 00 (set output note to input note)<br /> | ||
E9 note-on/note-off: 7C 40 7C 00 (set coarse bend to 0¢)<br /> | E9 note-on/note-off: 7C 40 7C 00 (set coarse bend to 0¢)<br /> | ||
G9 note-on/note-off: 7F | G9 note-on/note-off: 7F 7B 7F 00 (set fine bend to 0¢)<br /> | ||
<br /> | |||
Note that in this last example, the G9 keyswitch with a velocity of 7B indicates &quot;end of tuning message&quot;.<br /> | |||
<br /> | <br /> | ||
To set a switchable multi-timbral synth to mono-tunable mode or multi-tunable mode:<br /> | To set a switchable multi-timbral synth to mono-tunable mode or multi-tunable mode:<br /> | ||
<br /> | <br /> | ||
G9 note-on/note-off: | G9 note-on/note-off: 9x 7F 06 7F 00 (set to mono-tunable)<br /> | ||
G9 note-on/note-off: | G9 note-on/note-off: 9x 7F 07 7F 00 (set to multi-tunable)<br /> | ||
<br /> | <br /> | ||
Robert Walker has written a Kontakt script that implements this method for most Kontakt instruments. The script is still in beta: <a class="wiki_link_ext" href="http://robertinventor.com/ftswiki/High_numbered_keyswitches_retuning" rel="nofollow" target="_blank">http://robertinventor.com/ftswiki/High_numbered_keyswitches_retuning</a><br /> | Robert Walker has written a Kontakt script that implements this method for most Kontakt instruments. The script is still in beta: <a class="wiki_link_ext" href="http://robertinventor.com/ftswiki/High_numbered_keyswitches_retuning" rel="nofollow" target="_blank">http://robertinventor.com/ftswiki/High_numbered_keyswitches_retuning</a><br /> | ||
| Line 253: | Line 247: | ||
<hr /> | <hr /> | ||
<br /> | <br /> | ||
Footnote on FL Studio sysex | Footnote on FL Studio sysex incompatibility, which is undocumented.<br /> | ||
<!-- ws:start:WikiTextUrlRule: | <!-- ws:start:WikiTextUrlRule:173:http://forum.image-line.com/viewtopic.php?p=824112 --><a class="wiki_link_ext" href="http://forum.image-line.com/viewtopic.php?p=824112" rel="nofollow">http://forum.image-line.com/viewtopic.php?p=824112</a><!-- ws:end:WikiTextUrlRule:173 --><br /> | ||
(official FL Studio forum, must register to view the full thread)<br /> | (official FL Studio forum, must register to view the full thread)<br /> | ||
Excerpted from a July 2013 conversation with &quot;Reflex&quot;, a site admin:<br /> | Excerpted from a July 2013 conversation with &quot;Reflex&quot;, a site admin:<br /> | ||
| Line 296: | Line 290: | ||
RPN LSB: Bc 64 0<br /> | RPN LSB: Bc 64 0<br /> | ||
<br /> | <br /> | ||
<br /> | <br /> | ||
RPN parameters currently in use:<br /> | |||
RPN 0,0 pitch bend range<br /> | RPN 0,0 pitch bend range<br /> | ||
RPN 0,1 channel fine tuning<br /> | RPN 0,1 channel fine tuning<br /> | ||
| Line 311: | Line 303: | ||
RPN 127,127 null parameter (disables all 4 data entry commands)<br /> | RPN 127,127 null parameter (disables all 4 data entry commands)<br /> | ||
<br /> | <br /> | ||
Possible extension:<br /> | |||
An additional RPN block. MSB = 103, would reset the pitch of a single note. The RPN LSB specifies the note. The data MSB/LSB/inc/dec messages are not needed. To reset note nn on channel c:<br /> | An additional RPN block. MSB = 103, would reset the pitch of a single note. The RPN LSB specifies the note. The data MSB/LSB/inc/dec messages are not needed. To reset note nn on channel c:<br /> | ||
RPN MSB: Bc 65 67 (note reset RPN)<br /> | RPN MSB: Bc 65 67 (note reset RPN)<br /> | ||
RPN LSB: Bc 64 nn (note to reset)</body></html></pre></div> | RPN LSB: Bc 64 nn (note to reset)</body></html></pre></div> | ||