예제 #1
0
Synthesizer::Synthesizer()
{
	preset = new synth_preset_t;
	config = new synth_configuration_t;
	osc[0] = &osc1;
	osc[1] = &osc2;
	osc[2] = &osc3;

	currentFreq = 300;
	freqOffset = 0;

	// make connections
	osc12sum = new AudioConnection(osc1, 0, oscSum, 0);
	osc22sum = new AudioConnection(osc2, 0, oscSum, 1);
	osc32sum = new AudioConnection(osc3, 0, oscSum, 2);

	oscSum2flt1 = new AudioConnection(oscSum, 0, flt1, 0);
	oscSum2serParMixer = new AudioConnection(oscSum, 0, serParMixer, 0);
	flt12serParMixer = new AudioConnection(flt1, 1, serParMixer, 1);
	flt12fltSum = new AudioConnection(flt1, 1, fltSum, 0);
	serParMixer2flt2 = new AudioConnection(serParMixer, 0, flt2, 0);
	flt22fltSum = new AudioConnection(flt2, 0, fltSum, 1);
	fltSum2fltDryWet = new AudioConnection(fltSum, 0, fltDryWet, 0);
	oscSum2fltDryWet = new AudioConnection(oscSum, 0, fltDryWet, 1);

	fltDryWet2outL = new AudioConnection(fltDryWet, 0, out, 0);
	fltDryWet2outR = new AudioConnection(fltDryWet, 0, out, 1);


	setFilterSerParCrossfade(1.f);

	AudioMemory(20);
}
void setup()
{
	AudioMemory(12);
	synth.setFrequency(1000);
	synth.setModFrequency(20);
	synth.setActiveLayers(10);
}
예제 #3
0
int main(void) {

    // initialize USB serial connection
    Serial.begin(115200);

    // initialize UART serial connection
    // RX1 - pin 0
    // TX1 - pin 1
    Serial1.begin(9600);

    // allocate audio memory
    AudioMemory(18);

    // pin 2 is connected to a button to ground, for a simple demo
    pinMode(2, INPUT_PULLUP);

    while (1) {
      // check for input from USB serial
        if (Serial.available() > 0) {
            String input = Serial.readStringUntil('\n');

            // don't send packet if input is blank
            while (input != "" && input != "\n") {
                // allocate packet buffer and set the bytes within
                char packet[PACKET_LEN];
                memset(packet, 0, sizeof(packet));
                strncpy(packet, input.c_str(), PACKET_LEN);

                if (input.length() > PACKET_LEN) {
                    input = input.substring(PACKET_LEN, input.length());
                }
                else {
                    input = "";
                }

                send_packet_serial(packet);

                // wait extra time between each packet to let the receiver
                //  settle
                delay(3*DURATION);
            }
        }

        // check for input from RS232
        if (Serial1.available() > 0) {
            String input = Serial1.readStringUntil(' ');
            if (input != "" && input != " ") {
                Serial.print(input);
            }
        }

        // check for button press on pin 2
        if (!digitalRead(2)) {
            // pin 2 connected to ground, send demo packet
            send_demo();
        }
    }
}
예제 #4
0
void BitshiftAudio::setup()
{
    AudioMemory(12);
    audioAdaptor.enable();
    audioAdaptor.inputSelect(AUDIO_INPUT_LINEIN);
    audioAdaptor.micGain(0);
    audioAdaptor.muteHeadphone();
    // disable adc hp as it causes noise to kick in when no input audio is detected
    audioAdaptor.adcHighPassFilterDisable();
    // good combination for minimum ADC noise when used with non-active guitar as input
    // large line in sensitivity, bring down dac and volume so overall gain is close to unity
    audioAdaptor.lineInLevel(12);
    audioAdaptor.lineOutLevel(31);
    audioAdaptor.dacVolume(0.9);
}
void setup()
{
	AudioMemory(12);
}
void setup()
{
    AudioMemory(12);
    sine.frequency(1000);
}