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

SfPlayer and SfMarker tracebacks #123

Closed
vism2889 opened this issue May 17, 2018 · 14 comments
Closed

SfPlayer and SfMarker tracebacks #123

vism2889 opened this issue May 17, 2018 · 14 comments

Comments

@vism2889
Copy link

Have tried with SfPlayer and SfMarker.
Code:

from pyo import *

s = Server().boot()
s.start()
sf = SfMarkerLooper("/sample.wav", speed=[.999,1], mul=.3).out()
s.gui(locals())

Terminal Output:

Traceback (most recent call last):
  File "fm_synth.py", line 5, in <module>
    sf = SfMarkerLooper("/sample.wav", speed=[.999,1], mul=.3).out()
  File "/Users/morganvisnesky/anaconda3/lib/python3.6/site-packages/pyolib/players.py", line 514, in __init__
    self._snd_size, self._dur, self._snd_sr, self._snd_chnls, _format, _type = sndinfo(path[0])
TypeError: 'NoneType' object is not iterable

Also getting this message every time i run a pyo script, but using pythonw filename.py at the terminal seems to allow everything to work with the exception of these sample related calls:

"WARNING: 140: This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h."

@belangeo
Copy link
Owner

This path, "/sample.wav", means that a file sample.wav is located at the root of the computer... It seems suspicious!

Also, SfMarker* objects work only with AIFF files as it needs to read the markers chunk.

The warning just says that a component involve in the process (my guess would be portaudio) still use some deprecated carbon calls. Nothing to worry about for now...

@vism2889
Copy link
Author

Changed to this:

from pyo import *

s = Server().boot()
s.start()
sf = SfMarkerLooper("sample.aif", speed=[.999,1], mul=.3).out()
s.gui(locals())

using a mac, file is in same folder as .py file

error message is still the same:

Traceback (most recent call last):
  File "sample_test.py", line 5, in <module>
    sf = SfMarkerLooper("sample.aif", speed=[.999,1], mul=.3).out()
  File "/Users/morganvisnesky/anaconda3/lib/python3.6/site-packages/pyolib/players.py", line 514, in __init__
    self._snd_size, self._dur, self._snd_sr, self._snd_chnls, _format, _type = sndinfo(path[0])
TypeError: 'NoneType' object is not iterable

Appreciate your time!

@belangeo
Copy link
Owner

Is "sample.aif" is a big file? If not, can you attach it so I can try and see what's going wrong?

@vism2889
Copy link
Author

Github doesn't support .aif for drag and drop, but i have the .aif here .

Thanks for the help with this!

@belangeo
Copy link
Owner

Something's weird with your soundfile... Here is the output of sox when asking for file info:

olivier@Olivier-x270:~/Downloads$ sox --i sample.aif
sox FAIL formats: can't open input file sample.aif': Unsupported AIFC compression type able'

If sox can't read the sound (audacity can't open it neither), I doubt pyo will do...

How did you produce that file?

@vism2889
Copy link
Author

Hmm, yeah its just a sample from a sample pack, just snagged one at random. Its a completely different file from the .wav i used before. Any chance you'd be able to attach an .aiff file that you know is working for me to try, just to confirm on my end that its the issue?

@vism2889
Copy link
Author

01-read-from-disk.py - Soundfile playback from disk.
SfPlayer and friends read samples from a file on disk with control
over playback speed and looping mode.
Player family:
    - **SfPlayer** : Reads many soundfile formats from disk.
    - **SfMarkerLooper** : AIFF with markers soundfile looper.
    - **SfMarkerShuffler** : AIFF with markers soundfile shuffler.
Reading sound file from disk can save a lot of RAM, especially if
the soundfile is big, but it is more CPU expensive than loading
the sound file in memory in a first pass.

In this file description it mentions that SFplayer reads many file formats. I mentioned in the first comment, I have tried SFPlayer and SFMarker with both .wav and .aif files. Willing to try whatever on my end, just kind of lost as to why its not happy with my code and files at the moment.

@belangeo
Copy link
Owner

There is a few samples installed with pyo. Try this code, it should work without issue:

from pyo import *

s = Server().boot()
s.start() 
mark = RandInt(5, 1)
sf = SfMarkerLooper(SNDS_PATH+"/transparent.aif", speed=[.999,1], mark=mark, mul=.3).out()

s.gui(locals())

@belangeo
Copy link
Owner

Yep, SfPlayer can read many file formats. Only SfMarker* objects need an AIFF.

@vism2889
Copy link
Author

Alright so, that runs from the command line without errors. Also tried that with my .wav and it runs. I'm not getting any sound though, or visual indicator of sound from the pyo server window.

@belangeo
Copy link
Owner

You don't get any sound with your wav file because there is no markers in a wav. Try this:

from pyo import *
s = Server().boot()
s.start()
sf = SfPlayer("sample.wav", speed=[.999, 1], loop=True, mul=.3).out()
s.gui(locals())

@vism2889
Copy link
Author

This still just pops up a pyo server that doesn't output any sound :/

@belangeo
Copy link
Owner

Let me try your file...

@belangeo
Copy link
Owner

Closing as i don't think there is an issue here. I'm pretty sure the problem is the format of the file itself or a path problem.

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