Git Product home page Git Product logo

Comments (4)

ffd8 avatar ffd8 commented on August 14, 2024

Sorry - this was dumb.. just realized one can re-initialize the getLineOut() function and overwrite it with a new bufferSize(). However, can this be dynamically done without issues? Or do the oscil/pan()/summer() etc all need to be un-patched then re-patched to the audioOutput?

I suppose the bufferSize + sampleRate are all dependent on the hardware and DAC one is using, so probably hard to give any suggestions. Would be very interested if Minim has a technique for testing this out to find the optimal one for a given setup.

from minim.

ddf avatar ddf commented on August 14, 2024

Yeah the Line Out is comparable to the audio output settings in your DAW. Usually you set and forget those and use the highest sample rate and lowest buffer size (ie latency) your particular machine / audio interface can handle. Generally you wouldn't make more than one AudioOutput or change buffer size / sample rate later. As for choosing the best values based on platform, it should be the case the getLineOut() without arguments will do this, but you can always test with arguments on your target platform to find the highest sample rate and smallest buffer size that don't generate clicks and breaks in audio due to not being able to generate fast enough. But that will also depend on how large of synthesis network you have patched to the output.

The AudioOutput buffer size absolutely does not have to be the same size as the wavetable used by Oscils patched to it. Even though the output presents a buffer of samples at a time, it generates that buffer one sample at a time. And as for the Oscil, how quickly it steps through its wavetable depends on the frequency it is oscillating at, so it's basically never the case that there is a 1:1 mapping between samples in the wavetable and samples generated by the AudioOutput.

from minim.

ffd8 avatar ffd8 commented on August 14, 2024

Aha, good to know regarding set-it-and-forget-it.. but technically there shouldn't be an issue (with oscil, etc patched in) when overriding the getLineOut() by calling it a 2nd/3rd time (if changing these settings, say in the setup() of Processing) after it's already been initialized?

Just did a test, changing my output device (both using SoundFlower + MBP Speakers) from 44100 to 96000 samplerate in Audio + Midi Setup, however using default getLineOut() didn't seem to adjust to that hardware sample rate when checking the out.sampleRate(). I saw the defaults are 1024/44100, but technically this should change? Or only when actual hardware DAC is being used? I do feel like I've seen it automatically use 96000 on a MOTU device.

import ddf.minim.*;  
Minim minim;
AudioOutput out;

void setup() { 
  size(500, 500);
  minim = new Minim(this);
  out = minim.getLineOut(Minim.STEREO);
  println(out.sampleRate()); // 44100 (hardware set to 96000)
  println(out.bufferSize()); // 1024
} 

from minim.

ddf avatar ddf commented on August 14, 2024

Ah, you're right and I misremembered, calling getLineOut() defaults to 1024/44100. If for some reason that's not available on the default output mixer in Javasound, I think it will hand back something different, which might be why you've seen it automatically use 96000 on a MOTU device.

from minim.

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.