Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load_module example #6

Open
coderofsalvation opened this issue May 20, 2019 · 5 comments
Open

load_module example #6

coderofsalvation opened this issue May 20, 2019 · 5 comments

Comments

@coderofsalvation
Copy link

coderofsalvation commented May 20, 2019

interesting, for some reason this doesn't load any sunsynth on linux.
I tried looking at radiant voices, but everything seems similar.
Basically I cloned this repo, and tried to run this script (fragment):

Screenshot 2019-05-20 at 19 07 50

running myscript.py test.sunsynth gives me the following output:

Screenshot 2019-05-20 at 19 08 00

What i tried:

  • adding encode('utf-8') and encode('utf8')
  • loading an empty .sunvox before calling load_module(...)

Any tips appreciated

@matthewryanscott
Copy link
Contributor

Looks like you need a call to connect_module after load_module, to connect the loaded sunsynth's module to the output module. I'm not at a desktop while writing this so can't test or offer a line to copy and paste, but hopefully this helps.

@coderofsalvation
Copy link
Author

coderofsalvation commented May 21, 2019

hm I tried connect_module(0,1) (sorry for not mentioning it) since I noticed you doing it in your code as well.
It is however not the audio output I'm going for, but reading the parameters from the module.
The (sunsynth) module is not appearing however in the for-loop.

If I load the sunsynth in sunvox, and save it into 'empty.sunvox', then the modulename of the sunsynth does appear in the for-loop. Could it be that load_module does not set a modulename?

@matthewryanscott
Copy link
Contributor

Hmm. Ok, I will try to look at this during the daytime then and see what I can do to help.

@matthewryanscott
Copy link
Contributor

This is a bug. It should accept a filename. Let's keep this issue open until it's fixed.

Workaround for now is to open the file and pass in the open file object:

with open(file, 'rb') as f:
    slot.load_module(f, 5, 5, 5)

@coderofsalvation
Copy link
Author

aha thank you very much for clearing this up.
Thanks for the workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants