Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 298 lines (235 sloc) 10.7 KB
# This is the file containing every notable variable used in the program.
# Settings without indicated defaults should not be changed.
# Be aware that the loaded settings may change during the execution of the program (but this file will never be changed by the program).
#
# Comments start with '#'
# Categories have [square brackets]
# Every setting consists of a key-value pair divided by either : or =. Do not change the keys or the datatypes of the values!
# The default is stated in a comment above the setting.
# The settings will be automatically converted to the corresponding datatypes when parsed, you can even add/subtract numbers!
# The following datatypes exist:
# string: "str"
# int: 42
# float: 23.32
# list: [1, 2, 3]
# dict: {'a': 1, 'b': 2}
# boolean: True
# None: None
[log]
# puts the log handlers in another thread so it doesn't impact the performance of the rest
# when used as a library: also effective when another logger is supplied!
isolate = True
# the format string used to format the log, for details see https://docs.python.org/3/library/logging.html#logrecord-attributes
# default: '%(asctime)s %(levelname)s %(name)s - %(message)s'
format = '%(asctime)s %(levelname)s %(name)s - %(message)s'
# a string if you want a different format string for the logfile, None if not
# default: None
file_format = None
# the name of the log file or None to generate a file name from the current date and time
# default: None
file_name = None
# what is appended to the file name (normally the file ending)
# default: '.log'
file_ending = '.log'
# the path where the logfile will be stored
# default: 'log'
file_path = 'log'
# write mode of the filehandler, for details see https://docs.python.org/3.6/library/functions.html#open
# default: 'a'
file_mode = 'a'
# the maximum filesize in bytes befor a new file is created
# default: 102400] (100MB)
file_max_kbytes = 102400
# the maximum number of files saved for the log
# default: 10
file_max_files = 10
# the amount of digits after the decimal point shown. Note that this does not mean higher precision of the timestamps, just more digits
# default: 7
timestamp_precision = 7
# enable super verbose logging in a separate file
# default: False
verbose_enable = True
# the suffix for the filename, applied before the file ending
# default: 'verbose_'
verbose_file_suffix = '_verbose'
# like file_max_kbytes but for the high verbosity logging, None to use the value set in file_max_kbytes
# default: None
verbose_file_max_kbytes = None
# like file_max_files but for the high verbosity logging, None to use the value set in file_max_files
# default: 1
verbose_file_max_files = 1
[calibration]
# name of the calibration file
# default: 'calibration'
file_name = 'calibration.json'
# folder of the calibration file
# default: 'calibration'
file_folder = 'calibration'
[local_machine]
# the ip of the machine running the program
# default: '192.168.1.128'
ip = '192.168.1.128'
# name of the network interface used on the local machine, its name will likely start with 'eth' or 'enp'
# you will get a prompt to select from a list of available interfaces if you set this to None
# default: 'enp5s0'
ifname = 'enp6s0'
[time_sync]
# is the NTP server absolutely required? (i.e. is it insufficient to just have precise times relative to another during
# a single execution of the program?
# default: False
ntp_require = False
# the ip of the NTP server, it will be running on the local machine (localhost) in most cases
# set it to None do disable the NTP server
# default: 'localhost'
ntp_ip = None
# how far off the returned time can be before we use a fallback to update the offset of counter3 to UTC in seconds
# default: .0015
ntp_tolerance = .001
# a way to keep the timestamps close to the clock of the local machine, measured using the arival times of the data packets
# NOT RECCOMMENDED!!! use only if you have to!
# default: False
adaptive_offset_correction_enable = True
# the approximate minimal length of a signal to not be filtered by the low-pass filter
# higher values -> less stability, lower values -> faster recovery from initial errors
# default: 2
adaptive_offset_correction_time_constant = 2
[midi]
# whether or not we calculate the velocity data
# default: True
velocity_enable = True
# the velocity we send if the velocity calculation is disabled
# default: 127
velocity_static = 127
# is midi enabled at all? the settings below do nothing if it is disabled
# default: True
enable = True
# swap the midi codes listed here
# the list is made of sublists of size 2 containing the codes that will be swapped
# example: [[58, 62], [59, 63], [60, 64], [61, 65]]
# default: []
swap_midi_codes = [[58, 62], [59, 63], [60, 64], [61, 65]]
# enable output of midi signals from the keyboard/program
# default: True
primary_enable = True
# how many seconds the primary midi device will be muted if the calibration mode is active
# default: 30
primary_mute_duration = 15
# the name of the primary midi device
# you get a prompt with the available devices if you start the program and the one set does not exist (or is just None)
# there is a shorthand notation available (just write everything before the ":") but this only works if there is no other
# midi device with the same name (the part after the ":" uniquely identifies the device but may change when the device
# disconnects or the system is restarted)
# default: 'Bluethner Digital Piano'
primary_out = 'Bluethner Digital Piano'
# should the velocity on the secondary devices be disabled as well if disable it for the primary input (i.e. the keyboard)?
# default: False
velocity_disable_all = False
# enable the secondary midi devices?
# default: False
secondary_enable = True
# how many secondary inputs we will use at most, None to not set a maximum
# default: None
secondary_amount = 1
# the midi inputs we use as secondary midi source, set to None or a list: ['<name1>', '<name2>']
# the shorthand notation is available in here as well
# you will end the selection of secondary devices with a None in the list (if you're using the list). This also means
# that anything after a None in the list will be ignored
# default: None
secondary_in = ['serial2midi_ttyS4']
# where we send the midi signals from the seond device, set to None or a list (see secondary_in for details)
# the items will be matched with the list in secondary_in (i.e. the first input there gets the first output here and so on),
# use None in the list if you don't want any output for a specific input
# default: None
secondary_out = ['Bluethner Digital Piano']
[boards]
# the pattern used to search for the boards
# default: '/dev/ttyACM*'
search_pattern = '/dev/ttyACM*'
# the devices to be ignored (this is a list of the device paths, e.g. ['/dev/ttyACM1', '/dev/ttyACM5'])
# default: []
# blacklist = ['/dev/ttyACM1', '/dev/ttyACM2', '/dev/ttyACM3', '/dev/ttyACM4', '/dev/ttyACM5', '/dev/ttyACM6']
blacklist = []
# how many channels there are per board (this includes ignored channels)
# do not change this if the hardware didn't change
channel_amount = 4
# a blacklist for the channels of the boards, {<board_id>: [<channel_ids>], <board_id>: [<channel_ids>], ...}
# the board id is the internal one, not the number after "ttyACM"!
# do not blacklist the first channel (number 0) as it may mess up the parsing of the timestamps in the TCP data stream.
# (change the regex if there is no other way but this will decrease error resistance)
# the numbering of the boards is based on 1, the numbers of the channels are based on 0!
# default: {7: [3]}
# channel_blacklist = {7: [3], 1: [1, 2, 3]}
channel_blacklist = {7: [3]}
# the lowest possible value we will ever see in the data stream
# default: -6000
absolute_min = -6000
# the highest possible value we will ever see in the data stream, this must not be higher than 0
# default: 0
absolute_max = 0
# the approximate minimal length of a signal to not be filtered by the low-pass filter
# lower values result in less smoothing, higher values increase the input lag
# changing this influences the velocity_min/_max settings in [keyboard]
# default: .001
lpf_time_constant = .0075
[serial]
# everything in here is just about the serial (over USB) communication with the boards)
# maximum length (in characters) of an answer, is not a hard limit but the amount of characters we use as a signal to stop loading more data
# default: 5000
answer_max_length = 5000
# the longest we wait for the completion of the answer in seconds
# default: 2
answer_max_time = 2
[ethernet]
# settings for the ethernet connection to the boards
# the timeout we use when connecting to the boards in seconds
# default: 30
timeout = 30
# the port we use for the TCP stream from the board
port = 9004
# the acceptable age difference between timestamps in .01 ms
# counter3 is the internal name of the timer used to generate the timestamps
# default: 100000
counter3_acceptable_difference = 100000
# the resolution of counter3 in seconds
counter3_resolution = .00001
# the maximum age of the last known value of the timestamps of the boards in seconds (!). after that we just use the one given via the TCP stream
# this is only relevant when we haven't received a valid timestamp for a while
# default: .01
counter3_max_age = .01
[keyboard]
# settings related to the actual keyboard like activation thresholds and the settings for velocity
# the setting to enable/disable the velocity calculations is in [midi]
# at what point do we consider the key pressed? The values go from 0 (released) to 1 (completely pressed)
# default: .7
trigger_on = .7
# same as trigger_on but for the point on which we consider the key released again
# this has to be smaller than trigger_on
# default: .7
trigger_off = .3
# how much the values are allowed to go over the bounds without triggering an error
# default: 50
out_of_bounds_tolerance = 100
# the distance between a full press and a full release in meters
key_travel = .01
# the maximum age of the samples used to calculate the velocity in seconds
# longer means higher precision but it should not be longer than the shortest time you need to press a key
# but it has to be big enough to allow more than one sample to be present to allow for the calculations.
# min value: ~.003
# reasonable max value: .015-.02 (those are from a tiny empirical test)
# default: .01
velocity_sample_age = .01
# the lowest velocity we expect in m/s
# changing this influences lpf_time_constant in [boards]
# default: .01
velocity_min = .01
# the highest velocity we expect in m/s
# changing this influences lpf_time_constant in [boards]
# default: .25
velocity_max = .25
[misc]
# the minimum frequency we want, show at least a warning when it gets too low
# default: 60
cycles_frequency_min = 60
# the maximum frequency we'll use
# default: 500
cycles_frequency_max = 5000