Tuesday 31 December 2019

TTY control codes and ASCII esacpe sequences

ASCII escape sequences
ASCII escape sequences start with ESC followed by a number of bytes.
The ESC code is 033 in octal and 27 in decimal

A terminal will respond to escape codes that are output to it. Typing an escape code on keyboard by pressing ESC followed by  sequence is treated as an input by the terminal and the it will not act on it therefore you need some way to echo the escape sequence back to the terminal as output for it to action it.

Linux example
echo -e "\033[31;1;4mHello\033[0m"

Powershell example
PS C:\Users\pdj10> $esc = "$([char]27)" # 27 is the escape character
PS C:\Users\pdj10> write-host "$esc[32m hello"  # print hello in green
 hello
PS C:\Users\pdj10>


^L - clear the screen.
^V - take the next character literally e.g. typing ctrl-V followed by ctrl-l the terminal will display '^L' and not clear the screen.

Ableton Focusrite Saffire 6 ASIO setup


The ASIO drivers are the best drivers to use.

How to configure Focusrite Saffire 6 ASIO driver in Ableton 10.

Select the ASIO driver type in Ableton Options | Preferences | Audio.

To avoid poor sound quality due to re-sampling ensure the in/out sample rate in Ableton matches the default format in the Windows 10 Sound Settings | Device Properties | Additional Device Settings | Advanced.
Ableton Options | Preferences | Audio



Windows 10 Sound Settings

If you want multiple applications to be able to use the Saffire at the same time you need to ensure Exlusive mode is not enabled in the Windows 10 Sound Settings | Additional Device Settings | Advanced.

Additional Device Settings | Advanced



NB The Live manual states the buffer size should be set to a multiple of 2 e.g. 512