Skip to content

Commit

Permalink
Cleaned up steinburg code
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean1572 committed Jun 28, 2022
1 parent 6f2da05 commit 08d5170
Show file tree
Hide file tree
Showing 2 changed files with 253 additions and 314 deletions.
22 changes: 3 additions & 19 deletions PyHa/IsoAutio.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,29 +324,13 @@ def steinberg_isolate(
# rework the algorithm so that it builds the dataframe correctly to save
# time.

#Spilt offset to get into kaledoscope
#Spilt offset array so entry is in kaledoscope format
entry = entry.assign(
OFFSET=entry['OFFSET'].apply(get_offset),
DURATION=entry['OFFSET'].apply(get_duration)
OFFSET=entry['OFFSET'].apply(lambda arr: arr[0]),
DURATION=entry['OFFSET'].apply(lambda arr: arr[1]-arr[0])
)

#OFFSET = entry['OFFSET'].str[0] #OFFSET = entry['OFFSET'].str[0]
#DURATION = entry['OFFSET'].str[1] #DURATION = entry['OFFSET'].str[1]
#DURATION = DURATION - OFFSET
# Adding a new "DURATION" Column
# Making compatible with Kaleidoscope
#entry.insert(6, "DURATION", DURATION)
#entry["OFFSET"] = OFFSET
return entry

## STEINBURG HELPER FUNCTIONS
def get_offset(arr):
return arr[0]

def get_duration(arr):
return arr[1] - arr[0]



def simple_isolate(
local_scores,
Expand Down
545 changes: 250 additions & 295 deletions PyHa_Testing.ipynb

Large diffs are not rendered by default.

0 comments on commit 08d5170

Please sign in to comment.