Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Modulator p5: Make your Processing Sketches More Dynamic with Modulators

216 views

Published on

ModulatorP5 is a Processing library for animating variables over time with audio analysis and low frequency oscillators.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Modulator p5: Make your Processing Sketches More Dynamic with Modulators

  1. 1. ModulatorP5 Make your sketches more dynamic with Modulators
  2. 2. Why ModulatorP5? Inspired by my experience as an electronic musician. Driven out of creating sketches for a performance at the Milwaukee Avenue Arts Fest. I missed LFO’s (Low Frequency Oscillators.) Also wanted an easy way to “tap in” to audio analysis data without a lot of work.
  3. 3. Why a Processing library? Building a Processing library isn’t nearly as hard as it might look. It pushes all the boilerplate repetitive code out of your sketch, and into one definitive place. An easy way to get access to the power of Java, while keeping your sketches feeling “light-weight.”
  4. 4. What can it do? Sine/Cosine and Perlin Noise LFO-type Modulators with adjustable rate and modulation amount. Audio Analysis Modulator with adjustable frequency range, easing and modulation amount. Add a control UI for any Modulator in one line of code.
  5. 5. Modulation Sine Modulator modulating Particle Size.
  6. 6. Modulation with UI Sine Modulator modulating Particle Size.
  7. 7. The Code - Setup // “this” is a reference to the sketch (PApplet) minim = new Minim(this); input = minim.getLineIn(); controlP5 = new ControlP5(this); modP5 = new ModulatorP5(this, controlP5, minim, input);
  8. 8. The Code - Oscillator Modulator sizeOsc = modP5.createCosineOscillator()
 .setMinRange(0)
 .setMaxRange(120)
 .setMinRate(0.0)
 .setMaxRate(0.5);
  9. 9. The Code - Control Panel modP5.createControlPanel(20, 200, "P-Size (Osc)", sizeOsc);
  10. 10. No other code is needed! I wanted ModulatorP5 to require a fair amount of configuration and setup in setup() up front. Once it is up and running, nothing needs to be done in the draw() loop. That’s not quite true - behind the scenes ModulatorP5 taps into the draw() loop, but it’s hidden from your sketch.
  11. 11. Audio Analysis One caveat. There is a lot of room for improvement in the current version of the Audio Analysis code, both in the API and under the hood. Audio Analysis comes down to picking a frequency range, easing, and modulation amount. Currently supported frequency ranges are: sub-bass, bass, mids and highs.
  12. 12. Audio Analysis Audio Analyzer modulating Particle size.
  13. 13. Audio Analysis with UI
  14. 14. The Code analyzer = modulatorP5.createAudioAnalyzer() .setMinRange(0) .setMaxRange(160) .setEasing(0.2); modP5.createControlPanel(20, 20, "P-Size (Anaylzer)", analyzer);
  15. 15. Plans for the future Remove the ControlP5 dependency and replace with a custom UI. Support more diverse waveforms like Saw, Square, Sample-and-hold, and maybe simple FM synthesis. More sophisticated audio analysis, including setting frequency start and end bands, and multi-band analysis returning an array of values.
  16. 16. Don’t be afraid to dive in and build your own library. Even if you’re the only one who is ever going to use it. Push overly complicated logic out of your sketches. Reuse your code! Get more ambitious with your architecture, with Java you get generics, interfaces, enums and more. The Processing Library Template for Eclipse gets you up and running quickly.
  17. 17. Contribute! ModulatorP5
 http://github.com/nathankoch/ModulatorP5

×