<commit_before><commit_msg>added midi.player module so you can play sequences from the interactive shell (at least in OS X)<commit_after>## The goal of this module is to eventually be to MIDI players what
## 'webbrowser' is to Web browsers.
##
## Personally, I only need it to work on OS X so patches accepted for other
## operating systems.

import sys
import tempfile
import subprocess
import write_midi

def play(sequence):
    if sys.platform == "darwin":
        
        f = tempfile.NamedTemporaryFile(suffix=".mid", delete=False)
        s = write_midi.SMF(sequence)
        s.write(f)
        f.close()
        
        subprocess.call(["open", f.name])
    else:
        print "Only OS X supported at the moment. Patches accepted!"
{'fraction_non_alphanumeric': 0.09041835357624832, 'fraction_numerical': 0.0, 'mean_word_length': 3.1222222222222222, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6292864', 'n_tokens_mistral': 216, 'n_tokens_neox': 209, 'n_words': 85}