This is a minimal proof-of-concept cython wrap of the sunvox library for developers for macOS.
import sunvox
sunvox.play('resources/test.sunvox')
The cython code for the function above is
import time
from sunvox cimport *
def play(path: str, volume: int = 256, slot: int = 0, secs: int = 10):
sv_load_dll()
ver = sv_init(NULL, 44100, 2, 0)
if ver >= 0:
sv_open_slot(slot)
sv_load(slot, path.encode('utf8'))
sv_volume(slot, volume)
sv_play_from_beginning(slot)
time.sleep(secs)
sv_stop(slot)
sv_close_slot(slot)
sv_deinit()
sv_unload_dll()
Tested on macOS only.
- sunvox library for developers
- python3
- cython
# to compile
make
# to test
make test
# to clean
make clean
# to reset (removes cython generated c-code)
make reset
All rights for sunvox
and its developer library reserved to its author, Alexander Zolotov.
(see: https://warmplace.ru)
Powered by SunVox (modular synth & tracker) Copyright (c) 2008 - 2020, Alexander Zolotov [email protected], WarmPlace.ru