#include "daisy_pod.h" #include "daisysp.h" #include "csound.h" using namespace daisy; using namespace daisysp; DaisyPod hw; bool greenOn = false; Oscillator osc; CSOUND *csound; void led2(bool onOff) // toggles led2 green or off { if (onOff) { hw.led2.Set(0,1,0); } else { hw.led2.Set(0,0,0); } hw.UpdateLeds(); } void AudioCallback(AudioHandle::InputBuffer in, AudioHandle::OutputBuffer out, size_t size) { hw.ProcessAllControls(); for (size_t i = 0; i < size; i++) { float sig = osc.Process(); out[0][i] = sig; out[1][i] = sig; } } int main(void) { hw.Init(); hw.led1.Set(0, 0, 1); // blue hw.UpdateLeds(); System::Delay(5000); //CSOUND *cs = csoundCreate(NULL, NULL); hw.led1.Set(0, 1, 0); // green hw.UpdateLeds(); hw.SetAudioBlockSize(4); // number of samples handled per callback hw.SetAudioSampleRate(SaiHandle::Config::SampleRate::SAI_48KHZ); osc.Init(hw.AudioSampleRate()); osc.SetAmp(0.6f); osc.SetFreq(261); hw.StartAdc(); hw.StartAudio(AudioCallback); hw.led1.Set(1, 0, 0); hw.led2.Set(0,0,1); hw.UpdateLeds(); while(1) { hw.ProcessDigitalControls(); if(hw.button2.RisingEdge()) { greenOn = !greenOn; led2(greenOn); } } } Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here