ziqiangao commited on
Commit
08e97cd
·
2 Parent(s): db725c9 14eab2a

Merge branches 'main' and 'main' of hf.co:spaces/ziqiangao/musicscopegen

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -18,6 +18,11 @@ import shutil
18
 
19
  path = "" # Update with your path
20
 
 
 
 
 
 
21
 
22
  def getRenderCords(ta: list, idx: int, res: int = 1024, size: tuple = (1280, 720)) -> list:
23
  i = idx - res // 2
 
18
 
19
  path = "" # Update with your path
20
 
21
+ def getTrigger(ad: int, a: list, max: int = 1024) -> int:
22
+ i = ad
23
+ while not (a[i] < 120 and not a[i + 6] < 130 or i - ad > max):
24
+ i += 1
25
+ return i
26
 
27
  def getRenderCords(ta: list, idx: int, res: int = 1024, size: tuple = (1280, 720)) -> list:
28
  i = idx - res // 2