Skip to content

proof-of-concept cython wrap of sunvox developer library

Notifications You must be signed in to change notification settings

shakfu/pysunvox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pysunvox - a cython wrap of the sunvoxlib

This is a minimal proof-of-concept cython wrap of the sunvox library for developers for macOS.

Usage

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()

Requirements

Tested on macOS only.

Compilation

# to compile
make

# to test
make test

# to clean
make clean

# to reset (removes cython generated c-code)
make reset

License / Credits

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

About

proof-of-concept cython wrap of sunvox developer library

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages