diff --git a/input/dataInput.py b/input/dataInput.py new file mode 100755 index 0000000000000000000000000000000000000000..6a7ffc89f48fc7e5aae1e7fa857569ff43d3e57c --- /dev/null +++ b/input/dataInput.py @@ -0,0 +1,31 @@ +#!/bin/env python3 +# Type data into https://recolic.net/phy +# Edit&reuse it if you want. +# I'm making it print python code for other usage. +# Recolic Keghart. + +import sys +if len(sys.argv) < 2: + print('Usage: ./dataInput.py /path/to/dat/file | python') + exit(123) + +import numpy +dataset=numpy.loadtxt(sys.argv[1], delimiter=' ') +print('#!/bin/env python3') +print('from pykeyboard import PyKeyboard') +print('import time') +print('k=PyKeyboard()') +oneLine=False +for ar in dataset: + if type(ar) == numpy.float64: + ar=dataset #fuck numpy...... + oneLine=True + if len(ar) == 0: + continue + print('print(\'Waiting for 5 second... Please be ready for auto-typing.\')') + print('time.sleep(5)') + for i in ar: + print('k.type_string(\''+ str(i) +'\')') + print('k.tap_key(k.tab_key)') + if oneLine: + break diff --git a/input/sound-converted.dat b/input/sound-converted.dat new file mode 100644 index 0000000000000000000000000000000000000000..d9c87a9180201d40d0a864065ce02281eac61596 --- /dev/null +++ b/input/sound-converted.dat @@ -0,0 +1,2 @@ +36837 37258 36845 37345 36870 37283 36855 37327 36843 37261 +3.54 4.37 8.26 25.9 13.2 47.7 17.7 66.95 22.46 87.16 27.14 108.6 32.06 129.9 36.68 150.8 41.48 173.35 46.3 194.69 50.86 217.16 55.8 239.56 diff --git a/sound/1.dat b/sound/1.dat new file mode 100644 index 0000000000000000000000000000000000000000..2e6073ad6e3c6d376024de8fb2ba60ec23f21a54 --- /dev/null +++ b/sound/1.dat @@ -0,0 +1 @@ +36837 37258 36845 37345 36870 37283 36855 37327 36843 37261 diff --git a/sound/2.dat b/sound/2.dat new file mode 100644 index 0000000000000000000000000000000000000000..718301e75b50fcc04184209e3a521cd4c7667992 --- /dev/null +++ b/sound/2.dat @@ -0,0 +1 @@ +3.54 4.37 8.26 25.9 13.2 47.7 17.7 66.95 22.46 87.16 27.14 108.6 32.06 129.9 36.68 150.8 41.48 173.35 46.3 194.69 50.86 217.16 55.8 239.56 diff --git a/sound/dat-origin b/sound/dat-origin new file mode 100644 index 0000000000000000000000000000000000000000..ddb0d154ed23e541f55412cab1af0feafa56efae --- /dev/null +++ b/sound/dat-origin @@ -0,0 +1,10 @@ +sound2 +sound3 +3.54 8.26 13.20 17.70 22.46 27.14 32.06 36.68 41.48 46.30 50.86 55.80 +4.37 25.90 47.70 66.95 87.16 108.60 129.90 150.80 173.35 194.69 217.16 239.56 + +conv +3.54 4.37 8.26 25.9 13.2 47.7 17.7 66.95 22.46 87.16 27.14 108.6 32.06 129.9 36.68 150.8 41.48 173.35 46.3 194.69 50.86 217.16 55.8 239.56 + +sound1 +36837 37258 36845 37345 36870 37283 36855 37327 36843 37261 diff --git a/sound/dataInput.py b/sound/dataInput.py new file mode 100755 index 0000000000000000000000000000000000000000..6a7ffc89f48fc7e5aae1e7fa857569ff43d3e57c --- /dev/null +++ b/sound/dataInput.py @@ -0,0 +1,31 @@ +#!/bin/env python3 +# Type data into https://recolic.net/phy +# Edit&reuse it if you want. +# I'm making it print python code for other usage. +# Recolic Keghart. + +import sys +if len(sys.argv) < 2: + print('Usage: ./dataInput.py /path/to/dat/file | python') + exit(123) + +import numpy +dataset=numpy.loadtxt(sys.argv[1], delimiter=' ') +print('#!/bin/env python3') +print('from pykeyboard import PyKeyboard') +print('import time') +print('k=PyKeyboard()') +oneLine=False +for ar in dataset: + if type(ar) == numpy.float64: + ar=dataset #fuck numpy...... + oneLine=True + if len(ar) == 0: + continue + print('print(\'Waiting for 5 second... Please be ready for auto-typing.\')') + print('time.sleep(5)') + for i in ar: + print('k.type_string(\''+ str(i) +'\')') + print('k.tap_key(k.tab_key)') + if oneLine: + break diff --git a/sound/quickmap.py b/sound/quickmap.py new file mode 100644 index 0000000000000000000000000000000000000000..e0eb9bf9ef7982cea0c600d73e5b9643153f176c --- /dev/null +++ b/sound/quickmap.py @@ -0,0 +1,57 @@ +#!/bin/env python3 +# -*- coding: UTF-8 -*- +# Gereric: Draw line. +# Recolic Keghart, Apr 29, 2017. + +import numpy +from scipy.optimize import leastsq +import matplotlib.pyplot as plt +from matplotlib import rcParams + +def GetMap(parrX, parrY, windowX = 12, windowY = 8, line = False, passO = False): + print('Generic-GetMap by Recolic.') + arrX, arrY = parrX, parrY + maxX, maxY = max(arrX)*1.2, max(arrY)*1.25 + + # Do calculate + # y = k x + b (I = k V + b) + print('Your input: ', arrX, '|', arrY) + print('Data collection done. Generating result...') + V, I = numpy.array(arrX), numpy.array(arrY) + def lineFunc(kb, v): + k,b=kb + if passO: + return k*v + else: + return k*v+b + + lossFunc = lambda kb, v, i : lineFunc(kb, v) - i + + # Fire! + if line: + kb0 = [10,0] + kbFinal = leastsq(lossFunc, kb0, args=(V, I)) + k,b=kbFinal[0] + print('Fit line done. Y=', k, 'X +', b) + else: + print('Drawing map without fitting a line...') + + # Draw function map. + rcParams['grid.linestyle']='-' + rcParams['grid.color'] = 'blue' + rcParams['grid.linewidth'] = 0.2 + plt.figure(figsize=(windowX, windowY)) + plt.scatter(V,I,color="red",label="Sample Point",linewidth=3) + if line: + px=numpy.linspace(0,maxX,1000) + py=k*px+b + plt.plot(px,py,color="orange",label="Fitting Line",linewidth=2) + plt.legend() + plt.grid() + plt.show() + + def toFloat(sstr): + if sstr == '': + return 0.0 + else: + return float(sstr) \ No newline at end of file diff --git a/sound/try-https:-recolic.net-phy b/sound/try-https:-recolic.net-phy new file mode 100644 index 0000000000000000000000000000000000000000..13ed0e93e75ee62ed78baa185986b5366f4402ac --- /dev/null +++ b/sound/try-https:-recolic.net-phy @@ -0,0 +1 @@ +try https://recolic.net/phy