def clone(self): synth = Synth(self) f = io.BytesIO() synth.write_to(f) f.seek(0) synth2 = read_sunvox_file(f) f.close() return synth2.module
def test_empty(): project = read_sunvox_file(str(FIXTURE_DIR / "empty.sunvox")) assert project.name == "empty" assert project.initial_bpm == 125 assert project.initial_tpl == 6 assert base2_to_base10(project.global_volume) == 100 assert project.sunvox_version == (1, 9, 1, 0) assert project.based_on_version == (1, 2, 3, 4) assert len(project.modules) == 1 output = project.modules[0] assert isinstance(output, modules.Output) assert output.finetune == 0 assert output.relative_note == 0 assert output.layer == 0 assert base2_to_base10(output.scale) == 100
def load_chunk(self, chunk): chnm = chunk.chnm chdt = chunk.chdt if chnm == self.options_chnm: self.load_options(chunk) elif chnm == 0: self.load_envelopes(chunk) elif chnm < 0x101 and chnm % 2 == 1: self.load_sample_meta(chunk) elif chnm < 0x101 and chnm % 2 == 0: self.load_sample_data(chunk) elif chnm == 0x101: self._unknown_0x101 = chdt elif chnm == 0x102: self.volume_envelope.load_chdt(chdt) elif chnm == 0x103: self.panning_envelope.load_chdt(chdt) elif chnm == 0x104: self.pitch_envelope.load_chdt(chdt) elif 0x105 <= chnm <= 0x108: self.effect_control_envelopes[chnm - 0x105].load_chdt(chdt) elif chnm == 0x10A: self.effect = read_sunvox_file(BytesIO(chdt))
def clone(self): with BytesIO() as f: self.write_to(f) f.seek(0) return read_sunvox_file(f)
def load_project(self, chunk): self.project = read_sunvox_file(BytesIO(chunk.chdt))