Skip to content

Commit

Permalink
Remove unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
irisyupingren authored Nov 22, 2018
1 parent 6199b36 commit 3368f97
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions scripts/jams_to_mirex_pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@
./jams_to_mirex_pattern.py /path/to/file.jams outputname
'''

import csv
import json
import sys
from argparse import ArgumentParser
import os
import jams



def parse_arguments(args):

parser = ArgumentParser(description='Parse JAMS annotations into the MIREX Pattern Discovery task format')
Expand All @@ -30,12 +26,10 @@ def run(infile='', output_prefix='annotation'):
with open(infile, 'r') as fdesc:
x = json.load(fdesc)

record = []
for elem in x["annotations"]:
# looping through the annotators

metadata = elem["annotation_metadata"]
namespace = elem["namespace"]
anno = metadata["annotator"]
d = elem["data"]

Expand All @@ -55,7 +49,6 @@ def run(infile='', output_prefix='annotation'):
for y in d:
# lopping through the events given an annotator
time = y["time"]
dur = y["duration"]

pid = y["value"]["pattern_id"]

Expand All @@ -66,16 +59,12 @@ def run(infile='', output_prefix='annotation'):
text_file.write("Occ"+str(ocount)+"\n")

midip = y["value"]["midi_pitch"]
morphp = y["value"]["morph_pitch"]
staff = y["value"]["staff"]
occid = y["value"]["occurrence_id"]

if occid != pastoid:
ocount += 1
text_file.write("Occ"+str(ocount)+"\n")

c = y["confidence"]

pastpid = pid
pastoid = occid

Expand Down

0 comments on commit 3368f97

Please sign in to comment.