Comments (9)
Are you also setting up the ofSoundStream for 16 channels? Does it allow selecting the device? ofxPd only knows about the number of channels you give it, you need to make sure that matches what the sound stream is giving it.
from ofxpd.
Thanks for the quick reply! Yes, I have it set up in the following manner:
int ticksPerBuffer = 8;
int numInputs = 16;
int numOutputs = 16;
ofSoundStreamSetup(numOutputs, numInputs, this, 44100, ofxPd::blockSize()*ticksPerBuffer, 3);
pdOps = new PdOps;
pdOps->setup(numOutputs, numInputs, 44100, ticksPerBuffer);
I suspected it might be a sound stream issue, but wanted to check here too. I will close this issue and keep trying to find a way to query the number of channels to set up the sound stream dynamically, and will post a follow-up if I find a solution.
Thanks for the great add-on!
from ofxpd.
I think the problem is you can't really select which sound device ofSoundStream uses. If you're on OS X, you could try setting the external device as the default sound in and output in the Audio MIDI Settings app.
from ofxpd.
While I wish there were a way to do that, I'm mostly interested in just allowing the user to specify which channels they want to use. It's OK with me if they just set up their default device in Audio MIDI Settings before starting the app.
There is a way to query the available devices from sound stream, but all it does is print the device info to the console. As far as I can tell, there's no way to actually use that info to reconfigure.
from ofxpd.
OK, I've spent a bit more time with it and found a solution. Basically, I had to go into ofRtAudioSoundStream and add new methods that return the number of inputs/outputs for the default device. (I just used the listDevices() method as a model.) Then I extended the methods out to ofBaseSoundStream and ofSoundStream. Then I created a new instance of sound stream, got the number of default inputs and outputs from that instance, deleted that instance, and created a new functional sound stream using the correct number of I/Os.
ofSoundStream has the following methods:
getNumOutputChannels(), getNumOutputChannels()
but for some reason they returned extremely large numbers when I called them. Not exactly sure why.
Anyway, everything seems to working now. :)
from ofxpd.
Great. It might be worth opening an issue on the open frameworks core repo as that sounds like a bug to me, or at least functionality that should be there ... like being able to switch sound devices on the fly.
from ofxpd.
Will do. By the way, I think that you can set the device used by ofSoundStream by using the setDeviceID() method. The problem with that is that there doesn't seem to be a way to get device info other than printing it to the console. This would just require some new methods similar to what I just described. I will mention that too in the core repo issue.
from ofxpd.
p.s. I also just want to quickly mention that the number of buffers in ofSoundStreamSetup should be based on the number of channels—something I wasn't doing in the example above. As the documentation says:
"You should probably use two for each channel that youre using."
from ofxpd.
The issue described above will be resolved in PR#3247
from ofxpd.
Related Issues (20)
- [question] there's any way to avoid libPd compile build for Windows / VS 2017? HOT 26
- Using ProjectGenerator to create an iOS ofxPd project? HOT 2
- iOS can not find my patch HOT 2
- Use keyboard input on iOS? HOT 1
- error compiling pdMultiExample with PDINSTANCE and PDTHREADS HOT 9
- pdMultiExample crashes with PDINSTANCE and PDTHREADS HOT 13
- ofxPd stops recieving messages (bangs) when ofxMidi is currently running on ios HOT 1
- background audio on android and back button issue HOT 10
- writesf~ file doesn't get created on iOS 15 HOT 7
- update libpd header link HOT 1
- pd.closePatch() not working with Emscripten HOT 7
- Is it possible to load local audio files (with the file browser) into ofxPd? HOT 1
- [metro] outputs a single bang and then stops HOT 8
- cannot convert argument 1 from 'void *' to 't_pd *' HOT 10
- audioReceived & audioRequested deprecated HOT 2
- Emscripten compatible version HOT 1
- Building in Visual Studio with custom externals HOT 2
- linking error while building on win11/mingw64 HOT 6
- Cannot run ofxPd’s Example HOT 2
- Unable to detect endianness HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ofxpd.