Giter Club home page Giter Club logo

Comments (9)

danomatika avatar danomatika commented on September 4, 2024

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.

turowskipaul avatar turowskipaul commented on September 4, 2024

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.

danomatika avatar danomatika commented on September 4, 2024

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.

turowskipaul avatar turowskipaul commented on September 4, 2024

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.

turowskipaul avatar turowskipaul commented on September 4, 2024

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.

danomatika avatar danomatika commented on September 4, 2024

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.

turowskipaul avatar turowskipaul commented on September 4, 2024

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.

turowskipaul avatar turowskipaul commented on September 4, 2024

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.

turowskipaul avatar turowskipaul commented on September 4, 2024

The issue described above will be resolved in PR#3247

from ofxpd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.