From kde-multimedia Thu Nov 25 10:35:59 2004 From: Matthias Kretz Date: Thu, 25 Nov 2004 10:35:59 +0000 To: kde-multimedia Subject: Re: division module [PATCH] Message-Id: <200411251136.05358.kretz () kde ! org> X-MARC-Message: https://marc.info/?l=kde-multimedia&m=110137901828074 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============0183788601==" --===============0183788601== Content-Type: multipart/signed; boundary="nextPart3955674.4pBM6bHJMi"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart3955674.4pBM6bHJMi Content-Type: multipart/mixed; boundary="Boundary-01=_PWbpBYBZpxAmeid" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_PWbpBYBZpxAmeid Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Here's the patch, I can commit it for KDE 3.4... On Thursday 25 November 2004 10:52, Matthias Kretz wrote: > Hi Wolfgang, > > I guess nobody ever thought there would be a need for that. I can write > that module for you in a few seconds (copy the multiplication module and > substitute multiplication with division). Would you be able to use the co= de > from CVS then? > > On Saturday 20 November 2004 16:21, Wolfgang Jeltsch wrote: > > why isn't there a division module in aRts like there is a multiplication > > module? =A0I want to do additive synthesis and want to divide the n-th > > harmonic by n. =A0Another solution would probably be to have a filter w= hich > > filters -3dB(?) per octave. =2D-=20 C'ya Matthias ________________________________________________________ Matthias Kretz (Germany) <>< http://Vir.homeip.net/ MatthiasKretz@gmx.net, kretz@kde.org, Matthias.Kretz@urz.uni-heidelberg.de --Boundary-01=_PWbpBYBZpxAmeid Content-Type: text/x-diff; charset="iso-8859-1"; name="synth_div.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="synth_div.patch" Index: Makefile.am =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/kde/kdemultimedia/arts/modules/synth/Makefile.am,v retrieving revision 1.9 diff -u -3 -p -r1.9 Makefile.am =2D-- Makefile.am 18 Aug 2004 05:52:18 -0000 1.9 +++ Makefile.am 25 Nov 2004 10:20:26 -0000 @@ -24,7 +24,8 @@ libartsmodulessynth_la_SOURCES =3D artsmod synth_wave_tri_impl.cc synth_noise_impl.cc synth_wave_softsaw_impl.cc syn= th_wave_square_impl.cc synth_wave_pulse_impl.cc synth_osc_impl.cc synth_pla= y_pat_impl.cc \ synth_capture_wav_impl.cc \ synth_midi_test_impl.cc synth_sequence_impl.cc synth_sequence_freq_impl.c= c \ =2D synth_midi_debug_impl.cc objectcache_impl.cc synth_nil_impl.cc synth_de= bug_impl.cc synth_data_impl.cc + synth_midi_debug_impl.cc objectcache_impl.cc synth_nil_impl.cc synth_debu= g_impl.cc synth_data_impl.cc \ + synth_div_impl.cc libartsmodulessynth_la_COMPILE_FIRST =3D artsmodulessynth.h =20 libartsmodulessynth_la_LIBADD =3D \ Index: artsmodulessynth.idl =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/kde/kdemultimedia/arts/modules/synth/artsmodulessynth.idl,v retrieving revision 1.3 diff -u -3 -p -r1.3 artsmodulessynth.idl =2D-- artsmodulessynth.idl 20 Aug 2003 20:11:22 -0000 1.3 +++ artsmodulessynth.idl 25 Nov 2004 10:20:26 -0000 @@ -40,6 +40,15 @@ module Arts { =20 // Arithmetic & Mixing =20 +/** + * Divides two audio streams + */ +interface Synth_DIV : SynthModule { + in audio stream invalue1,invalue2; + out audio stream outvalue; + default invalue1, invalue2; +}; + interface Synth_XFADE : SynthModule { in audio stream invalue1,invalue2,percentage; out audio stream outvalue; Index: synth_div_impl.cc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: synth_div_impl.cc diff -N synth_div_impl.cc =2D-- /dev/null 1 Jan 1970 00:00:00 -0000 +++ synth_div_impl.cc 25 Nov 2004 10:20:26 -0000 @@ -0,0 +1,45 @@ + /* + + Copyright (C) 2000 Stefan Westerfeld + stefan@space.twc.de + 2004 Matthias Kretz + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + =20 + This library 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 + Library General Public License for more details. + =20 + You should have received a copy of the GNU Library General Public Lice= nse + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + + */ + +#include "artsmodulessynth.h" +#include "stdsynthmodule.h" + +using namespace Arts; + +namespace Arts { + +class Synth_DIV_impl :public Synth_DIV_skel, public StdSynthModule +{ +public: + void calculateBlock(unsigned long samples) + { + unsigned long i; + + for(i =3D 0;i < samples; i++)=20 + outvalue[i] =3D invalue1[i] / invalue2[i]; + } +}; + +REGISTER_IMPLEMENTATION(Synth_DIV_impl); + +} --Boundary-01=_PWbpBYBZpxAmeid-- --nextPart3955674.4pBM6bHJMi Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQBBpbWVyg4WnCj6OIoRArwSAJ94ip0wMzPiICaALPSGG3kVjCwG/gCfeG4p 1n+SAYDQBZQcMARBY+4otTE= =772C -----END PGP SIGNATURE----- --nextPart3955674.4pBM6bHJMi-- --===============0183788601== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kde-multimedia mailing list kde-multimedia@kde.org https://mail.kde.org/mailman/listinfo/kde-multimedia --===============0183788601==--