Beispiel #1
0
 def export_wav(self):
     sequence = self.view.musicsheet.sequence
     fileoutput = save_dialog(filter_='wav')
     if not fileoutput:
         return
     sound_array = convert_sequence_to_int16(sequence)
     write(fileoutput, 44100, sound_array)
Beispiel #2
0
 def save(self):
     sequence = self.view.musicsheet.sequence
     filename = save_dialog(filter_='mms')
     if not filename:
         return
     with open(filename, 'w') as f:
         json.dump(sequence, f, indent=2)
Beispiel #3
0
    def export_mid(self):
        sequence = self.view.musicsheet.sequence
        fileoutput = save_dialog(filter_='mid')
        if not fileoutput:
            return

        midifile = convert_to_midi(sequence, tempo=160)
        with open(fileoutput, 'wb') as myfile:
            midifile.writeFile(myfile)
Beispiel #4
0
    def export_xml(self):
        sequence = self.view.musicsheet.sequence
        fileoutput = save_dialog(filter_='xml')
        if not fileoutput:
            return

        xmlcontent = convert_to_musicxml(sequence, tempo=160)
        with open(fileoutput, 'w') as myfile:
            myfile.write(xmlcontent)
Beispiel #5
0
 def save(self):
     if self._workingfile is None:
         filename = save_dialog(filter_="mmp")
         if not filename:
             return
         self._workingfile = filename
     with open(self._workingfile, 'w') as f:
         p = pattern_to_json(self._undo_manager.data)
         json.dump(p, f, indent=2)
     self._undo_manager.set_data_saved()
     self.update_title()
Beispiel #6
0
    def save(self):
        if self._workingfile is None:
            filename = save_dialog(filter_="mmc")
            if not filename:
                return
            self._workingfile = filename

        with open(self._workingfile, 'w') as f:
            chordgrid = self._undo_manager.data
            json.dump(chordgrid, f, indent=2)

        self._undo_manager.set_data_saved()
        self.update_title()