/* Copyright (C) 2008-2011 Nasca Octavian Paul Author: Nasca Octavian Paul This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. This program 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 General Public License (version 2) for more details. You should have received a copy of the GNU General Public License (version 2) along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include "BinauralBeats.h" /* void BinauralBeatsParameters::add2XML(XMLwrapper *xml){ xml->addpar("stereo_mode",(int) stereo_mode); xml->addparreal("mono",mono); xml->beginbranch("FREE_EDIT"); free_edit.add2XML(xml); xml->endbranch(); }; void BinauralBeatsParameters::getfromXML(XMLwrapper *xml){ stereo_mode=(BB_STEREO_MODE)xml->getpar("stereo_mode",(int) stereo_mode,0,2); mono=xml->getparreal("mono",mono); if (xml->enterbranch("FREE_EDIT")){ free_edit.getfromXML(xml); xml->exitbranch(); }; }; */ //coefficients of allpass filters are found by Olli Niemitalo const REALTYPE Hilbert::coefl[]={0.6923877778065f, 0.9360654322959f, 0.9882295226860f, 0.9987488452737f}; const REALTYPE Hilbert::coefr[]={0.4021921162426f, 0.8561710882420f, 0.9722909545651f, 0.9952884791278f}; BinauralBeats::BinauralBeats(int samplerate_){ samplerate=samplerate_; hilbert_t=0.0f; }; void BinauralBeats::process(REALTYPE *smpsl,REALTYPE *smpsr,int nsmps,REALTYPE pos_percents){ // for (int i=0;i