Hi and welcome!
Can you share some code? Even if it doesn't use Pyo. Still, it
would be better if it uses Pyo so we can see what you are trying
to do, and how you do it.
Hi to everyone, I'm new here and I'm a student working on my thesis in Computer Science and Engineering in Politecnico di Milano. I'm trying to do a "real-time" application where I analyze spectral features from a sound and then I generate a sound with some parameters fixed. To do this I'm working with Librosa and mir_eval as libraries, and I was managing the I/O stream with pyaudio. After this I should modify the output changing the timbre and other stuff of the sound, pyo is a very cool library but I'm having a hard time trying to use it in the way I described. I don't get very well how I can manage numpy arrays with this library, I've tried to use the class Data Table and TableRead to read the incoming arrays, but it doesn't seem to work. My questions are: how can I convert a numpy to a pyo object and vice versa, so that I can use my custom function to synthesize a sound? --
You received this message because you are subscribed to the Google Groups "pyo-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyo-discuss/a2b00c82-304f-4d98-bc13-1c8826541c0en%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyo-discuss/b4269f23-cb3b-4479-ada8-ae917b7671b4%40gmail.com.
The example Olivier posted provides a way to convert Pyo signals to NumPy arrays. If you want to use NumPy arrays to control parameters of PyoObjects, you can simply index your NumPy array and pass a single value of the array to a parameter of a PyoObject. Almost all PyoObjects take both PyoObjects or floats as arguments.
Otherwise, you can create a function or class that takes a number of arguments and call that with an unpacked NumPy array. Here's an example:
```
f = Freeverb()
def freeverb_ctrl(size, damp, bal):
f.setSize(size)
f.setDamp(damp)
f.setBal(bal)
# suppose "a" is a NumPy array with three elements
# call the function by unpacking the list with the asterisk
freeverb_ctrl(*a)
```
To view this discussion on the web visit https://groups.google.com/d/msgid/pyo-discuss/ab4bd0c6-1427-469d-bc87-8fb6393f840fn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyo-discuss/40597d77-896b-42bc-b492-890474b40c8b%40gmail.com.
--
You received this message because you are subscribed to the Google Groups "pyo-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyo-discuss/650154dd-d15b-406b-985c-d05326cbc1e9n%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "pyo-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyo-discuss/jLTrXpweImA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pyo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyo-discuss/CAMXBGhRWzRMdb-68ecyYUvXELkep59svv-f4_dBJDsLTUDoKkw%40mail.gmail.com.