Commit bbea9f53 authored by hackecology's avatar hackecology

fix MIDI file output and name configuration

parent 9b8c8f62
......@@ -20,6 +20,8 @@ June, 7th 2019
sjacques
"""
from itertools import count
import csv
import io
......@@ -402,8 +404,11 @@ def export_midi(data, key=None, number_of_octaves=4, bpm = 120,
track += 1
channel = 0
expfile = open("output.mid", 'wb')
DirOut = 'output/'
OutFileName = ("{}.mid".format(track_type))#output name is the track_type
expfile = open(DirOut+OutFileName, 'wb')
midifile.writeFile(expfile)
midifile.close()
......
......@@ -34,5 +34,5 @@ fractal.play_midi_from_data(multitrack_data_with_instruments,
'''
#fractal.write_multi(multitrack_data_with_instruments, track_type='multiple')
fractal.export_midi(multitrack_data_with_instruments, bpm=12,
fractal.export_midi(multitrack_data_with_instruments, bpm=4,
track_type='multiple')
\ No newline at end of file
......@@ -11,12 +11,15 @@ import pandas as pd
import fractaL.core as fractal
DirIn = 'sample_data/'
DirOut = 'output/'
FileNameIn = '1880-2019.json'
with open('sample_data/1880-2019.json') as data_file:
climate_json = json.load(data_file)
with open(DirIn + FileNameIn) as data_file:
climate_json = json.load(data_file)
json_pd = climate_json
normalized_climate_data = fractal.normalize_climate_data(climate_json)
plt.scatter(*zip(*normalized_climate_data))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment