infinity-player

infinite jukebox clone using librosa
git clone https://git.ce9e.org/infinity-player.git

commit
fa1cd8cefbf66263a745dee724d9fb1a1dcb2989
parent
491175d30d3f24c28558ae9c7f1448d2c07e66e6
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2021-07-04 09:57
actually use code in normalize

Diffstat

M player.py 4 ++--

1 files changed, 2 insertions, 2 deletions


diff --git a/player.py b/player.py

@@ -100,7 +100,7 @@ def normalize(jumps, threshold):
  100   100     x_max = jumps.max()
  101   101     x_min = x_max * threshold
  102   102     y_max = (x_max + 0.5) / 2
  103    -1     jumps_norm = (jumps - x_min) / (x_max - x_min) * y_max
   -1   103     jumps = (jumps - x_min) / (x_max - x_min) * y_max
  104   104 
  105   105     # privilege jumps back in order to prolong playing
  106   106     jumps *= numpy.ones((n, n)) * 0.9 + numpy.tri(n, k=-1) * 0.1
@@ -112,7 +112,7 @@ def normalize(jumps, threshold):
  112   112         M += numpy.tri(n, k=-i).T
  113   113     jumps *= (M / (n - 1)) ** 0.1
  114   114 
  115    -1     return jumps_norm * (jumps_norm > 0)
   -1   115     return jumps * (jumps > 0)
  116   116 
  117   117 
  118   118 def get_next_position(i, jumps):