Committed mixer8 and mixer16 to github. Can anyone see a good reason for a Mixer2 and a Mixer32? Overkill? Or enabling perfectly efficient system design?
Great !
I just found a CPP-Source for pitch:
http://www.dspdimension.com/admin/pitch-shifting-using-the-ft/
Is it float or fixed-point ?Ian using this in my apps, was easy to port and sounds very nice.
Committed mixer8 and mixer16 to github. Can anyone see a good reason for a Mixer2 and a Mixer32? Overkill? Or enabling perfectly efficient system design?
A mixer2 (or mixer1) would be a more neat way to set the gain of a single signal I'd say. I found the mixer4 a bit of an overkill in the Mid/Side example, but it's an easy way to control gain.
The mixer2 would come close enough to that constant situation I guess.

I had a dream...
View attachment 3529
How hard would it be to implement this?
It would take us a great leap closer to dynamic patch cabling
Alex
@Pensive, thanks for posting, I have really been enjoying your bitcrusher addition.
Word of warning, it will crash if values are at 0, maybe an idea to automatically initialize values at 44100/16?
I had a dream...
View attachment 3529
How hard would it be to implement this?
It would take us a great leap closer to dynamic patch cabling
I'm still figuring this out, but will have a try.
Thanks Paul for this great library!
Alex

In file included from Teensy_DrumMachine_v2.ino:9:0:
SynthMetallicFoundation.h:28: error: 'oscillator' is not a type
SynthMetallicFoundation.h:28: error: expected identifier before numeric constant
SynthMetallicFoundation.h:28: error: expected ',' or '...' before numeric constant
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
//#include <AudioStream.h>
#ifndef synth_metallic_h_
#define synth_metallic_h_
class SynthMetallicFoundation //: public AudioStream
{
public:
void start_oscillators()
{
oscillator.begin(0.9,300,WAVEFORM_SINE);
}
AudioSynthWaveform oscillator;
AudioMixer4 OutMixer;
AudioConnection patchCordMetallicFM(oscillator,0,OutMixer,0);
//virtual void update(void);
private:
};
#endif
Am i missing something here ?
I cant do a mixer1 because its not actually a mixer.
What we're talking about here is a single channel gain object, preferably with an additional input port to connect sine waves or similar for modulation of gain (a VCA). It could be connected inline between the sound source and the mixer (or sound output)
if you have a 16 channel mixer you dont want 16 inline gain objects, only to then run each sample through the mixer's gain as well, its a waste of juice, and incorporates mathematical noise/degradation (if that's even the correct terminology).
For now, i think a mixer2, and an inline gain object with a VCA style input would be ideal. It could be used in place of a mixer in many situations, particularly synths.
View attachment 3529
How hard would it be to implement this?
It would take us a great leap closer to dynamic patch cabling
Adding an FM operator object to the audio library would be a very useful thing. You would do that by using one of the existing objects as a model, which will show you how they work internally and allow you to test how much memory and CPU is used. You can then optimize CPU usage by making goofd algorithmic choices and by appropriate use of the ARM4 Math/DSP instructions - you will find plenty of examples of that inside the library.building a drum synth using the audio library. Because i want to synthesize cymbals which involves multiple fm modulated oscillators, filters and envelopes i would like to put all of these in its own class.
AudioSynthWaveformSineModulated() : AudioStream(1, inputQueueArray), magnitude(16384) {}
AudioSynthWaveformSine() : AudioStream(0, NULL), magnitude(16384) {}
Still a good plan; make a one-operator FM object and then you (or anyone else) can compose multi-operator oscillators as they like.My intention was to make a compound oscillator based on multiple fm oscillators by extending audio stream.
The audio library is designed to let you very easily create audio projects, using a graphical tool to define the interconnection of the objects. But inside the objects, the code is extremely optimized. The system is NOT designed for that type of easy design inside the objects. Very low-level, high optimized programming is used inside the actual objects.
Once you are familiar with how AudioSynthWaveformSineModulated works, you will be in a good position to code your own one-operator FM object.
Once that works well, look into the gui directory to see how objects are represented in the gui interface, and also add an example for the example directory.
And then send a github pull request!
Still a good plan; make a one-operator FM object and then you (or anyone else) can compose multi-operator oscillators as they like.
Ok clear, this also means that i cannot create "convenience" classes to aggregate multiple elements together without recursion ?
@Pensive, thanks for posting, I have really been enjoying your bitcrusher addition.
Word of warning, it will crash if values are at 0, maybe an idea to automatically initialize values at 44100/16?
sampleRate = 1;
sampleStep = 44100 / sampleRate; // calculate the number of samples to duplicate as we reduce the samplerate.
Can you tell me exactly which settings cause a crash? I'm sure it's not the bitcrusher, but please do check both, I've shelved my audio board temporarily for teensy-lc testing.