/* daisyCsoundVersio.h: Copyright (C) 2025 Dave Seidel This file is part of Csound. The Csound Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. Csound is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with Csound; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef DAISY_CSOUND_H #define DAISY_CSOUND_H #include using namespace std; string csdText = R"csd( sr=48000 nchnls=2 0dbfs=1 ; triangle window gifn ftgen 1,0,16384,20,3 /***************************************************** asig PitchShifter ain,kp,kdel,ifn[,imax] ain - input signal kp - pitch shift factor (interval ratio) kdel - delay mod width ifn - window (envelope) to cut discontinuities imax - optional max delay (defaults to 1 sec) *****************************************************/ opcode PitchShifter,a,akkip asig,kp,kdel,ifn,imax xin kfm = (kp-1)/kdel amd1 phasor -kfm amd2 phasor -kfm,0.5 admp delayr imax atp1 deltap3 amd1*kdel atp2 deltap3 amd2*kdel delayw asig xout atp1*tablei:a(amd1,ifn,1) + atp2*tablei:a(amd2,ifn,1) endop instr Main ain inch 1 kf, ka pitchamdf ain,100,600 kf = kf < 100 ? 100 : (kf > 600 ? 600 : kf) kdel = 2/kf kdel port kdel, 0.01, 0.1 asig PitchShifter ain,1.5,kdel,1 outs asig+ain,asig+ain endin schedule("Main", 0, -1) )csd"; #endif