This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fast additive copy method


Am Sonntag, den 10.08.2014, 17:20 +0200 schrieb Carlos O'Donell:
> On Sun, Aug 10, 2014 at 7:32 AM, JoÃl KrÃhemann <weedlight@gmail.com> wrote:
> > Hi, I'm doing a soft synth and I'm looking for fast additive copy
> > methods. Does glibc provide such functions?
> 
> Please define fast additive copy methods?
> 
> What types do you need to add together?
> 
> If using floating point arithmetic: does the answer need to be
> correctly rounded, can the answer be imprecise etc. etc. ?
> 
> Simple computation like add and copy are just done by the language.
> 
> e.g.
> 
> a = a + b;
> 
> There is some ability for the compiler to turn this into a
> fused-multipley-and-add instruction which is quite quick.
> 
> e.g.
> 
> a = a + b =>  a = 1 * a +b (implemented on x86* with FMA by the compiler).
> 
> However, the addition is also quite quick, and may take less cycles so
> the compiler might choose just an add.
> 
> Cheers,
> Carlos.

Hi, I'm doing a soft synth therefore in RAM is copied audio buffers in a
repining way. The function ags_audio_signal_copy_buffer_to_buffer()
should be optimized.
I do an additive copy for each frame:

frames_per_second = 44100
frames_per_tic = 940
grand_total_frame_count_per_tic =
	(78 * frames_per_tic + frames_per_tic) +
	(16 * frames_per_tic + frames_per_tic)

This is only for one drum and one matrix sequencer. This is about:
4233600 additions and clipping per second using signed short.

https://sourceforge.net/p/ags/code/HEAD/tree/src/ags/audio/ags_audio_signal.h
https://sourceforge.net/p/ags/code/HEAD/tree/src/ags/audio/ags_audio_signal.c


I found this on the net but didn't read it yet since it isn't clear if
there's an applicable patent:
http://www.dafx.ca/proceedings/papers/p_181.pdf FAST ADDITIVE SOUND
SYNTHESIS USING POLYNOMIALS



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]