├── .gitignore ├── tektmodules ├── __init__.py ├── uiutils.py ├── settings.py └── tables.py ├── echo.tox ├── panel.ai ├── bloom.tox ├── codev2.tox ├── gater.tox ├── panel.png ├── spiral.tox ├── stutter.tox ├── zerosl.tox ├── codev2new.tox ├── functions.tox ├── hsvtorgb.tox ├── mftwister.tox ├── quantizer.tox ├── recorder.tox ├── rgbtohsv.tox ├── tominmax.tox ├── TektShared.toe ├── codev2_horz.tox ├── colorshift.tox ├── distortion.tox ├── freqbandctrl.tox ├── kaleidoscope.tox ├── mididevice.tox ├── mididevicein.tox ├── presetslot.tox ├── presetslotui.tox ├── ratecontrol.tox ├── spinpulser.tox ├── spinpulser2.tox ├── spinpulser2a.tox ├── timesource.tox ├── audioportctrl.tox ├── freqbandctrl2.tox ├── midideviceout.tox ├── paramsmoother.tox ├── spinpulserbase.tox ├── tocenterwidth.tox ├── triggeredanim.tox ├── audiobandanalysis.tox ├── leapmotioninput.tox ├── namedcolorpicker.tox ├── namedcolorpicker2.tox ├── outputrecording.tox ├── outputrecording2.tox ├── outputrecording3.tox ├── pulseratelimiter.tox ├── simplevaluedisplay.tox ├── self_deleting_button.tox ├── __init__.py ├── reordercolumns_script.py ├── arrow.svg ├── README.md ├── tekt.py ├── midi-fighter-twister.mfs ├── midi-fighter-twister2.mfs └── livid preset.json /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | __pycache__ 3 | *.pyc -------------------------------------------------------------------------------- /tektmodules/__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'tekt' 2 | -------------------------------------------------------------------------------- /echo.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/echo.tox -------------------------------------------------------------------------------- /panel.ai: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/panel.ai -------------------------------------------------------------------------------- /bloom.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/bloom.tox -------------------------------------------------------------------------------- /codev2.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/codev2.tox -------------------------------------------------------------------------------- /gater.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/gater.tox -------------------------------------------------------------------------------- /panel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/panel.png -------------------------------------------------------------------------------- /spiral.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/spiral.tox -------------------------------------------------------------------------------- /stutter.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/stutter.tox -------------------------------------------------------------------------------- /zerosl.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/zerosl.tox -------------------------------------------------------------------------------- /codev2new.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/codev2new.tox -------------------------------------------------------------------------------- /functions.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/functions.tox -------------------------------------------------------------------------------- /hsvtorgb.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/hsvtorgb.tox -------------------------------------------------------------------------------- /mftwister.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/mftwister.tox -------------------------------------------------------------------------------- /quantizer.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/quantizer.tox -------------------------------------------------------------------------------- /recorder.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/recorder.tox -------------------------------------------------------------------------------- /rgbtohsv.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/rgbtohsv.tox -------------------------------------------------------------------------------- /tominmax.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/tominmax.tox -------------------------------------------------------------------------------- /TektShared.toe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/TektShared.toe -------------------------------------------------------------------------------- /codev2_horz.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/codev2_horz.tox -------------------------------------------------------------------------------- /colorshift.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/colorshift.tox -------------------------------------------------------------------------------- /distortion.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/distortion.tox -------------------------------------------------------------------------------- /freqbandctrl.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/freqbandctrl.tox -------------------------------------------------------------------------------- /kaleidoscope.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/kaleidoscope.tox -------------------------------------------------------------------------------- /mididevice.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/mididevice.tox -------------------------------------------------------------------------------- /mididevicein.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/mididevicein.tox -------------------------------------------------------------------------------- /presetslot.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/presetslot.tox -------------------------------------------------------------------------------- /presetslotui.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/presetslotui.tox -------------------------------------------------------------------------------- /ratecontrol.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/ratecontrol.tox -------------------------------------------------------------------------------- /spinpulser.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/spinpulser.tox -------------------------------------------------------------------------------- /spinpulser2.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/spinpulser2.tox -------------------------------------------------------------------------------- /spinpulser2a.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/spinpulser2a.tox -------------------------------------------------------------------------------- /timesource.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/timesource.tox -------------------------------------------------------------------------------- /audioportctrl.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/audioportctrl.tox -------------------------------------------------------------------------------- /freqbandctrl2.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/freqbandctrl2.tox -------------------------------------------------------------------------------- /midideviceout.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/midideviceout.tox -------------------------------------------------------------------------------- /paramsmoother.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/paramsmoother.tox -------------------------------------------------------------------------------- /spinpulserbase.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/spinpulserbase.tox -------------------------------------------------------------------------------- /tocenterwidth.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/tocenterwidth.tox -------------------------------------------------------------------------------- /triggeredanim.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/triggeredanim.tox -------------------------------------------------------------------------------- /audiobandanalysis.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/audiobandanalysis.tox -------------------------------------------------------------------------------- /leapmotioninput.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/leapmotioninput.tox -------------------------------------------------------------------------------- /namedcolorpicker.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/namedcolorpicker.tox -------------------------------------------------------------------------------- /namedcolorpicker2.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/namedcolorpicker2.tox -------------------------------------------------------------------------------- /outputrecording.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/outputrecording.tox -------------------------------------------------------------------------------- /outputrecording2.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/outputrecording2.tox -------------------------------------------------------------------------------- /outputrecording3.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/outputrecording3.tox -------------------------------------------------------------------------------- /pulseratelimiter.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/pulseratelimiter.tox -------------------------------------------------------------------------------- /simplevaluedisplay.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/simplevaluedisplay.tox -------------------------------------------------------------------------------- /self_deleting_button.tox: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/t3kt/tektshared/HEAD/self_deleting_button.tox -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- 1 | __author__ = 'tekt' 2 | 3 | from tekt import * 4 | from tektmodules import * 5 | 6 | 7 | -------------------------------------------------------------------------------- /reordercolumns_script.py: -------------------------------------------------------------------------------- 1 | def cook(dat): 2 | dat.clear() 3 | colnames = dat.par.string0.val.split('|') 4 | indat = dat.inputs[0] 5 | for col in colnames: 6 | vals = indat.col(col) 7 | if vals is not None: 8 | dat.appendCol(vals) 9 | -------------------------------------------------------------------------------- /arrow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tektmodules/uiutils.py: -------------------------------------------------------------------------------- 1 | __author__ = 'tekt' 2 | 3 | 4 | class UISetter: 5 | pass 6 | 7 | def toggle_set(uiop, val, param=None): 8 | uiop.op("button").click(1 if val is not 0 else 0) 9 | 10 | def slider_set(uiop, val, param=None): 11 | uiop.op("set").run(val) 12 | 13 | def tuik_auto_set(uiop, val, param=None): 14 | uidefine = uiop.op("local/define") 15 | uitype = uidefine['type', 1].val if uidefine is not None else None 16 | if not uitype: 17 | raise Exception('UI operator ' + uiop.path + ' does not support type tuik_auto') 18 | callUISetter(uiop, uitype, val, param=param) 19 | 20 | uiSetters = { 21 | 'toggle': toggle_set, 22 | 'slider': slider_set, 23 | 'sliderhorz': slider_set, 24 | 'slidervert': slider_set, 25 | 'xfade': slider_set, 26 | 'tuik_auto': tuik_auto_set 27 | } 28 | 29 | def callUISetter(uiop, uitype, val, param=None): 30 | setter = uiSetters[uitype] 31 | if setter is None: 32 | raise Exception('Unsupported UI operator type: ' + uitype) 33 | setter(uiop, val, param=param) 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | tektshared 2 | ========== 3 | 4 | Shared TouchDesigner components 5 | 6 | ## Post-Processing Effects 7 | * bloom.tox - blur-based "bloom" effect, partially based on an effect from Mixxa 8 | * colorshift.tox - horizontally shift the blue and green channels 9 | * distortion.tox - 2D spacial warping and distortion based on a smoothed noise field 10 | * stutter.tox - time-looping and stuttering 11 | * echo.tox - mutli-tap delay/echo 12 | 13 | ## Audio Control and Analysis 14 | * audiobandanalysis.tox - performs various types of analysis on an audio signal 15 | * audioportctrl.tox - GUI (only) for controlling an audio input/output port 16 | * freqbandctrl.tox - filters an audio frequency band, with GUI 17 | * freqbandctrl2.tox - filters an audio frequency band, with GUI (v2) 18 | 19 | ## Control Processing, etc. 20 | * gater.tox 21 | * hsvtorgb.tox 22 | * mididevice.tox 23 | * outputrecording.tox 24 | * pulseratelimiter.tox 25 | * recorder.tox 26 | * rgbtohsv.tox 27 | * spinpulser.tox 28 | * spinpulser2.tox 29 | * spinpulser2a.tox 30 | * spinpulserbase.tox 31 | * tocenterwidth.tox - converts a min/max value to center value and width 32 | * tominmax.tox - converts a center value and width to min/max values 33 | * triggeredanim.tox 34 | * zerosl.tox - midi map for the Novation Remote ZeroSL 35 | 36 | -------------------------------------------------------------------------------- /tekt.py: -------------------------------------------------------------------------------- 1 | # Root module for python extensions and utilities 2 | __author__ = 'tekt' 3 | import td 4 | from colorsys import rgb_to_hsv, hsv_to_rgb 5 | 6 | #import sys 7 | #if not td.project.folder in sys.path: 8 | # sys.path.append(td.project.folder) 9 | 10 | try: 11 | from tables import * 12 | except ImportError: 13 | from shared.tektmodules.tables import * 14 | 15 | try: 16 | from settings import * 17 | except ImportError: 18 | from shared.tektmodules.settings import * 19 | 20 | def dbg(*args): 21 | for arg in args: 22 | print(repr(arg)) 23 | 24 | def leapHandSelect(scriptOP): 25 | scriptOP.clear() 26 | indat = scriptOP.inputs[0] 27 | for r in range(1, indat.numRows): 28 | if indat[r, "leapraw"].val == "1" and indat[r, "leapswitch"].val == scriptOP.name + ":tracking": 29 | scriptOP.appendRow([indat[r, 0] + "_raw", "1"]) 30 | 31 | def getColorParams(op, prefix='color', alpha='alpha'): 32 | parnames = [prefix + 'r', prefix + 'g', prefix + 'b'] 33 | if alpha is not None: 34 | parnames.append(alpha) 35 | return tuple(p.val for p in op.pars(*parnames)) 36 | 37 | def clearCOMP(comp): 38 | if isinstance(comp, str): 39 | comp = op(comp) 40 | for child in comp.children: 41 | child.destroy() 42 | 43 | def hueShift(rgb, hoffset): 44 | hsv = rgb_to_hsv(rgb[0], rgb[1], rgb[2]) 45 | return hsv_to_rgb((hsv[0] + hoffset) % 1.0, hsv[1], hsv[2]) + rgb[3:] 46 | 47 | def applySubOverrides(overrides, base=None): 48 | if base is None: 49 | base = overrides.parent() 50 | for i in range(1, overrides.numRows): 51 | base.op(overrides[i, 'path'])[overrides[i, 'name'], 1] = overrides[i, 'value'] 52 | -------------------------------------------------------------------------------- /tektmodules/settings.py: -------------------------------------------------------------------------------- 1 | __author__ = 'tekt' 2 | 3 | from abc import ABCMeta, abstractmethod 4 | 5 | try: 6 | import tables 7 | except ImportError: 8 | import shared.tektmodules.tables as tables 9 | 10 | class Settings(metaclass=ABCMeta): 11 | @abstractmethod 12 | def get(self, key, defaultval=None): 13 | pass 14 | 15 | def getInt(self, key, defaultval=0): 16 | val = self.get(key, defaultval=defaultval) 17 | if val is None and defaultval is None: 18 | return None 19 | return int(val if val is not None else defaultval) 20 | 21 | def getFloat(self, key, defaultval=0.0): 22 | val = self.get(key, defaultval=defaultval) 23 | if val is None and defaultval is None: 24 | return None 25 | return float(val if val is not None else defaultval) 26 | 27 | def getBool(self, key, defaultval=False): 28 | val = self.get(key, defaultval=defaultval) 29 | if val == '1': 30 | return True 31 | if val == '0': 32 | return False 33 | if val in ['True', 'true', 't']: 34 | return True 35 | if val in ['False', 'false', 'f']: 36 | return False 37 | return defaultval 38 | 39 | def __getattr__(self, name): 40 | return self.get(name) 41 | 42 | def __getitem__(self, name): 43 | return self.get(name) 44 | 45 | class DATSettings(Settings): 46 | def __init__(self, dat, usecols=False): 47 | self.dat = dat 48 | self.usecols = usecols 49 | 50 | def get(self, key, defaultval=None): 51 | return tables.getStr(self.dat, key, defaultval=defaultval, usecols=self.usecols) 52 | 53 | class CHOPSettings(Settings): 54 | def __init__(self, chop): 55 | self.chop = chop 56 | 57 | def get(self, key, defaultval=None): 58 | if self.chop is None: 59 | return defaultval 60 | chan = self.chop[key] 61 | return chan.eval() if chan is not None else defaultval 62 | 63 | class DictSettings(Settings): 64 | def __init__(self, settingsdict): 65 | self.settingsdict = settingsdict 66 | 67 | def get(self, key, defaultval=None): 68 | if self.settingsdict is None: 69 | return defaultval 70 | return self.settingsdict.get(key, defaultval) 71 | 72 | class NullSettings(Settings): 73 | def get(self, key, defaultval=None): 74 | return defaultval -------------------------------------------------------------------------------- /midi-fighter-twister.mfs: -------------------------------------------------------------------------------- 1 | 4  2 |  ?  3 |  p0kX?  4 |   @,? 5 |   A3? 6 |   B3? 7 |   C3? 8 |   D7? 9 |   E7? 10 |   F7? 11 |   G7?  12 |   H; ? 13 |  14 |   I ; ?  15 |   J 16 | ; ?  17 |   K ; ?  18 |   L ? ? 19 |   M ? ? 20 |   N? ? 21 |   O? ? 22 | PC? 23 | QC? 24 | RC? 25 | SC? 26 | TG? 27 | UG? 28 | VG? 29 | WG? 30 | XK? 31 | YK? 32 | ZK? 33 | [K? 34 | \O? 35 | ]O? 36 | ^O?  37 | _O?! 38 |  `Sd?" 39 |  aSd?# 40 |  bSd?$ 41 |  cSd?% 42 |  dWd?& 43 |  eWd?' 44 |  fWd?( 45 |  gWd?) 46 |   h[q?* 47 |   i)[q?+ 48 |   j*[q?, 49 |   k+[q?- 50 |   l,_q?. 51 |   m-_q?/ 52 |   n._q?0 53 |   o/_q?1 54 |  p0kX?2 55 |  q1kX?3 56 |  r2kX?4 57 |  s3kX?5 58 |  t4kX?6 59 |  u5kX?7 60 |  v6kX?8 61 |  w7kX?9 62 |  x8^Q?: 63 |  y9^Q?; 64 |  z:^Q?< 65 |  {;^Q?= 66 |  |<^Q?> 67 |  }=^Q?? 68 |  ~>^Q?@ 69 |  ?^Q? -------------------------------------------------------------------------------- /midi-fighter-twister2.mfs: -------------------------------------------------------------------------------- 1 | 4  2 |  ?  3 |   @??  4 |   @?? 5 |   A?? 6 |   B?? 7 |   C?? 8 |   D?? 9 |   E?? 10 |   F?? 11 |   G??  12 |   H?? 13 |  14 |   I ??  15 |   J 16 | ??  17 |   K ??  18 |   L ?? 19 |   M ?? 20 |   N?? 21 |   O?? 22 |   P? ? 23 |   Q, ? 24 |   R, ? 25 |   S, ? 26 |   T, ? 27 |   U, ? 28 |   V, ? 29 |   W, ? 30 |   X, ? 31 |   Y, ? 32 |   Z, ? 33 |   [, ? 34 |   \, ? 35 |   ], ? 36 |   ^, ?  37 |   _, ?! 38 |   ` dq?" 39 |   a!dq?# 40 |   b"dq?$ 41 |   c#dq?% 42 |   d$dq?& 43 |   e%dq?' 44 |   f&dq?( 45 |   g'dq?) 46 |   h(dq?* 47 |   i)dq?+ 48 |   j*dq?, 49 |   k+dq?- 50 |   l,dq?. 51 |   m-dq?/ 52 |   n.dq?0 53 |   o/dq?1 54 |  p0?X?2 55 |  q1?X?3 56 |  r2?X?4 57 |  s3?X?5 58 |  t4?X?6 59 |  u5?X?7 60 |  v6?X?8 61 |  w7?X?9 62 |  x8?Q?: 63 |  y9?Q?; 64 |  z:?Q?< 65 |  {;?Q?= 66 |  |<?Q?> 67 |  }=?Q?? 68 |  ~>?Q?@ 69 |  ??Q? -------------------------------------------------------------------------------- /tektmodules/tables.py: -------------------------------------------------------------------------------- 1 | __author__ = 'tekt' 2 | 3 | def _prepDATArg(dat): 4 | return op(dat) if isinstance(dat, str) else dat 5 | 6 | def colvals(dat, col, joiner=' '): 7 | dat = _prepDATArg(dat) 8 | if dat.numRows == 0: 9 | return [] if joiner is None else "" 10 | vals = [c.val for c in dat.col(col)] 11 | return vals if joiner is None else joiner.join(vals) 12 | 13 | def rowvals(dat, row, joiner=' '): 14 | dat = _prepDATArg(dat) 15 | if dat.numRows == 0: 16 | return [] if joiner is None else "" 17 | vals = [c.val for c in dat.row(row)] 18 | return vals if joiner is None else joiner.join(vals) 19 | 20 | def rowsToDicts(dat): 21 | dat = _prepDATArg(dat) 22 | if dat.numRows < 2: 23 | return [] 24 | names = dat.row(0) 25 | return (_tableLineToDict(names, dat.row(i)) for i in range(1, dat.numRows)) 26 | 27 | def colsToDicts(dat): 28 | dat = _prepDATArg(dat) 29 | if dat.numCols < 2: 30 | return [] 31 | names = dat.col(0) 32 | return (_tableLineToDict(names, dat.col(i)) for i in range(1, dat.numCols)) 33 | 34 | def _tableLineToDict(names, vals): 35 | return {names[i].val: vals[i].val for i in range(len(names))} 36 | 37 | def rowToDict(row): 38 | if row is None or len(row) is 0: 39 | return {} 40 | dat = row[0].owner 41 | return _tableLineToDict(dat.row(0), row) 42 | 43 | def colToDict(col): 44 | if col is None or len(col) is 0: 45 | return {} 46 | dat = col[0].owner 47 | return _tableLineToDict(dat.col(0), col) 48 | 49 | def tableToDict(dat, vertical=True): 50 | dat = _prepDATArg(dat) 51 | if vertical: 52 | return colToDict(dat.col(1)) 53 | else: 54 | return colToDict(dat.row(1)) 55 | 56 | def appendDictRow(dat, rowdict): 57 | dat = _prepDATArg(dat) 58 | dat.appendRow([rowdict.get(name.val, '') for name in dat.row(0)]) 59 | 60 | def getStr(dat, key, defaultval=None, usecols=False): 61 | dat = _prepDATArg(dat) 62 | if dat is None or dat.numRows == 0: 63 | return defaultval 64 | cell = dat[1, key] if usecols else dat[key, 1] 65 | return defaultval if cell is None or cell.val == '' else cell.val 66 | 67 | def getFloat(dat, key, defaultval=0.0, usecols=False): 68 | val = getStr(dat, key, usecols) 69 | return float(defaultval if val is None else val) 70 | 71 | def getInt(dat, key, defaultval=0, usecols=False): 72 | val = getStr(dat, key, usecols) 73 | return int(defaultval if val is None else val) 74 | 75 | def getBool(dat, key, defaultval=False, usecols=False): 76 | val = getInt(dat, key, defaultval=1 if defaultval else 0, usecols=usecols) 77 | return val != 0 78 | -------------------------------------------------------------------------------- /livid preset.json: -------------------------------------------------------------------------------- 1 | { 2 | "4": [ 3 | 1, 4 | 0, 5 | 0, 6 | 0, 7 | 0, 8 | 0, 9 | 0, 10 | 0 11 | ], 12 | "8": [ 13 | 60 14 | ], 15 | "11": [ 16 | 33, 17 | 1, 18 | 34, 19 | 1, 20 | 41, 21 | 1, 22 | 42, 23 | 1, 24 | 49, 25 | 1, 26 | 50, 27 | 1, 28 | 57, 29 | 1, 30 | 58, 31 | 1, 32 | 35, 33 | 1, 34 | 36, 35 | 1, 36 | 43, 37 | 1, 38 | 44, 39 | 1, 40 | 51, 41 | 1, 42 | 52, 43 | 1, 44 | 59, 45 | 1, 46 | 60, 47 | 1, 48 | 37, 49 | 1, 50 | 38, 51 | 1, 52 | 45, 53 | 1, 54 | 46, 55 | 1, 56 | 53, 57 | 1, 58 | 54, 59 | 1, 60 | 61, 61 | 1, 62 | 62, 63 | 1, 64 | 39, 65 | 1, 66 | 40, 67 | 1, 68 | 47, 69 | 1, 70 | 48, 71 | 1, 72 | 55, 73 | 1, 74 | 56, 75 | 1, 76 | 63, 77 | 1, 78 | 64, 79 | 1, 80 | 33, 81 | 0, 82 | 34, 83 | 0, 84 | 35, 85 | 0, 86 | 36, 87 | 0, 88 | 37, 89 | 0, 90 | 38, 91 | 0, 92 | 39, 93 | 0, 94 | 40, 95 | 0, 96 | 41, 97 | 0, 98 | 42, 99 | 0, 100 | 43, 101 | 0, 102 | 44, 103 | 0, 104 | 45, 105 | 0 106 | ], 107 | "12": [ 108 | 15 109 | ], 110 | "13": [ 111 | 1 112 | ], 113 | "15": [ 114 | 4 115 | ], 116 | "16": [ 117 | 1, 118 | 1, 119 | 9, 120 | 1, 121 | 17, 122 | 1, 123 | 25, 124 | 1, 125 | 2, 126 | 1, 127 | 10, 128 | 1, 129 | 18, 130 | 1, 131 | 26, 132 | 1, 133 | 3, 134 | 1, 135 | 11, 136 | 1, 137 | 19, 138 | 1, 139 | 27, 140 | 1, 141 | 4, 142 | 1, 143 | 12, 144 | 1, 145 | 20, 146 | 1, 147 | 28, 148 | 1, 149 | 5, 150 | 1, 151 | 13, 152 | 1, 153 | 21, 154 | 1, 155 | 29, 156 | 1, 157 | 6, 158 | 1, 159 | 14, 160 | 1, 161 | 22, 162 | 1, 163 | 30, 164 | 1, 165 | 7, 166 | 1, 167 | 15, 168 | 1, 169 | 23, 170 | 1, 171 | 31, 172 | 1, 173 | 8, 174 | 1, 175 | 16, 176 | 1, 177 | 24, 178 | 1, 179 | 32, 180 | 1 181 | ], 182 | "17": [ 183 | 0, 184 | 0, 185 | 0, 186 | 0, 187 | 0, 188 | 0, 189 | 0, 190 | 0 191 | ], 192 | "22": [ 193 | 0 194 | ], 195 | "23": [ 196 | 0, 197 | 1, 198 | 2, 199 | 3 200 | ], 201 | "26": [ 202 | 0 203 | ], 204 | "30": [ 205 | 2, 206 | 1 207 | ], 208 | "31": [ 209 | 0, 210 | 0, 211 | 0, 212 | 0, 213 | 0, 214 | 0, 215 | 0, 216 | 0, 217 | 0, 218 | 0, 219 | 0, 220 | 0, 221 | 0, 222 | 0, 223 | 0, 224 | 0, 225 | 0, 226 | 0, 227 | 0, 228 | 0, 229 | 0, 230 | 0, 231 | 0, 232 | 0, 233 | 0, 234 | 0, 235 | 0, 236 | 0, 237 | 0, 238 | 0, 239 | 0, 240 | 0, 241 | 0, 242 | 0, 243 | 0, 244 | 0, 245 | 0, 246 | 0, 247 | 0, 248 | 0, 249 | 0, 250 | 0, 251 | 0, 252 | 0, 253 | 0, 254 | 0, 255 | 0, 256 | 0, 257 | 0, 258 | 0, 259 | 0, 260 | 0, 261 | 0, 262 | 0, 263 | 0, 264 | 0, 265 | 0, 266 | 0, 267 | 0, 268 | 0, 269 | 0, 270 | 0, 271 | 0, 272 | 0 273 | ], 274 | "32": [ 275 | 0 276 | ], 277 | "35": [ 278 | 127, 279 | 127, 280 | 1, 281 | 2, 282 | 3, 283 | 127, 284 | 5, 285 | 6, 286 | 7, 287 | 8, 288 | 9, 289 | 11, 290 | 12, 291 | 13, 292 | 16, 293 | 17, 294 | 18, 295 | 19, 296 | 20, 297 | 21, 298 | 22, 299 | 23, 300 | 24, 301 | 25, 302 | 27, 303 | 28, 304 | 29, 305 | 32, 306 | 33, 307 | 34, 308 | 35, 309 | 36, 310 | 37, 311 | 127, 312 | 39, 313 | 40, 314 | 41, 315 | 43, 316 | 44, 317 | 45, 318 | 48, 319 | 49, 320 | 50, 321 | 51, 322 | 52, 323 | 53, 324 | 127, 325 | 127, 326 | 127, 327 | 127, 328 | 127, 329 | 127, 330 | 127, 331 | 127, 332 | 127, 333 | 127, 334 | 127, 335 | 127, 336 | 127, 337 | 127, 338 | 127, 339 | 127, 340 | 127, 341 | 127, 342 | 127, 343 | 127, 344 | 127, 345 | 127, 346 | 127, 347 | 127, 348 | 127, 349 | 127, 350 | 127, 351 | 127, 352 | 127, 353 | 127, 354 | 127, 355 | 127, 356 | 127, 357 | 127, 358 | 127, 359 | 127, 360 | 127, 361 | 127, 362 | 127, 363 | 127, 364 | 127, 365 | 127, 366 | 127, 367 | 127, 368 | 127, 369 | 127, 370 | 127, 371 | 127, 372 | 127, 373 | 127, 374 | 127, 375 | 127, 376 | 127, 377 | 127, 378 | 127, 379 | 127, 380 | 127, 381 | 127, 382 | 127, 383 | 127, 384 | 127, 385 | 127, 386 | 127, 387 | 127, 388 | 127, 389 | 127, 390 | 127, 391 | 127, 392 | 127, 393 | 127, 394 | 127, 395 | 127, 396 | 127, 397 | 127, 398 | 127, 399 | 127, 400 | 127, 401 | 127, 402 | 127, 403 | 127, 404 | 127, 405 | 127 406 | ], 407 | "36": [ 408 | 127, 409 | 54, 410 | 58, 411 | 62, 412 | 66, 413 | 70, 414 | 74, 415 | 78, 416 | 82, 417 | 55, 418 | 59, 419 | 63, 420 | 67, 421 | 71, 422 | 75, 423 | 79, 424 | 83, 425 | 56, 426 | 60, 427 | 64, 428 | 68, 429 | 72, 430 | 76, 431 | 80, 432 | 84, 433 | 57, 434 | 61, 435 | 65, 436 | 69, 437 | 73, 438 | 77, 439 | 81, 440 | 85, 441 | 0, 442 | 4, 443 | 8, 444 | 13, 445 | 19, 446 | 23, 447 | 28, 448 | 34, 449 | 1, 450 | 5, 451 | 9, 452 | 16, 453 | 20, 454 | 24, 455 | 29, 456 | 35, 457 | 2, 458 | 6, 459 | 11, 460 | 17, 461 | 21, 462 | 25, 463 | 32, 464 | 36, 465 | 3, 466 | 7, 467 | 12, 468 | 18, 469 | 22, 470 | 27, 471 | 33, 472 | 37, 473 | 127, 474 | 127, 475 | 127, 476 | 127, 477 | 127, 478 | 127, 479 | 127, 480 | 127, 481 | 127, 482 | 127, 483 | 127, 484 | 127, 485 | 127, 486 | 127, 487 | 127, 488 | 127, 489 | 127, 490 | 127, 491 | 127, 492 | 127, 493 | 127, 494 | 127, 495 | 127, 496 | 127, 497 | 127, 498 | 127, 499 | 127, 500 | 127, 501 | 127, 502 | 127, 503 | 127, 504 | 127, 505 | 127, 506 | 127, 507 | 127, 508 | 127, 509 | 127, 510 | 127, 511 | 127, 512 | 127, 513 | 127, 514 | 127, 515 | 127, 516 | 127, 517 | 127, 518 | 127, 519 | 127, 520 | 127, 521 | 127, 522 | 127, 523 | 127, 524 | 127, 525 | 127, 526 | 127, 527 | 127, 528 | 127, 529 | 127, 530 | 127, 531 | 127, 532 | 127, 533 | 127, 534 | 127, 535 | 85 536 | ], 537 | "38": [ 538 | 0, 539 | 0, 540 | 0, 541 | 0, 542 | 0, 543 | 0, 544 | 0, 545 | 0, 546 | 0, 547 | 0, 548 | 0, 549 | 0, 550 | 0, 551 | 0, 552 | 0, 553 | 0, 554 | 0, 555 | 0, 556 | 0, 557 | 0, 558 | 0, 559 | 0, 560 | 0, 561 | 0, 562 | 0, 563 | 0, 564 | 0, 565 | 0, 566 | 0, 567 | 0, 568 | 0, 569 | 0 570 | ], 571 | "39": [ 572 | 0, 573 | 0, 574 | 0, 575 | 0, 576 | 0, 577 | 0, 578 | 0, 579 | 0, 580 | 0, 581 | 0, 582 | 0, 583 | 0, 584 | 0, 585 | 0, 586 | 0, 587 | 0, 588 | 0, 589 | 0, 590 | 0, 591 | 0, 592 | 0, 593 | 0, 594 | 0, 595 | 0, 596 | 0, 597 | 0, 598 | 0, 599 | 0, 600 | 0, 601 | 0, 602 | 0, 603 | 0, 604 | 0, 605 | 0, 606 | 0, 607 | 0, 608 | 0, 609 | 0, 610 | 0, 611 | 0, 612 | 0, 613 | 0, 614 | 0, 615 | 0, 616 | 0, 617 | 0, 618 | 0, 619 | 0, 620 | 0, 621 | 0, 622 | 0, 623 | 0, 624 | 0, 625 | 0, 626 | 0, 627 | 0, 628 | 0, 629 | 0, 630 | 0, 631 | 0, 632 | 0, 633 | 0, 634 | 0, 635 | 0, 636 | 0, 637 | 0, 638 | 0, 639 | 0, 640 | 0, 641 | 0, 642 | 0, 643 | 0, 644 | 0, 645 | 0, 646 | 0, 647 | 0, 648 | 0, 649 | 0, 650 | 0, 651 | 0, 652 | 0, 653 | 0, 654 | 0, 655 | 0, 656 | 0, 657 | 0, 658 | 0, 659 | 0, 660 | 0, 661 | 0, 662 | 0, 663 | 0, 664 | 0, 665 | 0, 666 | 0, 667 | 0, 668 | 0, 669 | 0, 670 | 0, 671 | 0, 672 | 0, 673 | 0, 674 | 0, 675 | 0, 676 | 0, 677 | 0, 678 | 0, 679 | 0, 680 | 0, 681 | 0, 682 | 0, 683 | 0, 684 | 0, 685 | 0, 686 | 0, 687 | 0, 688 | 0, 689 | 0, 690 | 0, 691 | 0, 692 | 0, 693 | 0, 694 | 0, 695 | 0, 696 | 0, 697 | 0, 698 | 0, 699 | 0 700 | ], 701 | "50": [ 702 | 1, 703 | 1, 704 | 1, 705 | 1, 706 | 1, 707 | 1, 708 | 1, 709 | 1, 710 | 1, 711 | 1, 712 | 1, 713 | 1, 714 | 1, 715 | 1, 716 | 1, 717 | 1, 718 | 1, 719 | 1, 720 | 1, 721 | 1, 722 | 1, 723 | 1, 724 | 1, 725 | 1, 726 | 1, 727 | 1, 728 | 1, 729 | 1, 730 | 1, 731 | 1, 732 | 1, 733 | 1 734 | ], 735 | "54": [ 736 | 15, 737 | 15, 738 | 15, 739 | 15, 740 | 15, 741 | 15, 742 | 15, 743 | 15, 744 | 0, 745 | 0, 746 | 0, 747 | 0 748 | ], 749 | "55": [ 750 | 0, 751 | 0, 752 | 0, 753 | 0, 754 | 0, 755 | 0, 756 | 0, 757 | 0 758 | ], 759 | "75": [ 760 | 0, 761 | 0 762 | ], 763 | "127": [], 764 | "name": "livid preset.json", 765 | "id": 4, 766 | "mfg": 97 767 | } --------------------------------------------------------------------------------