From douglas at roar.music.columbia.edu Mon Nov 1 00:00:01 2004 From: douglas at roar.music.columbia.edu (douglas repetto) Date: Sun Jan 21 12:10:26 2007 Subject: [music-dsp] [admin] music-dsp FAQ Message-ID: <200411010500.iA1501Hw012398@roar.music.columbia.edu> hi, just a reminder that if you are new to the list you should read the music-dsp FAQ. it contains answers to both technical _and_ adminstrative questions that often come up on the list. if your question appears in the FAQ it is safe to assume that it has been discussed on the list many times in the past, and you should probably have a look through the list archives before posting your question to the list. http://shoko.calarts.edu/musicdsp/musicdspFAQ.html also of interest to new and not-so-new list members: the music-dsp list archives http://shoko.calarts.edu/musicdsp/musicdsparchives.html the music-dsp source code archive http://www.musicdsp.org music-dsp books and reviews http://shoko.calarts.edu/musicdsp/dspbooks.html all this and more at: http://shoko.calarts.edu/musicdsp hotdawg! douglas (this is an automated message sent out on the 1st and 15th of each month) From woldhek at xs4all.nl Mon Nov 1 03:24:42 2004 From: woldhek at xs4all.nl (Anton Woldhek) Date: Sun Jan 21 12:10:27 2007 Subject: [music-dsp] PySuperCollider In-Reply-To: <41856F7C.2020509@calarts.edu> Message-ID: <021d01c4bfec$3d327300$2101a8c0@VAIO> That still doesn't matter, the sc client for windows is written in python, the original client for sc (for mac) isnt, so you'll have to go the windows version of sc to get python code, perhaps this is not what you are looking for, but this is what I have to offer. Cheers Anton -----Original Message----- On Behalf Of Dan Richert I'm on OSX. Keith Handy wrote: >Actually, disregard that, I needed to go to the sf link ... > > >On Sun, 31 Oct 2004 13:53:42 -0500, Keith Handy > wrote: > > >>I followed the link out of curiosity and didn't see anything for >>windows. >> >> >> >> >>On Sun, 31 Oct 2004 18:19:25 +0100, Anton Woldhek >>wrote: >> >> >>>http://supercollider.sourceforge.net check out the win32 compile. >>> >>>Anton >>> >>> >>> >>>-----Original Message----- >>>From: music-dsp-bounces@shoko.calarts.edu >>>[mailto:music-dsp-bounces@shoko.calarts.edu] On Behalf Of Richard >>>Dobson >>>Sent: zondag 31 oktober 2004 17:00 >>>To: a list for musical digital signal processing >>>Subject: Re: [music-dsp] PySuperCollider >>> >>>Love to, but we need a web link! Doesn't show up in Google, yet... >>> >>>Richard Dobson >>> >>>Anton Woldhek wrote: >>> >>> >>> >>>>Have a look at PsyCollider, the sc client for windows. Its entirely >>>>python! >>>> >>>>Cheers >>>>Anton >>>> >>>>-- >>>>dupswapdrop -- the music-dsp mailing list and website: subscription >>>>info, FAQ, source code archive, list archive, book >>>> >>>> >>>reviews, dsp links >>> >>> >>>>http://shoko.calarts.edu/musicdsp >>>>http://ceait.calarts.edu/mailman/listinfo/music-dsp >>>> >>>> >>>> >>>> >>>> >>>-- >>>dupswapdrop -- the music-dsp mailing list and website: subscription >>>info, FAQ, source code archive, list archive, book reviews, dsp links >>>http://shoko.calarts.edu/musicdsp >>>http://ceait.calarts.edu/mailman/listinfo/music-dsp >>> >>>-- >>>dupswapdrop -- the music-dsp mailing list and website: subscription >>>info, FAQ, source code archive, list archive, book reviews, dsp links >>>http://shoko.calarts.edu/musicdsp >>>http://ceait.calarts.edu/mailman/listinfo/music-dsp >>> >>> >>> >>-- >>I've seen all good people trim their hedge each day >> >> >> > > > > -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From signalzerodb at yahoo.co.uk Mon Nov 1 04:52:12 2004 From: signalzerodb at yahoo.co.uk (Dave Gamble) Date: Sun Jan 21 12:10:27 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect In-Reply-To: <007a01c4bd9a$88f30e20$030200c0@australia> References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead> <004901c4bd08$2b14d4b0$030200c0@australia> <007a01c4bd9a$88f30e20$030200c0@australia> Message-ID: It seems appropriate at this point to explain how a compressor actually works. Things will be a lot easier to understand when you know what's going on... and not a lot of people understand this, it seems. Here's how a compressor works: You have a man wearing a pair of headphones, with his hand on a volume fader. The man hears the sidechain signal (either the uncompressed input or something else) in his headphones. He can see a meterbridge of what he's listening to. When the meterbridge level gets too high (it exceeds 'threshold'), he pulls the volume fader down, from 0dB to -something, depending on the 'ratio' (which is a hideously defined thing, btw). The speed with which he can pull the fader down is the attack. The speed with which he can pull the fader back up is the release. Attack and release are invariably defined as exponential curves (first order filters) where the quoted 'attack time' is some multiple of the 'time constant' of the filter. These vary all over the place. And that's how a compressor works. Dave. On 29 Oct 2004, at 10:34, Eddie Al-Shakarchi wrote: > Hi guys > > I'm having real trouble working out how to convert/go from the decibel > value > the user enters on the GUI slider to a value in shorts/16bit data, as > represented in the array. i want to be able to say > > if (currentSamplesAmplitude > 10,000) then compress > > but currently all i'm doing is gving the use a chance to enter a > decibel > level, and then i convert it to a linear value.... then what? > > eg if the user enters a value of -5db as the threshold, how do i know > what > that REALLY means, in sample amplitude values? I'm really stuck > > Thanks guys > > Eddie > > ----- Original Message ----- > From: "Eddie Al-Shakarchi" > To: "a list for musical digital signal processing" > > Sent: Thursday, October 28, 2004 5:07 PM > Subject: Re: [music-dsp] Coding attack and delay times for a compressor > effect > > >> Hi Steve >> >> Thanks for you email - it makes perfect sense, i just don't know how >> to > code >> it! >> >> furthermore i'm not too sure what to do with the threshold value, it >> is >> originally given in db's, then i convert them into linear values, but >> that >> can't be right. i use uthe forumla: >> >> linear = pow (10.0, (0.05 * dBvalue); >> >> and this gives me a linear value, but this is of course not >> comparable to >> the amplitude value in the array. so what do i do with it? :-/ >> >> Not too sure what the next step is, any more help appreciated! >> >> Thanks again! >> >> Eddie >> >> ----- Original Message ----- >> From: "Steven Liddle" >> To: "a list for musical digital signal processing" >> >> Sent: Thursday, October 28, 2004 3:59 PM >> Subject: RE: [music-dsp] Coding attack and delay times for a >> compressor >> effect >> >> >>> Eddie, >>> >>> I think your code could possibly be a bit too simplistic in the way >>> it >> deals with whether the compression is applied or not. (I'm sure there >> are >> much better qualified people out there than me but this is how I >> understand). >>> >>> You need to get your head round the idea that the signal should only >>> be >> compressed when it is above the threshold. If the gain is above the >> threshold and rising from sample to sample then apply the compression >> according to the attack increment - if the gain is above the >> threshold > and >> attenuating (i.e. going down) sample by sample then the compression > release >> ratio ratio should be applied. If the signal is at or below the >> threshold >> then no action should be taken. >>> >>> Hope this makes sense. >>> >>> Steve >>> >>> >>> >>> -----Original Message----- >>> From: music-dsp-bounces@shoko.calarts.edu >> [mailto:music-dsp-bounces@shoko.calarts.edu]On Behalf Of Eddie > Al-Shakarchi >>> Sent: 28 October 2004 3:46 PM >>> To: a list for musical digital signal processing >>> Subject: Re: [music-dsp] Coding attack and delay times for a >>> compressor >> effect >>> >>> eeek, i made a mistake in that code i just posted - i think the line >>> to >>> check if the sample is over the threshold or not should have the > equality >>> operator reversed, giving: >>> >>> if (Math.abs(input[n]) > thresholdLevel) //switch on >>> >>> Which gives the results i described earlier >>> >>> If people don't wanna read the whole code please let me know i'll >>> stick > it >>> in pseudo code >>> >>> Thanks guys >>> >>> Eddie >>> >>> ----- Original Message ----- >>> From: "Eddie Al-Shakarchi" >>> To: "a list for musical digital signal processing" >>> >>> Sent: Thursday, October 28, 2004 3:22 PM >>> Subject: Re: [music-dsp] Coding attack and delay times for a >>> compressor >>> effect >>> >>> >>>> Hi >>>> >>>> Ah i see. Thanks for that. I've attempted to code a method in java >>>> (no >> one >>>> here uses java, i bet, but i have to) using the principles doug >>>> gave, >> but >>> i >>>> am getting really confused, as you'll probably be able to see. At >>>> the >>> moment >>>> all it does it seems to do (from looking at the waveforms produced) >>>> is >>>> divide the entire wave form by whatever ratio you set. Adjusting the >>>> threshol dmakes no real difference. >>>> >>>> Anyway here is the code, >>>> >>>> public short[] process(short input[]){ >>>> >>>> short[] output = new short [input.length]; >>>> int outputSample = 0; >>>> attackIncrement = (double)compressionRatio / > (double)attackTime; >>>> releaseIncrement = (double)compressionRatio / >> (double)releaseTime; >>>> >>>> System.out.println("Threshold = " + thresholdLevel); >>>> >>>> for (int n=0; n < output.length; n++){ >>>> >>>> if (Math.abs(input[n]) < thresholdLevel) //switch on >>>> currentCompressionRatio = currentCompressionRatio + >>>> attackIncrement; >>>> else >>>> currentCompressionRatio = currentCompressionRatio - >>>> releaseIncrement; >>>> >>>> if (currentCompressionRatio > compressionRatio) { >>>> currentCompressionRatio = compressionRatio; >>>> } >>>> if (currentCompressionRatio < 1.0){ >>>> currentCompressionRatio = 1.0; >>>> } >>>> >>>> outputSample = (int)(input[n] / >>>> currentCompressionRatio); >>>> // System.out.println("outputSample: " + outputSample); >>>> >>>> // Limits outputSample to max 16bit (short) value >>>> int limit = outputSample; >>>> if (limit > 32767){ >>>> limit = 32767; >>>> } >>>> >>>> else if (limit < -32767){ >>>> limit = -32767; >>>> } >>>> >>>> // Turns int back into short value in output array after > manipulation >>> and >>>> limiting >>>> output[n] = (short)limit; >>>> >>>> }// End of for loop >>>> >>>> return output; >>>> } >>>> >>>> I apoligise if you guys don't want me pasting code on this list. If >> anyone >>>> can let me know what i'm doing wrong i'd appreciate that, as i've >>>> been >>>> staring at this for so long that it doesn't make any sense at all >>>> now! >>>> >>>> Many thanks >>>> >>>> Eddie >>>> >>>> >>>> >>>> ----- Original Message ----- >>>> From: "Steven Liddle" >>>> To: "a list for musical digital signal processing" >>>> >>>> Sent: Thursday, October 28, 2004 3:13 PM >>>> Subject: RE: [music-dsp] Coding attack and delay times for a > compressor >>>> effect >>>> >>>> >>>>> Probably from an attack time of 50ms >>>>> >>>>> 2000 * (1/44100) is approx 50 ms - >>>>> >>>>> Steve >>>>> >>>>> >>>>> -----Original Message----- >>>>> From: music-dsp-bounces@shoko.calarts.edu >>>>> [mailto:music-dsp-bounces@shoko.calarts.edu]On Behalf Of Eddie >>>>> Al-Shakarchi >>>>> Sent: 28 October 2004 2:58 PM >>>>> To: a list for musical digital signal processing >>>>> Subject: Re: [music-dsp] Coding attack and delay times for a >> compressor >>>>> effect >>>>> >>>>> Hi there, i'm coding something now that i will post later >>>>> >>>>> Just out of interest, why did you say divide by 2000 samples? >>>>> >>>>> where did the 2000 come from? >>>>> >>>>> thanks! >>>>> >>>>> Eddie >>>>> >>>>> ----- Original Message ----- >>>>> From: "Doug" >>>>> To: "a list for musical digital signal processing" >>>>> >>>>> Sent: Thursday, October 28, 2004 4:33 AM >>>>> Subject: Re: [music-dsp] Coding attack and delay times for a >> compressor >>>>> effect >>>>> >>>>> >>>>>> >>>>>> ----- Original Message ----- >>>>>> From: "Eddie Al-Shakarchi" >>>>>> To: "a list for musical digital signal processing" >>>>>> >>>>>> Sent: Wednesday, October 27, 2004 11:08 AM >>>>>> Subject: [music-dsp] Coding attack and delay times for a >>>>>> compressor >>>>>> effect >>>>>> >>>>>> >>>>>>> Hi guys - sorry had a bit of problem with the mailing list >>>>>>> >>>>>>> I'm creating a simple hard knee (peak) compressor tool for a > piece >> of >>>>>>> software. It has the following parameters: >>>>>>> >>>>>>> - threshold >>>>>>> - compression ratio >>>>>>> - attack time >>>>>>> - release time >>>>>>> - a few misc. other things >>>>>>> >>>>>>> I understand the concepts involved in using a compressor (i use > one >>>>>> everday >>>>>>> when i make music!) but what i am finding hard to code is the >> attack >>>>>>> and >>>>>>> release times. The actual compression algorithm is: >>>>>>> >>>>>>> for (each value in the array){ >>>>>>> if value > threshold, then divide by ratio value >>>>>>> } >>>>>>> >>>>>>> however how do i take into account the attack and release times? > if >> i >>>>> have >>>>>>> an attack time of 1000 samples, do i just add 1000 to the for > loop? >>>>>>> what >>>>>>> about release? >>>>>>> >>>>>>> any info on this would be really helpful. I plan to make it work > on >>>>>>> peak >>>>>>> averaging too, and also make it work as a soft knee compressor - >> but >>>>>>> one >>>>>>> step at a time! >>>>>>> >>>>>>> Many thanks >>>>>>> >>>>>>> Eddie >>>>>>> >>>>>> >>>>>> As a simple case, calculate the atenuation in db. If it's 24, > devide >>>>>> that >>>>>> by 2000 samples and then cut the gain by .0012db ( I think) every >>> sample >>>>>> until you reach the target gain reduction. Do the opposite when >>>>> releasing. >>>>>> >>>>>> Your example suggests going hard at the wave amplitude which won't >>> work, >>>>>> you'll need to track the volume envelope of the wave and base your >>>>>> calculations on that, and, if I'm not mistaken, calculate the gain >>> factor >>>>> by >>>>>> cutting only the volume above the threshhold by the ratio. >>>>>> >>>>>> -- >>>>>> dupswapdrop -- the music-dsp mailing list and website: >>>>>> subscription info, FAQ, source code archive, list archive, book >>> reviews, >>>>> dsp links >>>>>> http://shoko.calarts.edu/musicdsp >>>>>> http://ceait.calarts.edu/mailman/listinfo/music-dsp >>>>> >>>>> -- >>>>> dupswapdrop -- the music-dsp mailing list and website: >>>>> subscription info, FAQ, source code archive, list archive, book >> reviews, >>>>> dsp links >>>>> http://shoko.calarts.edu/musicdsp >>>>> http://ceait.calarts.edu/mailman/listinfo/music-dsp >>>>> -- >>>>> dupswapdrop -- the music-dsp mailing list and website: >>>>> subscription info, FAQ, source code archive, list archive, book >> reviews, >>>>> dsp links >>>>> http://shoko.calarts.edu/musicdsp >>>>> http://ceait.calarts.edu/mailman/listinfo/music-dsp >>>> >>>> -- >>>> dupswapdrop -- the music-dsp mailing list and website: >>>> subscription info, FAQ, source code archive, list archive, book > reviews, >>> dsp links >>>> http://shoko.calarts.edu/musicdsp >>>> http://ceait.calarts.edu/mailman/listinfo/music-dsp >>> >>> -- >>> dupswapdrop -- the music-dsp mailing list and website: >>> subscription info, FAQ, source code archive, list archive, book >>> reviews, >> dsp links >>> http://shoko.calarts.edu/musicdsp >>> http://ceait.calarts.edu/mailman/listinfo/music-dsp >>> -- >>> dupswapdrop -- the music-dsp mailing list and website: >>> subscription info, FAQ, source code archive, list archive, book >>> reviews, >> dsp links >>> http://shoko.calarts.edu/musicdsp >>> http://ceait.calarts.edu/mailman/listinfo/music-dsp >> >> -- >> dupswapdrop -- the music-dsp mailing list and website: >> subscription info, FAQ, source code archive, list archive, book >> reviews, > dsp links >> http://shoko.calarts.edu/musicdsp >> http://ceait.calarts.edu/mailman/listinfo/music-dsp > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book > reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From xue.wen at elec.qmul.ac.uk Mon Nov 1 08:52:29 2004 From: xue.wen at elec.qmul.ac.uk (Wen X) Date: Sun Jan 21 12:10:27 2007 Subject: [music-dsp] resampling question (about libsamplerate, aka secretrabbit) References: <41809E41.4050706@wildgooses.com> <20041028074725.GC3591@login.ecs.soton.ac.uk> <4180A822.7040404@wildgooses.com> <18CCE882-28F7-11D9-AA2F-000A959AF1E4@earlevel.com> <4181F173.1020505@wildgooses.com><4182F00C.9090209@arcanemethods.com> <4183BAB4.8070007@wildgooses.com> Message-ID: <002901c4c01a$196e53c0$6a21258a@wenpc> I guess the art here is the use of sinc interpolation. When downsampling, I construct the sinc funtion using the DESTINATION sampling rate, which performs the low-pass filtering and downsampling in a single operation. When upsampling, I construct the sinc function using the SOURCE sampling rate, which band-limits the resulted signal to what it should be. There's no explicit filtering step at all. Xue ----- Original Message ----- From: "Ed Wildgoose" To: ; "a list for musical digital signal processing" Sent: Saturday, October 30, 2004 4:00 PM Subject: Re: [music-dsp] resampling question (about libsamplerate, aka secretrabbit) > >> >> If you want to resample to fewer samples, then logically you must band >> limit the signal to 1/2 the new sample rate before calculating the new >> points in order to avoid aliasing. > > > Aha, yes, good point! > > What about upsampling though? The text book says always bandlimit after > the upsample stage and before the downsample, but do we actually generate > out of band noise on upsampling? (if using the technique described before) > > Thanks > > Ed W > -- > dupswapdrop -- the music-dsp mailing list and website: subscription info, > FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From postmaster at emotu.it Mon Nov 1 10:38:15 2004 From: postmaster at emotu.it (Carlo Chiari) Date: Sun Jan 21 12:10:27 2007 Subject: [music-dsp] Maybe OT: sharing member between VST Effect class and VST Editor class Message-ID: <41865867.7010109@emotu.it> Hi, this seems to be more a C++ programming question than a sound processing question. I must share a member of the VST Effect class with the VST Editor class. This member is my customized WAV_File object. It contains wav file pointer, the wav info header and some routines. Since I open the wav file in the GUI Editor class, and process it in the Effect class, how could I access to it? thanx Carlo From rossb at audiomulch.com Mon Nov 1 13:32:26 2004 From: rossb at audiomulch.com (Ross Bencina) Date: Sun Jan 21 12:10:27 2007 Subject: [music-dsp] Maybe OT: sharing member between VST Effect class and VST Editor class References: <41865867.7010109@emotu.it> Message-ID: <00c401c4c041$c2be86d0$2401a8c0@Psilocybin> Hi Carlo I think you need to be extremely careful about sharing such objects between GUI and audio processing. I would suggest setting up a lock free queue structure, instantiating the soundfile object in the gui thread and then sending it to the audio thread via the queue. Don't try to access the object from both threads simultaneously unless you have designed it to be safe. Don't use locks if you want good performance. Ross. ----- Original Message ----- From: "Carlo Chiari" To: "a list for musical digital signal processing" Sent: Monday, November 01, 2004 4:38 PM Subject: [music-dsp] Maybe OT: sharing member between VST Effect class and VST Editor class > Hi, this seems to be more a C++ programming question than a sound > processing question. > > I must share a member of the VST Effect class with the VST Editor class. > This member is my customized WAV_File object. It contains wav file > pointer, the wav info header and some routines. > > Since I open the wav file in the GUI Editor class, and process it in the > Effect class, how could I access to it? > > thanx > > Carlo > -- > dupswapdrop -- the music-dsp mailing list and website: subscription info, > FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From doug_houghton at sympatico.ca Mon Nov 1 20:08:32 2004 From: doug_houghton at sympatico.ca (Doug) Date: Sun Jan 21 12:10:27 2007 Subject: [music-dsp] typical figital reverb References: <41865867.7010109@emotu.it> <00c401c4c041$c2be86d0$2401a8c0@Psilocybin> Message-ID: <000301c4c078$7aa97170$0201a8c0@elric> to anyone struggling along (like me) trying to get a decent sounding comb filter/allpass filter based reverb I just thought I'd share a discovery I made sifting through various internet pages. Until recently I never adjusted the gain setting on the various filters to match their respective delay laneghts. This is probably mentioned in every tutorial, but I somehow missed it, either that or I"m dead wrong, but anyhow... For example, if you've got 8 comb filters, all with varying lengths, say shorter to longer, setting the individual gain of each subsequent filter to be a little higher than the last seems to lush things up. It makes perfect sense. You don't want half your filters tapering out when the other half are jsut getting going. Ideally, all your filters should decay at the same rate volume wise. Right now I've got gain *= 1.1 in a loop that scrolls through all parralell comb filters just as a hack. This could properly be set calculating each filters gain based on it's length and it's target decay. That's it From paranoiaspoisondoor at gmail.com Mon Nov 1 20:13:55 2004 From: paranoiaspoisondoor at gmail.com (Keith Handy) Date: Sun Jan 21 12:10:27 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect In-Reply-To: References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead> <004901c4bd08$2b14d4b0$030200c0@australia> <007a01c4bd9a$88f30e20$030200c0@australia> Message-ID: <79a2ad4104110117132b36b0a3@mail.gmail.com> All I know is every time I glance at the contents of my inbox I spend about half a second thinking "What's a 'coding attack'???" ... -Keith -- I've seen all good people trim their hedge each day From signalzerodb at yahoo.co.uk Tue Nov 2 04:46:07 2004 From: signalzerodb at yahoo.co.uk (Dave Gamble) Date: Sun Jan 21 12:10:27 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect In-Reply-To: <79a2ad4104110117132b36b0a3@mail.gmail.com> References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead> <004901c4bd08$2b14d4b0$030200c0@australia> <007a01c4bd9a$88f30e20$030200c0@australia> <79a2ad4104110117132b36b0a3@mail.gmail.com> Message-ID: <05230867-2CB4-11D9-B3EA-000A958903DE@yahoo.co.uk> On 2 Nov 2004, at 01:13, Keith Handy wrote: > All I know is every time I glance at the contents of my inbox I spend > about half a second thinking "What's a 'coding attack'???" ... > If you've ever been to a demo party, it's the bit 25 minutes before the demos are due to go on the projector, where some genius invents a new gfx technique, codes it up into his demo, wins the competition, and then presents a paper on it at siggraph a month or two later. > I've seen all good people trim their hedge each day Huh? Dave. From warder at dlc.fi Tue Nov 2 04:58:19 2004 From: warder at dlc.fi (Vesa Norilo) Date: Sun Jan 21 12:10:27 2007 Subject: [music-dsp] typical figital reverb In-Reply-To: <000301c4c078$7aa97170$0201a8c0@elric> References: <41865867.7010109@emotu.it> <00c401c4c041$c2be86d0$2401a8c0@Psilocybin> <000301c4c078$7aa97170$0201a8c0@elric> Message-ID: <41875A3B.1010707@dlc.fi> > >It makes perfect sense. You don't want half your filters tapering out when >the other half are jsut getting going. Ideally, all your filters should >decay at the same rate volume wise. > > Yes, I always did the RT60 calculation per comb filter. Another thing you might want to do is to adjust the gain (not feedback gain) of the comb filter so that the spectrum peaks are equal. You see, the comb filter has a frequency response that's sharper for higher feedback coefs. It peaks at gain/(1-feedback) Set feedback per delay line lenght, normalize gain to equalize spectrum peaks and you should have the smoothest comb filter reverb possible... but I still prefer FDNs :) Vesa From postmaster at emotu.it Tue Nov 2 10:54:55 2004 From: postmaster at emotu.it (Carlo Chiari) Date: Sun Jan 21 12:10:27 2007 Subject: [music-dsp] Playing a WAV PCM in a VSTi Message-ID: <4187ADCF.50605@emotu.it> Hi to all, I've to playback a multichannel wav in a VSTi, it will look like a surround sampler when I'll implement the MIDI support. I'm using LIBSNDFILE library to manage audio data. In processReplacing function I fill up a floating point buffer (*data) with sampleFrames samples (using the sf_readf_float API). This functions return frames * channels samples so my call is: data = new float[sampleFrames]; ... ... if(wav.pWAV != NULL && wav.opened) { items = wav.readPCMSamples(wav.pWAV, data, sampleFrames / channels); } else { return ; } Then I de-inteleave the buffer and feed the **outputs with the result. My simple routine does the following: for(j = 0; j < channels; j ++) for(i = j; i < sampleFrames; i += channels) outputs[j][i] = data[i] * fGain; The listening result is that the music is slowed down very much, maybe an half. I tried to divide the items by a power of two so I read more often the data but the result became worst. My question is : have I to use the Microsoft waveOutOpen APIs to play a wav file also in a VSTi? But, isn't the host that does this stuff? thanx regards Carlo From doug_houghton at sympatico.ca Tue Nov 2 23:28:42 2004 From: doug_houghton at sympatico.ca (Doug) Date: Sun Jan 21 12:10:28 2007 Subject: [music-dsp] typical figital reverb References: <41865867.7010109@emotu.it> <00c401c4c041$c2be86d0$2401a8c0@Psilocybin><000301c4c078$7aa97170$0201a8c0@elric> <41875A3B.1010707@dlc.fi> Message-ID: <000a01c4c15d$99a6a0d0$0201a8c0@elric> thanks for the tips, now to google RT60 lol... ----- Original Message ----- From: "Vesa Norilo" To: "a list for musical digital signal processing" Sent: Tuesday, November 02, 2004 4:58 AM Subject: Re: [music-dsp] typical figital reverb > > > > >It makes perfect sense. You don't want half your filters tapering out when > >the other half are jsut getting going. Ideally, all your filters should > >decay at the same rate volume wise. > > > > > Yes, I always did the RT60 calculation per comb filter. Another thing > you might want to do is to adjust the gain (not feedback gain) of the > comb filter so that the spectrum peaks are equal. You see, the comb > filter has a frequency response that's sharper for higher feedback > coefs. It peaks at gain/(1-feedback) > > Set feedback per delay line lenght, normalize gain to equalize spectrum > peaks and you should have the smoothest comb filter reverb possible... > but I still prefer FDNs :) > > Vesa > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From eddie at roughproductions.co.uk Wed Nov 3 07:29:55 2004 From: eddie at roughproductions.co.uk (Eddie Al-Shakarchi) Date: Sun Jan 21 12:10:28 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead><004901c4bd08$2b14d4b0$030200c0@australia><007a01c4bd9a$88f30e20$030200c0@australia><79a2ad4104110117132b36b0a3@mail.gmail.com> <05230867-2CB4-11D9-B3EA-000A958903DE@yahoo.co.uk> Message-ID: <004101c4c1a0$d38f79a0$020200c0@australia> lol okay guys, the situation is that i have a working compressor now. i got around the threshold-in-db's issue by making the threshold a % of the original signal. i'm going to try steve liddles suggestions later about converting to db's (thanks for that). i'm now trying to give the user the option of using either peak, rms, or averaged detection. i was going to have another variable, called thresholdWidth which the user can set which will be used in both RMS and averaging mode. so this is a threshold in millisecs, and is used as a 'window' to get an average from. i think the c code in the dsp code archive does something similar but i noticed that on the compressor in logic (pro) that there is the option of RMS averaging but there's no threshold width. so what do they use to work out this mysterious rms average? cheers Eddie From eddie at roughproductions.co.uk Wed Nov 3 07:31:58 2004 From: eddie at roughproductions.co.uk (Eddie Al-Shakarchi) Date: Sun Jan 21 12:10:28 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead><004901c4bd08$2b14d4b0$030200c0@australia><007a01c4bd9a$88f30e20$030200c0@australia> <79a2ad4104110117132b36b0a3@mail.gmail.com> Message-ID: <005101c4c1a1$1c5d79c0$020200c0@australia> heh wierd thing is, i do the exact same thing ----- Original Message ----- From: "Keith Handy" To: "a list for musical digital signal processing" Sent: Tuesday, November 02, 2004 1:13 AM Subject: Re: [music-dsp] Coding attack and delay times for a compressor effect > All I know is every time I glance at the contents of my inbox I spend > about half a second thinking "What's a 'coding attack'???" ... > > -Keith > > -- > I've seen all good people trim their hedge each day > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From joshscholar at yahoo.com Wed Nov 3 07:57:39 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:28 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead><004901c4bd08$2b14d4b0$030200c0@australia><007a01c4bd9a$88f30e20$030200c0@australia><79a2ad4104110117132b36b0a3@mail.gmail.com> <05230867-2CB4-11D9-B3EA-000A958903DE@yahoo.co.uk> Message-ID: <001901c4c1a4$b4487020$1ae22641@antssoftware.com> >> I've seen all good people trim their hedge each day >Huh? I've given Keith long enough to answer. Here's your hint: "I've seen all good people turn their heads each day so satisfied I'm on my way." >Dave. Joshua "roundabout" Scholar From S.Liddle at ioe.ac.uk Wed Nov 3 08:42:44 2004 From: S.Liddle at ioe.ac.uk (Steven Liddle) Date: Sun Jan 21 12:10:28 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect Message-ID: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC69@mail02.ioead> >i'm now trying to give the user the option of using either peak, rms, or averaged detection. Ok > but i noticed that on the compressor in logic (pro) that there is the option of RMS averaging but there's no threshold width. so what do they use to work out this mysterious rms average? Keep it simple - find an optimum window time to get a reliable average and weigh it up with the amount of processing time required - that 's why you don't get a choice in logic. Steve From aclark at danvillesignal.com Wed Nov 3 10:20:08 2004 From: aclark at danvillesignal.com (Al Clark) Date: Sun Jan 21 12:10:28 2007 Subject: [music-dsp] ADSP-2100 circuit diagrams (delurking) In-Reply-To: References: Message-ID: <6.1.0.6.0.20041103091734.026ea600@localhost> I have been out of town, so if this has already been answered, ignore it..... The book in question is available on the ADI web site. I believe there is a link on our website in our developer section. The source code from the book is also available. Al Clark Danville Signal Processing, Inc. -------------------------------------------------------------------- Purveyors of Fine DSP Hardware and other Cool Stuff Available at http://www.danvillesignal.com At 06:01 AM 10/28/2004, David J. Hughes wrote: >Hello, > >I was given a book about ten years ago "Digital Signal Processing >Applications using the ADSP-2100 Family" and it came with a couple of 5 1/2 >inch discs. These are a little too big to fit into my PC's floppy though I >suppose I could try cutting them down a bit... (only joking). > >Does anyone have this book and, if so, have they copied the contents to >another medium? I would bevery grateful if anyone provide me with a copy of >the contents which should be, if memory serves, a couple of ADSP circuit >diagrams in Orcad format. > >Regards > David > >-- >Infection Music Limited. http://www.infectionmusic.co.uk > >This e-mail and any files transmitted with it are confidential and intended >for the addressee only. If you are not the addressee you may not copy, >forward, disclose or otherwise use it, or any part of it, in any form >whatsoever. If you have received this e-mail in error please notify the >sender and ensure that all copies of this e-mail and any files transmitted >with it are deleted. Any views or opinions represented in this e-mail are >solely those of the author and do not necessarily represent those of >Infection Music. Although this e-mail and its attachments have been scanned >for the presence of computer viruses, Infection Music will not be liable for >any losses as a result of any viruses being passed on. > > >-- >dupswapdrop -- the music-dsp mailing list and website: >subscription info, FAQ, source code archive, list archive, book reviews, >dsp links >http://shoko.calarts.edu/musicdsp >http://ceait.calarts.edu/mailman/listinfo/music-dsp From doug_houghton at sympatico.ca Wed Nov 3 19:28:04 2004 From: doug_houghton at sympatico.ca (Doug) Date: Sun Jan 21 12:10:28 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead><004901c4bd08$2b14d4b0$030200c0@australia><007a01c4bd9a$88f30e20$030200c0@australia><79a2ad4104110117132b36b0a3@mail.gmail.com><05230867-2CB4-11D9-B3EA-000A958903DE@yahoo.co.uk> <004101c4c1a0$d38f79a0$020200c0@australia> Message-ID: <000b01c4c205$26874200$0201a8c0@elric> > > i was going to have another variable, called thresholdWidth which the user > can set which will be used in both RMS and averaging mode. so this is a > threshold in millisecs, and is used as a 'window' to get an average from. i > think the c code in the dsp code archive does something similar > I went down the road of doing this and then ended up not bothering to. From citizenchunk at gmail.com Thu Nov 4 11:07:57 2004 From: citizenchunk at gmail.com (Citizen Chunk) Date: Sun Jan 21 12:10:28 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect In-Reply-To: <001901c4c1a4$b4487020$1ae22641@antssoftware.com> References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead> <004901c4bd08$2b14d4b0$030200c0@australia> <007a01c4bd9a$88f30e20$030200c0@australia> <79a2ad4104110117132b36b0a3@mail.gmail.com> <05230867-2CB4-11D9-B3EA-000A958903DE@yahoo.co.uk> <001901c4c1a4$b4487020$1ae22641@antssoftware.com> Message-ID: YESS! dude! that song is rocks! what ever happened to prog-rock? == chunk On Wed, 3 Nov 2004 04:57:39 -0800, Joshua Scholar wrote: > > > >> I've seen all good people trim their hedge each day > >Huh? > > I've given Keith long enough to answer. Here's your hint: > "I've seen all good people turn their heads each day so satisfied I'm on my > way." > > >Dave. > > Joshua "roundabout" Scholar > > > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From the8bitdeity at thegsp.com Thu Nov 4 17:55:21 2004 From: the8bitdeity at thegsp.com (Robert Kukuchka) Date: Sun Jan 21 12:10:28 2007 Subject: [music-dsp] Feedback Frequency Detection? Message-ID: <9B0F63C2-2EB4-11D9-9B57-000A95D5F9FC@thegsp.com> Hello, I'm curious if anyone could direct me to information regarding feedback frequency detection algorithms. I'm curious about how one would approach this, or specifically have gone about it. Any help would be appreciated. Cheers ~Rob From dgm at baykitty.com Thu Nov 4 18:23:22 2004 From: dgm at baykitty.com (don) Date: Sun Jan 21 12:10:28 2007 Subject: [music-dsp] spectrum analyzer Message-ID: <004201c4c2c5$4a475070$0402a8c0@liuxing> I am currently working on an audio spectrum analyzer in which we would like to replace a 1/3 digital filter network with an FFT. There are a number of reasons for this related to other aspects of the product. I realize that an FFT is not ?real time?, nor does it have the constant resolution we want from band to band, but much of this looks as though many of the problems could be ameliorated with the STFT and overlap. ? Has anyone done this? And what thoughts, references and caveats do you have? ? Thanks, Don ? From arcane at arcanemethods.com Thu Nov 4 21:31:56 2004 From: arcane at arcanemethods.com (Bob Cain) Date: Sun Jan 21 12:10:28 2007 Subject: [music-dsp] spectrum analyzer In-Reply-To: <004201c4c2c5$4a475070$0402a8c0@liuxing> References: <004201c4c2c5$4a475070$0402a8c0@liuxing> Message-ID: <418AE61C.2070500@arcanemethods.com> don wrote: > I am currently working on an audio spectrum analyzer in which we would like > to replace a 1/3 digital filter network with an FFT. There are a number of > reasons for this related to other aspects of the product. > I realize that an FFT is not ?real time?, nor does it have the constant > resolution we want from band to band, but much of this looks as though many > of the problems could be ameliorated with the STFT and overlap. What I'd do is a single FFT which implements the user specified magnitude function with either a minimum phase or linear phase implementation at the user's choice. What problems do you see that require something like a STFT? Latency of response to controls? I've not heard of using the STFT as a processing function, but rather an analysis tool. Have I missed something important? Bob -- "Things should be described as simply as possible, but no simpler." A. Einstein From dgm at baykitty.com Thu Nov 4 22:03:23 2004 From: dgm at baykitty.com (don) Date: Sun Jan 21 12:10:29 2007 Subject: [music-dsp] spectrum analyzer In-Reply-To: <418AE61C.2070500@arcanemethods.com> Message-ID: <006801c4c2e4$0629c7f0$0402a8c0@liuxing> No, very likely it is me and my understanding. I have not used it. The idea is to keep the resolution in each band the same. For Zoom functions. Perhaps, this is not the best technique. When I read about the STFT, it appeared to be an excellent analytic function and might allow a 'real time' response. I will look at what you suggest. Thank you. Don Don -----Original Message----- From: music-dsp-bounces@ceait.calarts.edu [mailto:music-dsp-bounces@ceait.calarts.edu] On Behalf Of Bob Cain Sent: Thursday, November 04, 2004 6:32 PM To: a list for musical digital signal processing Subject: Re: [music-dsp] spectrum analyzer don wrote: > I am currently working on an audio spectrum analyzer in which we would like > to replace a 1/3 digital filter network with an FFT. There are a number of > reasons for this related to other aspects of the product. > I realize that an FFT is not 'real time', nor does it have the constant > resolution we want from band to band, but much of this looks as though many > of the problems could be ameliorated with the STFT and overlap. What I'd do is a single FFT which implements the user specified magnitude function with either a minimum phase or linear phase implementation at the user's choice. What problems do you see that require something like a STFT? Latency of response to controls? I've not heard of using the STFT as a processing function, but rather an analysis tool. Have I missed something important? Bob -- "Things should be described as simply as possible, but no simpler." A. Einstein -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From S.W.Harris at ecs.soton.ac.uk Fri Nov 5 00:04:10 2004 From: S.W.Harris at ecs.soton.ac.uk (Steve Harris) Date: Sun Jan 21 12:10:29 2007 Subject: [music-dsp] spectrum analyzer In-Reply-To: <004201c4c2c5$4a475070$0402a8c0@liuxing> References: <004201c4c2c5$4a475070$0402a8c0@liuxing> Message-ID: <20041105050410.GD10954@login.ecs.soton.ac.uk> On Thu, Nov 04, 2004 at 03:23:22 -0800, don wrote: > I am currently working on an audio spectrum analyzer in which we would like > to replace a 1/3 digital filter network with an FFT. There are a number of > reasons for this related to other aspects of the product. > I realize that an FFT is not ?real time?, nor does it have the constant > resolution we want from band to band, but much of this looks as though many > of the problems could be ameliorated with the STFT and overlap. I have used FFTs for EQ purposes and it works fine. You need a substantial overlap if you want to lower the latency and avoid distortion, and the choice of window is important. FWIW I use Hanning windows with 16x overlap at 2048 pts. The low frequency resolution is not very good with this number of bands, but the CPU consumption quickly becommes excessive otherwise. I have considered downsampling and procxessing the low frequencies seperatly, but it would be hard to do without introducing unevenness in the freq and phase response, which is very important for my application. - Steve From martin at bioroid.com Fri Nov 5 01:10:06 2004 From: martin at bioroid.com (Martin Robaszewski) Date: Sun Jan 21 12:10:29 2007 Subject: [music-dsp] Playing a WAV PCM in a VSTi In-Reply-To: <4187ADCF.50605@emotu.it> Message-ID: <009301c4c2fe$19d57dc0$c801a8c0@traxx> Just look at my TurntablistPro VSTi source available on www.bioroid.com It uses libsndfile > -----Original Message----- > From: music-dsp-bounces@shoko.calarts.edu > [mailto:music-dsp-bounces@shoko.calarts.edu] On Behalf Of Carlo Chiari > Sent: Tuesday, November 02, 2004 7:55 AM > To: a list for musical digital signal processing > Subject: [music-dsp] Playing a WAV PCM in a VSTi > > > Hi to all, > I've to playback a multichannel wav in a VSTi, it will > look like a > surround sampler when I'll implement the MIDI support. > > I'm using LIBSNDFILE library to manage audio data. In > processReplacing > function I fill up a floating point buffer (*data) with sampleFrames > samples (using the sf_readf_float API). > This functions return frames * channels samples so my call is: > > data = new float[sampleFrames]; > ... > ... > if(wav.pWAV != NULL && wav.opened) > { > items = wav.readPCMSamples(wav.pWAV, data, > sampleFrames > / channels); > } > else > { > return ; > } > > Then I de-inteleave the buffer and feed the **outputs with > the result. > My simple routine does the following: > > for(j = 0; j < channels; j ++) > for(i = j; i < sampleFrames; i += channels) > outputs[j][i] = data[i] * fGain; > > The listening result is that the music is slowed down very > much, maybe > an half. > I tried to divide the items by a power of two so I read more > often the > data but the result became worst. > > My question is : have I to use the Microsoft waveOutOpen > APIs to play a > wav file also in a VSTi? But, isn't the host that does this stuff? > > thanx > > regards > > Carlo > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, > book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From y.shi at gpe-hkg.com Fri Nov 5 01:54:46 2004 From: y.shi at gpe-hkg.com (y.shi@gpe-hkg.com) Date: Sun Jan 21 12:10:29 2007 Subject: [music-dsp] Feedback Frequency Detection? In-Reply-To: <9B0F63C2-2EB4-11D9-9B57-000A95D5F9FC@thegsp.com> Message-ID: You may check the us patent 5245665. There is much more information than what you want. Good luck! Shi Yong Robert Kukuchka > cc: Sent by: Subject: [music-dsp] Feedback Frequency Detection? music-dsp-bounces@ceait. calarts.edu 04-11-05 06:55 Please respond to a list for musical digital signal processing Hello, I'm curious if anyone could direct me to information regarding feedback frequency detection algorithms. I'm curious about how one would approach this, or specifically have gone about it. Any help would be appreciated. Cheers ~Rob -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From y.shi at gpe-hkg.com Fri Nov 5 02:03:42 2004 From: y.shi at gpe-hkg.com (y.shi@gpe-hkg.com) Date: Sun Jan 21 12:10:29 2007 Subject: [music-dsp] In-Reply-To: <009301c4c2fe$19d57dc0$c801a8c0@traxx> Message-ID: I'm working with a hamonic generator which emploies a discrete-time integrator. I searched the matlab's help file and find some introduction about it to some extent,which mainly includes three methods: Forward Euler,Backward Euler and Trapezoidal. However, I failed to find any futher more information about any of these three methods. Any suggestions? Are there some useful articles online? Thanks advance. Shi Yong From dgm at baykitty.com Fri Nov 5 09:14:21 2004 From: dgm at baykitty.com (don) Date: Sun Jan 21 12:10:29 2007 Subject: [music-dsp] spectrum analyzer In-Reply-To: <20041105050410.GD10954@login.ecs.soton.ac.uk> Message-ID: <000901c4c341$c2538300$0402a8c0@liuxing> Thank you Steve, this sounds interesting. One of the considerations is the response of the system to white or pink noise must be consistent with a 1/3 octave filter bank. This is part of my concern - but if you have been able to use it for EQ, then it must handle that correctly, right? And another concern is the low frequency response. Somehow it must be consistent. Thank you again, Don -----Original Message----- From: music-dsp-bounces@ceait.calarts.edu [mailto:music-dsp-bounces@ceait.calarts.edu] On Behalf Of Steve Harris Sent: Thursday, November 04, 2004 9:04 PM To: music-dsp@shoko.calarts.edu Subject: Re: [music-dsp] spectrum analyzer On Thu, Nov 04, 2004 at 03:23:22 -0800, don wrote: > I am currently working on an audio spectrum analyzer in which we would like > to replace a 1/3 digital filter network with an FFT. There are a number of > reasons for this related to other aspects of the product. > I realize that an FFT is not 'real time', nor does it have the constant > resolution we want from band to band, but much of this looks as though many > of the problems could be ameliorated with the STFT and overlap. I have used FFTs for EQ purposes and it works fine. You need a substantial overlap if you want to lower the latency and avoid distortion, and the choice of window is important. FWIW I use Hanning windows with 16x overlap at 2048 pts. The low frequency resolution is not very good with this number of bands, but the CPU consumption quickly becommes excessive otherwise. I have considered downsampling and procxessing the low frequencies seperatly, but it would be hard to do without introducing unevenness in the freq and phase response, which is very important for my application. - Steve -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From aclark at danvillesignal.com Thu Nov 4 20:49:18 2004 From: aclark at danvillesignal.com (Al Clark) Date: Sun Jan 21 12:10:29 2007 Subject: [music-dsp] spectrum analyzer In-Reply-To: <004201c4c2c5$4a475070$0402a8c0@liuxing> References: <004201c4c2c5$4a475070$0402a8c0@liuxing> Message-ID: <6.1.0.6.0.20041104194012.02734498@localhost> At 05:23 PM 11/4/2004, you wrote: >I am currently working on an audio spectrum analyzer in which we would like >to replace a 1/3 digital filter network with an FFT. There are a number of >reasons for this related to other aspects of the product. >I realize that an FFT is not 'real time', nor does it have the constant >resolution we want from band to band, but much of this looks as though many >of the problems could be ameliorated with the STFT and overlap. > >Has anyone done this? And what thoughts, references and caveats do you have? > >Thanks, >Don > > > >-- >dupswapdrop -- the music-dsp mailing list and website: >subscription info, FAQ, source code archive, list archive, book reviews, >dsp links >http://shoko.calarts.edu/musicdsp >http://ceait.calarts.edu/mailman/listinfo/music-dsp 1/3 Octave networks have been synthesized from FFTs for many years. Generally, you will want to use multiple FFTs with different sampling rates. For example, you might use three 1024 point FFTs with sample rates of 48k, 4800 and 480. This insures that there is enough resolution for the lower frequency bands since you are mapping constant bandwidth filters into constant percentage bandwidth filters. You could also use longer FFTs for the same result. Assuming you have adequate signal processing capability, you could calculate the third octaves directly for better results. Al Clark Danville Signal Processing, Inc. -------------------------------------------------------------------- Purveyors of Fine DSP Hardware and other Cool Stuff Available at http://www.danvillesignal.com From ansum at online.de Fri Nov 5 12:04:06 2004 From: ansum at online.de (Andreas Sumerauer) Date: Sun Jan 21 12:10:29 2007 Subject: [music-dsp] Pitch Perception - with an inharmonic overtone spectrum Message-ID: <418BB286.8050402@online.de> Hi everybody, I am currently experimenting with modal synthesis and found that the perceived pitch is very much dependent on the overtones. If the spectrum is spread just a little bit the perceived pitch of the sound will not be equal to the fundamental anymore. I am just wondering wether it is possible to predict the perceiced pitch when the (inharmonic) spectrum is known. are there any rules that allow to precisely estimate the pitch? This would help me to implement an automatic retuning when the spectrum changes. I would be greatful for any hints or literature on the topic. thanks Andreas Sumerauer From martin.eisenberg at udo.edu Fri Nov 5 12:36:43 2004 From: martin.eisenberg at udo.edu (Martin Eisenberg) Date: Sun Jan 21 12:10:29 2007 Subject: [music-dsp] References: Message-ID: <002401c4c35e$076c59a0$1e0d060a@mooncode> From: > I'm working with a hamonic generator which emploies a > discrete-time integrator. > I searched the matlab's help file and find some introduction > about it to some extent,which mainly includes three methods: > Forward Euler,Backward Euler and Trapezoidal. > However, I failed to find any futher more information about > any of these three methods. Such numerical integration schemes are also called quadrature rules, maybe that helps. The rules you mention are described in sections 4 and 16 of the Numerical Recipes book. Martin From t.hogers at home.nl Fri Nov 5 13:26:34 2004 From: t.hogers at home.nl (Theo) Date: Sun Jan 21 12:10:29 2007 Subject: [music-dsp] Pitch Perception - with an inharmonic overtone spectrum References: <418BB286.8050402@online.de> Message-ID: <00dd01c4c364$faf01340$93b37ad9@ensch1.ov.home.nl> Hi Andreas Interesting, and kind off odd. I did a additive synth some time ago that had a "spread" parameter for the over tones, but didn't run into what you describe. The range of the parameter was set from 1/4 harmonic distance to 2 harmonic distance (probably not the right way to put it but hope you understand) When sweeping there where sweetspots where things sounded "almost harmonic" and bad spots where there was hardly a perceived pitch. However no pitch change like you describe. Also any FM (DX) synth let you do "spread" spectrums quite easily. Never felt there was a prob there either. It may be a matter of who is listening, maybe you have a better sense for pitch than I have. There is however one other thing I can think of. How is your spread parameter implemented? Is there a fixed frequency offset to all partials or is the offset for each partial based on the "distance" to the next harmonic. I did the latter and also does a DX (by nature). Cheers Theo ----- Original Message ----- From: Andreas Sumerauer To: a list for musical digital signal processing Sent: Friday, November 05, 2004 6:04 PM Subject: [music-dsp] Pitch Perception - with an inharmonic overtone spectrum > Hi everybody, > I am currently experimenting with modal synthesis and found that the > perceived pitch is very much dependent on the overtones. If the spectrum > is spread just a little bit the perceived pitch of the sound will not be > equal to the fundamental anymore. > I am just wondering wether it is possible to predict the perceiced pitch > when the (inharmonic) spectrum is known. are there any rules that allow > to precisely estimate the pitch? > This would help me to implement an automatic retuning when the spectrum > changes. > I would be greatful for any hints or literature on the topic. > > thanks > > Andreas Sumerauer > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From sundu17 at hotmail.com Fri Nov 5 17:37:22 2004 From: sundu17 at hotmail.com (Sundararam Dwarakanath) Date: Sun Jan 21 12:10:29 2007 Subject: [music-dsp] Calculation of SNR References: <007501c48f9f$f59dfb80$f8b82e80@middleearth> Message-ID: Hello, I was just wondering if there was a good method to calculate SNR of an audio data? I hear that Adobe Audition can be used. It would be great if someone to could point me in the right direction for this. Also, if there are any standard methods of measuring SNR it would be good if someone pointed me to them too. Thanks Sundar From jchandjr at bellsouth.net Fri Nov 5 18:07:37 2004 From: jchandjr at bellsouth.net (James Chandler Jr) Date: Sun Jan 21 12:10:29 2007 Subject: [music-dsp] Calculation of SNR References: <007501c48f9f$f59dfb80$f8b82e80@middleearth> Message-ID: <068201c4c38c$3fc30640$6401a8c0@JamesCompaq3080> Hi Sundararam I'm not an expert, but here are a couple of idears. * In Audition, if you select the 'silent' head or tail region of a WAV file (which only contains the cumulative mix noise, hiss, hum, etc)-- The Audition Statistics menu option will measure the dB amplitude of that 'noise only' region. Then select the entire WAV file, and get Statistics. Note the Max dB amplitude. If you subtract the 'noise only' dB from the Max dB of the song, it ought to at least give an approximation of SNR. This assumes that the quiescent noise at the head and tail of the file is about the same as the quiescent noise within the file. Some synthesizers contain the equivalent of noise gates. As soon as you play any notes on such synths, the gate opens and the background noise of the synth grows louder. If your WAV file has synths like that, perhaps the above estimate wouldn't be very accurate? Dunno. * An old analog classic method of measuring noise+distortion in audio hardware-- Feed a low-distortion 1 KHz sine wave thru the device of interest. On the gadget's output, use a very deep narrow notch filter to remove the 1 KHz sine. The power ratio of the Notch Filter output vs the Sine Wave, gives a good estimate of noise+distortion. The notch-filter method should work identically if implemented as a digital audio program. JCJR ----- Original Message ----- From: "Sundararam Dwarakanath" To: "a list for musical digital signal processing" Sent: Friday, November 05, 2004 5:37 PM Subject: [music-dsp] Calculation of SNR > Hello, > I was just wondering if there was a good method to calculate SNR of an audio > data? > > I hear that Adobe Audition can be used. It would be great if someone to could > point me in the right direction for this. > Also, if there are any standard methods of measuring SNR it would be good if > someone pointed me to them too. > > Thanks > Sundar -- > dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, > source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From erikd-music-dsp at mega-nerd.com Fri Nov 5 18:19:47 2004 From: erikd-music-dsp at mega-nerd.com (Erik de Castro Lopo) Date: Sun Jan 21 12:10:29 2007 Subject: [music-dsp] Calculation of SNR In-Reply-To: References: <007501c48f9f$f59dfb80$f8b82e80@middleearth> Message-ID: <20041106101947.75a921ad.erikd-music-dsp@mega-nerd.com> On Fri, 5 Nov 2004 14:37:22 -0800 "Sundararam Dwarakanath" wrote: > Hello, > I was just wondering if there was a good method to calculate SNR of an audio > data? > > I hear that Adobe Audition can be used. It would be great if someone to > could point me in the right direction for this. > Also, if there are any standard methods of measuring SNR it would be good if > someone pointed me to them too. In the test suite to Secret Rabit Code: http://www.mega-nerd.com/SRC/ I have some code for testing the SNR of the sample rate converters. You might want to have a look at that. Cheers, Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) +-----------------------------------------------------------+ "UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things." -- Doug Gwyn From joshscholar at yahoo.com Fri Nov 5 19:07:48 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:29 2007 Subject: [music-dsp] Calculation of SNR References: <007501c48f9f$f59dfb80$f8b82e80@middleearth> <20041106101947.75a921ad.erikd-music-dsp@mega-nerd.com> Message-ID: <017701c4c394$a75a0fd0$44cc3f40@antssoftware.com> You know, I'm never sure if I should use that A-weight curve when calculating SNR or leave it unweighted. From doug_houghton at sympatico.ca Fri Nov 5 20:10:09 2004 From: doug_houghton at sympatico.ca (Doug) Date: Sun Jan 21 12:10:29 2007 Subject: [music-dsp] zero stuff lowpass References: <007501c48f9f$f59dfb80$f8b82e80@middleearth> <20041106101947.75a921ad.erikd-music-dsp@mega-nerd.com> Message-ID: <000301c4c39d$5c75c3c0$0201a8c0@elric> after much debugging, I have managed to get zero stuffing to work, it seems more like a combination of multiple bugs than the proper way of doing it... the process, I"m creating higher pitched notes from lower ones, I'm stuffing with 9 zeros (10 * oversampling), low passing that and interpolating into the ten resulting low passed samples of each source sample to get my output sample. I'm just taking the closest floored sample of the ten for now. two things surprised me. 1) I had to multiply my resulting wave form by the oversampling rate to get the appropriate volume. I assume the zero stuffing reduces the power of the signal by the factor of the oversampling? 2) I had to set the samplerate of my lowpass filter to samplerate (44100) * oversample_rate * oversample_rate This was a pain, I more or less stumbled on the solution taking stabs in the dark. One multiplication for the headroom in the oversampled stream, and one because you're knocking it down to the target sample rate? Still doesn't quite sit with me. Does this make sense assuming the approach I've taken? thanks From joshscholar at yahoo.com Fri Nov 5 20:33:33 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:30 2007 Subject: [music-dsp] zero stuff lowpass References: <007501c48f9f$f59dfb80$f8b82e80@middleearth><20041106101947.75a921ad.erikd-music-dsp@mega-nerd.com> <000301c4c39d$5c75c3c0$0201a8c0@elric> Message-ID: <019701c4c3a0$a1f4b890$44cc3f40@antssoftware.com> > ----- Original Message ----- > From: Doug > To: a list for musical digital signal processing > Sent: Friday, November 05, 2004 5:10 PM > Subject: [music-dsp] zero stuff lowpass ... > two things surprised me. > 1) I had to multiply my resulting wave form by the oversampling rate to get > the appropriate volume. I assume the zero stuffing reduces the power of the > signal by the factor of the oversampling? Yep, the energy from the none-zero sample gets spread over the zero samples like spreading butter over toast. I've never tried oversampling this way - I always went the more expensive route of using sinc filter interpolation. Is there anything wrong with doubling up samples (nearest neighbor filtering) instead of zero stuffing? Would that be easier to filter or harder? It's clear that there would be MUCH less higher frequency noise, but what about lower frequency noise, closer to the original nyquest frequency? From earlevel at earlevel.com Fri Nov 5 20:41:48 2004 From: earlevel at earlevel.com (Nigel Redmon) Date: Sun Jan 21 12:10:30 2007 Subject: [music-dsp] zero stuff lowpass In-Reply-To: <000301c4c39d$5c75c3c0$0201a8c0@elric> References: <007501c48f9f$f59dfb80$f8b82e80@middleearth> <20041106101947.75a921ad.erikd-music-dsp@mega-nerd.com> <000301c4c39d$5c75c3c0$0201a8c0@elric> Message-ID: <0617A388-2F95-11D9-8D59-000A959AF1E4@earlevel.com> Are you using an FIR filter? If so, hope you're not actually stuffing the zeros in there--they would just yield multiplies by zero, so you can leave them out. If you look at inserting the zeros, then taking your FIR coefficients and moving them over one sample to generate each new sample, you're notice that for the first point you can skip the zero multiplies, so you end up using coefficient n, n+10, n+20, n+30...; then for the next sample you'll use n+1, n+11, n+21... then n+2, n+22, n+32... notice then pattern. Google for polyphase FIR, and I think there might be source code in the www.musicdsp.org archives. If you want to work with oversampling ratios greater than two or three, it's more efficient to do the conversion in multiple small-ratio steps ("multirate" processing). I don't have time to tell you why--have to be somewhere, um, *now*--but feel free to ask questions after you've looked at it via the web. briefly: 1) yeah 2) not sure what you mean--the lowpass is set relative to the new sample rate. That is, consider that for 44.1k, if you were sending it out a DAC, the hardware lowpass would have to be set below half that rate (20kHz-ish). If you oversample 10x, the lowpass would also be around 20kHz-ish, but instead of being below half the sample rate, it would now be below 1/20th the sample rate. This would be a long FIR to have the same cutoff characteristics (ten times as long), so it's more efficient to do it in steps. 10x isn't the greatest ratio because it's 2 x 5, and 5 is somewhat large. But that's a multirate thing--gotta go ;-) On Nov 5, 2004, at 5:10 PM, Doug wrote: > after much debugging, I have managed to get zero stuffing to work, it > seems > more like a combination of multiple bugs than the proper way of doing > it... > > the process, I"m creating higher pitched notes from lower ones, I'm > stuffing > with 9 zeros (10 * oversampling), low passing that and interpolating > into > the ten resulting low passed samples of each source sample to get my > output > sample. I'm just taking the closest floored sample of the ten for now. > > two things surprised me. > 1) I had to multiply my resulting wave form by the oversampling rate > to get > the appropriate volume. I assume the zero stuffing reduces the power > of the > signal by the factor of the oversampling? > > 2) I had to set the samplerate of my lowpass filter to > > samplerate (44100) * oversample_rate * oversample_rate > > This was a pain, I more or less stumbled on the solution taking stabs > in the > dark. One multiplication for the headroom in the oversampled stream, > and > one because you're knocking it down to the target sample rate? Still > doesn't quite sit with me. > > Does this make sense assuming the approach I've taken? From earlevel at earlevel.com Fri Nov 5 20:46:35 2004 From: earlevel at earlevel.com (Nigel Redmon) Date: Sun Jan 21 12:10:30 2007 Subject: [music-dsp] zero stuff lowpass In-Reply-To: <019701c4c3a0$a1f4b890$44cc3f40@antssoftware.com> References: <007501c48f9f$f59dfb80$f8b82e80@middleearth><20041106101947.75a921ad.erikd-music-dsp@mega-nerd.com> <000301c4c39d$5c75c3c0$0201a8c0@elric> <019701c4c3a0$a1f4b890$44cc3f40@antssoftware.com> Message-ID: On Nov 5, 2004, at 5:33 PM, Joshua Scholar wrote: > Is there anything wrong with doubling up samples (nearest neighbor > filtering) instead of zero stuffing? Quick answer: That hold essentially imposes a lowpass filter in the shape of the sinc function--you can do it but you'd have to compensate for it if you needed things to be "flat". In the real (hardware) world, it's not practical to output perfect impulses, so the hardware usually uses a sample-hold to turn the impulses into a staircase wave--in which case the hardware needs to compensate for the high-end droop. (oops, not i'm really late) From doug_houghton at sympatico.ca Fri Nov 5 20:47:50 2004 From: doug_houghton at sympatico.ca (Doug) Date: Sun Jan 21 12:10:30 2007 Subject: [music-dsp] zero stuff lowpass References: <007501c48f9f$f59dfb80$f8b82e80@middleearth><20041106101947.75a921ad.erikd-music-dsp@mega-nerd.com><000301c4c39d$5c75c3c0$0201a8c0@elric> <019701c4c3a0$a1f4b890$44cc3f40@antssoftware.com> Message-ID: <000701c4c3a2$9fc06180$0201a8c0@elric> > > Yep, the energy from the none-zero sample gets spread over the zero samples > like spreading butter over toast. ya, this seemed appropriate to me once I sorted it out. > I've never tried oversampling this way - I always went the more expensive > route of using sinc filter interpolation. hmmm, that's what I thought I was trying to do lol > Is there anything wrong with doubling up samples (nearest neighbor > filtering) instead of zero stuffing? Would that be easier to filter or > harder? It's clear that there would be MUCH less higher frequency noise, > but what about lower frequency noise, closer to the original nyquest > frequency? as a minus, I don't think you could assume zero for some low pass terms From doug_houghton at sympatico.ca Fri Nov 5 20:59:18 2004 From: doug_houghton at sympatico.ca (Doug) Date: Sun Jan 21 12:10:30 2007 Subject: [music-dsp] zero stuff lowpass References: <007501c48f9f$f59dfb80$f8b82e80@middleearth><20041106101947.75a921ad.erikd-music-dsp@mega-nerd.com><000301c4c39d$5c75c3c0$0201a8c0@elric> <0617A388-2F95-11D9-8D59-000A959AF1E4@earlevel.com> Message-ID: <000f01c4c3a4$39bc4870$0201a8c0@elric> ----- Original Message ----- From: "Nigel Redmon" To: "a list for musical digital signal processing" Sent: Friday, November 05, 2004 8:41 PM Subject: Re: [music-dsp] zero stuff lowpass > Are you using an FIR filter? If so, hope you're not actually stuffing > the zeros in there--they would just yield multiplies by zero, so you > can leave them out. Ya, I'm doing it the slow way, here's the core if my crude algorythm index = floor((1.0 - diff) * OVER_SAMPLE); for(lastf = lastf; lastf <= long_inc; lastf++) { samples[0] = filter_pass(&but, (double)src->data[lastf] / 32767.0); for(j = 1; j < OVER_SAMPLE; j++) samples[j] = filter_pass(&but, 0); } rv->data[i] = 32767.0 * OVER_SAMPLE * samples[index]; I haven't looked at taking advantage of the zero terms in the lowpass yet, I've just been tyring to get a pure tone out of it. Obviously the next thing I can do is weight my output sample against the two closest subsamples. The low pass filter in the loop had to be initialized to... //update_butter_lp(FILTER *, samplerate, cutoff) update_butter_lp(&but, 44100 * OVER_SAMPLE * OVER_SAMPLE, 18000 / fact); the last parameter is just a hack at picking the cutoff for 2 cascaded butter biquads. It's all still pretty rough, but it already sounds better than the weighted interpolation I was doing before, possibly becuse of something buggy in the way I was doing it. >If you look at inserting the zeros, then taking > your FIR coefficients and moving them over one sample to generate each > new sample, you're notice that for the first point you can skip the > zero multiplies, so you end up using coefficient n, n+10, n+20, > n+30...; then for the next sample you'll use n+1, n+11, n+21... then > n+2, n+22, n+32... notice then pattern. Google for polyphase FIR, and I > think there might be source code in the www.musicdsp.org archives. I'll have to look at this for a while, thanks From joshscholar at yahoo.com Fri Nov 5 21:13:54 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:30 2007 Subject: [music-dsp] zero stuff lowpass References: <007501c48f9f$f59dfb80$f8b82e80@middleearth><20041106101947.75a921ad.erikd-music-dsp@mega-nerd.com><000301c4c39d$5c75c3c0$0201a8c0@elric><019701c4c3a0$a1f4b890$44cc3f40@antssoftware.com> <000701c4c3a2$9fc06180$0201a8c0@elric> Message-ID: <01ad01c4c3a6$44f79440$44cc3f40@antssoftware.com> >----- Original Message ----- >From: Doug >To: a list for musical digital signal processing >Sent: Friday, November 05, 2004 5:47 PM >Subject: Re: [music-dsp] zero stuff lowpass > ... >> I've never tried oversampling this way - I always went the more expensive >> route of using sinc filter interpolation. > >hmmm, that's what I thought I was trying to do lol Oh, when you said "zero stuffing" I assumed you were using an IIR filter because when you're doing FIR interpolation it doesn't make sense to keep the input and output in the same buffer or even to make them the same length. In fact - if you use an FFT to to the convolution, it's more effecient to consider each partial sample delay output to be a separate buffer, so if you're doing x4 oversampling, you have one input buffer and three or four output buffers (3 or 4 depending on whether you're going to filter the undelayed buffer to match the roll off from the imperfection of the interpolation filter). > >> Is there anything wrong with doubling up samples (nearest neighbor >> filtering) instead of zero stuffing? Would that be easier to filter or >> harder? It's clear that there would be MUCH less higher frequency noise, >> but what about lower frequency noise, closer to the original nyquest >> frequency? > >as a minus, I don't think you could assume zero for some low pass terms And I think someone just said that the result isn't really flat. From doug_houghton at sympatico.ca Fri Nov 5 22:26:27 2004 From: doug_houghton at sympatico.ca (Doug) Date: Sun Jan 21 12:10:30 2007 Subject: [music-dsp] zero stuff lowpass References: <007501c48f9f$f59dfb80$f8b82e80@middleearth><20041106101947.75a921ad.erikd-music-dsp@mega-nerd.com><000301c4c39d$5c75c3c0$0201a8c0@elric><019701c4c3a0$a1f4b890$44cc3f40@antssoftware.com><000701c4c3a2$9fc06180$0201a8c0@elric> <01ad01c4c3a6$44f79440$44cc3f40@antssoftware.com> Message-ID: <000701c4c3b0$671b4f80$0201a8c0@elric> > Oh, when you said "zero stuffing" I assumed you were using an IIR filter > because when you're doing FIR interpolation it doesn't make sense to keep > the input and output in the same buffer or even to make them the same > length. ahh...I wouldn't know where to begin using a IIR. > In fact - if you use an FFT to to the convolution, it's more effecient to > consider each partial sample delay output to be a separate buffer, so if > you're doing x4 oversampling, you have one input buffer and three or four > output buffers (3 or 4 depending on whether you're going to filter the > undelayed buffer to match the roll off from the imperfection of the > interpolation filter). I'm probably not doing the "sinc" part properly then since I don't do any convolving as I understand it, I spoke a bit too soon. oversampled interpolation is the term that best describes my efforts thus far, but it's a step forward. It sounds like using an FFT to fake infinit oversampling is the next step in the process. For some reason I'm reluctant to do any fourier stuff, maybe because I haven't got one to work yet lol. Thanks fo rthe replies. From joshscholar at yahoo.com Fri Nov 5 22:35:22 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:30 2007 Subject: [music-dsp] zero stuff lowpass References: <007501c48f9f$f59dfb80$f8b82e80@middleearth><20041106101947.75a921ad.erikd-music-dsp@mega-nerd.com><000301c4c39d$5c75c3c0$0201a8c0@elric><019701c4c3a0$a1f4b890$44cc3f40@antssoftware.com><000701c4c3a2$9fc06180$0201a8c0@elric><01ad01c4c3a6$44f79440$44cc3f40@antssoftware.com> <000701c4c3b0$671b4f80$0201a8c0@elric> Message-ID: <01c401c4c3b1$a6a4ea70$44cc3f40@antssoftware.com> >I'm probably not doing the "sinc" part properly then since I don't do any >convolving as I understand it, I spoke a bit too soon. Yes you all. FIR filters are all convolution and nothing but. I think you misunderstand the word. My talk about using an FFT is just another way to do EXACTLY the same thing you're doing right now, just at (possibly) a lower operations count. From doug_houghton at sympatico.ca Fri Nov 5 22:59:59 2004 From: doug_houghton at sympatico.ca (Doug) Date: Sun Jan 21 12:10:30 2007 Subject: [music-dsp] zero stuff lowpass References: <007501c48f9f$f59dfb80$f8b82e80@middleearth><20041106101947.75a921ad.erikd-music-dsp@mega-nerd.com><000301c4c39d$5c75c3c0$0201a8c0@elric><019701c4c3a0$a1f4b890$44cc3f40@antssoftware.com><000701c4c3a2$9fc06180$0201a8c0@elric><01ad01c4c3a6$44f79440$44cc3f40@antssoftware.com><000701c4c3b0$671b4f80$0201a8c0@elric> <01c401c4c3b1$a6a4ea70$44cc3f40@antssoftware.com> Message-ID: <000501c4c3b5$15e36ee0$0201a8c0@elric> > Yes you all. FIR filters are all convolution and nothing but. I think you > misunderstand the word. > right, that seems to make sense. Every input sample ends up multiplied by some factor of the last "n" input and output samples etc...haven't looked at it that way before. That makes a first order filter a convolution of the delay line, it just happens to be to the power of 1. I have to confess to having eq filters that work, but not fully understanding all the specifics, despite some good posts on the topic here. From erikd-music-dsp at mega-nerd.com Sat Nov 6 02:03:22 2004 From: erikd-music-dsp at mega-nerd.com (Erik de Castro Lopo) Date: Sun Jan 21 12:10:30 2007 Subject: [music-dsp] Calculation of SNR In-Reply-To: <017701c4c394$a75a0fd0$44cc3f40@antssoftware.com> References: <007501c48f9f$f59dfb80$f8b82e80@middleearth> <20041106101947.75a921ad.erikd-music-dsp@mega-nerd.com> <017701c4c394$a75a0fd0$44cc3f40@antssoftware.com> Message-ID: <20041106180322.4a3f8a7c.erikd-music-dsp@mega-nerd.com> On Fri, 5 Nov 2004 16:07:48 -0800 "Joshua Scholar" wrote: > You know, I'm never sure if I should use that A-weight curve when > calculating SNR or leave it unweighted. I always leave it unweighted. Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) +-----------------------------------------------------------+ "Using Java as a general purpose application development language is like going big game hunting armed with Nerf weapons." -- Author Unknown From john at johnnowak.com Sat Nov 6 04:16:04 2004 From: john at johnnowak.com (John Nowak) Date: Sun Jan 21 12:10:30 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect In-Reply-To: References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead> <004901c4bd08$2b14d4b0$030200c0@australia> <007a01c4bd9a$88f30e20$030200c0@australia> <79a2ad4104110117132b36b0a3@mail.gmail.com> <05230867-2CB4-11D9-B3EA-000A958903DE@yahoo.co.uk> <001901c4c1a4$b4487020$1ae22641@antssoftware.com> Message-ID: <7BE3D282-2FD4-11D9-845A-000A95D019FC@johnnowak.com> It died, thank god. If there was ever a bunch of masturbatory nonsense in the form of music, it would have to be the vast majority of prog-rock (Yes style). - John On Nov 4, 2004, at 11:07 AM, Citizen Chunk wrote: > YESS! dude! that song is rocks! what ever happened to prog-rock? > > == chunk From paranoiaspoisondoor at gmail.com Sat Nov 6 06:59:14 2004 From: paranoiaspoisondoor at gmail.com (Keith Handy) Date: Sun Jan 21 12:10:30 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect In-Reply-To: <7BE3D282-2FD4-11D9-845A-000A95D019FC@johnnowak.com> References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead> <004901c4bd08$2b14d4b0$030200c0@australia> <007a01c4bd9a$88f30e20$030200c0@australia> <79a2ad4104110117132b36b0a3@mail.gmail.com> <05230867-2CB4-11D9-B3EA-000A958903DE@yahoo.co.uk> <001901c4c1a4$b4487020$1ae22641@antssoftware.com> <7BE3D282-2FD4-11D9-845A-000A95D019FC@johnnowak.com> Message-ID: <79a2ad4104110603597d8d5b19@mail.gmail.com> I really did not mean to open this can of worms with a dumb sig file. Please don't go down this road, people! Please! On Sat, 6 Nov 2004 04:16:04 -0500, John Nowak wrote: > It died, thank god. If there was ever a bunch of masturbatory nonsense > in the form of music, it would have to be the vast majority of > prog-rock (Yes style). > > - John > > > > On Nov 4, 2004, at 11:07 AM, Citizen Chunk wrote: > > > YESS! dude! that song is rocks! what ever happened to prog-rock? > > > > == chunk > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > -- I've seen all good people trim their hedge each day From joshscholar at yahoo.com Sat Nov 6 07:55:39 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:30 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead><004901c4bd08$2b14d4b0$030200c0@australia><007a01c4bd9a$88f30e20$030200c0@australia><79a2ad4104110117132b36b0a3@mail.gmail.com><05230867-2CB4-11D9-B3EA-000A958903DE@yahoo.co.uk><001901c4c1a4$b4487020$1ae22641@antssoftware.com><7BE3D282-2FD4-11D9-845A-000A95D019FC@johnnowak.com> <79a2ad4104110603597d8d5b19@mail.gmail.com> Message-ID: <006401c4c3ff$ec595210$79e22641@antssoftware.com> >From: Keith Handy >To: a list for musical digital signal processing >Sent: Saturday, November 06, 2004 3:59 AM >Subject: Re: [music-dsp] Coding attack and delay times for a compressor effect > > >I really did not mean to open this can of worms with a dumb sig file. >Please don't go down this road, people! Please! It's too late for that, but I really don't mind if you sit this one out. Your words but a whisper our deafness a SHOUT. Sorry. (heh) From doug_houghton at sympatico.ca Sat Nov 6 09:04:22 2004 From: doug_houghton at sympatico.ca (Doug) Date: Sun Jan 21 12:10:30 2007 Subject: [music-dsp] progrock - was Coding attack and delay times for a compressor effect References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead><004901c4bd08$2b14d4b0$030200c0@australia><007a01c4bd9a$88f30e20$030200c0@australia><79a2ad4104110117132b36b0a3@mail.gmail.com><05230867-2CB4-11D9-B3EA-000A958903DE@yahoo.co.uk><001901c4c1a4$b4487020$1ae22641@antssoftware.com><7BE3D282-2FD4-11D9-845A-000A95D019FC@johnnowak.com><79a2ad4104110603597d8d5b19@mail.gmail.com> <006401c4c3ff$ec595210$79e22641@antssoftware.com> Message-ID: <000501c4c409$8498e960$0201a8c0@elric> > > It's too late for that, but I really don't mind if you sit this one out. > Your words but a whisper our deafness a SHOUT. > > Sorry. (heh) > lol, sorry about the title, I couldn't resist Tull had some if the elements now and again, but I wouldn't call it progrock /"many's the day when I have done wrong" From paranoiaspoisondoor at gmail.com Sat Nov 6 11:26:43 2004 From: paranoiaspoisondoor at gmail.com (Keith Handy) Date: Sun Jan 21 12:10:30 2007 Subject: [music-dsp] progrock - was Coding attack and delay times for a compressor effect In-Reply-To: <000501c4c409$8498e960$0201a8c0@elric> References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead> <79a2ad4104110117132b36b0a3@mail.gmail.com> <05230867-2CB4-11D9-B3EA-000A958903DE@yahoo.co.uk> <001901c4c1a4$b4487020$1ae22641@antssoftware.com> <7BE3D282-2FD4-11D9-845A-000A95D019FC@johnnowak.com> <79a2ad4104110603597d8d5b19@mail.gmail.com> <006401c4c3ff$ec595210$79e22641@antssoftware.com> <000501c4c409$8498e960$0201a8c0@elric> Message-ID: <79a2ad4104110608266e173321@mail.gmail.com> Well, I will give the original anti-prog post credit for using the word "most" ... for me, anyway, progressive rock is something I strongly like the *idea* of (making rock into something creative, rather than just generic background music for blue collar workers), but its execution -- especially by the biggest name acts -- often came out aesthetically lopsided. Trick-heavy and missing the nail. I wouldn't go so far as to "thank god" for anything, though, in this day of window-ratting rapmobiles. On Sat, 6 Nov 2004 09:04:22 -0500, Doug wrote: > > > > It's too late for that, but I really don't mind if you sit this one out. > > Your words but a whisper our deafness a SHOUT. > > > > Sorry. (heh) > > > > lol, sorry about the title, I couldn't resist > > Tull had some if the elements now and again, but I wouldn't call it progrock > > /"many's the day when I have done wrong" > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > -- I've seen all good people trim their hedge each day From joshscholar at yahoo.com Sat Nov 6 12:11:53 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:30 2007 Subject: [music-dsp] progrock - was Coding attack and delay times for acompressor effect References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead><79a2ad4104110117132b36b0a3@mail.gmail.com><05230867-2CB4-11D9-B3EA-000A958903DE@yahoo.co.uk><001901c4c1a4$b4487020$1ae22641@antssoftware.com><7BE3D282-2FD4-11D9-845A-000A95D019FC@johnnowak.com><79a2ad4104110603597d8d5b19@mail.gmail.com><006401c4c3ff$ec595210$79e22641@antssoftware.com><000501c4c409$8498e960$0201a8c0@elric> <79a2ad4104110608266e173321@mail.gmail.com> Message-ID: <00e701c4c423$b78172b0$79e22641@antssoftware.com> Geeze you're all too high class for me. Prog rock not good enough? La de da.. Well I guess we all have our tastes. I'd have a hard time standing up for rap,hip hop. I used to hate country too, but I find I love Gillian Welch's new song "Elvis Presley Blues", her voice reminds me of Kate Wolf, one of the other country/folk singers I used to love if only for her voice. And you have to respect John Prine's strange wit. "Oh My stars! My Linda's gone to Mars" From paranoiaspoisondoor at gmail.com Sat Nov 6 13:05:20 2004 From: paranoiaspoisondoor at gmail.com (Keith Handy) Date: Sun Jan 21 12:10:30 2007 Subject: [music-dsp] progrock - was Coding attack and delay times for a compressor effect In-Reply-To: <79a2ad4104110608266e173321@mail.gmail.com> References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead> <79a2ad4104110117132b36b0a3@mail.gmail.com> <05230867-2CB4-11D9-B3EA-000A958903DE@yahoo.co.uk> <001901c4c1a4$b4487020$1ae22641@antssoftware.com> <7BE3D282-2FD4-11D9-845A-000A95D019FC@johnnowak.com> <79a2ad4104110603597d8d5b19@mail.gmail.com> <006401c4c3ff$ec595210$79e22641@antssoftware.com> <000501c4c409$8498e960$0201a8c0@elric> <79a2ad4104110608266e173321@mail.gmail.com> Message-ID: <79a2ad41041106100521e0f559@mail.gmail.com> BTW, that's "rattling" not "ratting". On Sat, 6 Nov 2004 11:26:43 -0500, Keith Handy wrote: > Well, I will give the original anti-prog post credit for using the > word "most" ... for me, anyway, progressive rock is something I > strongly like the *idea* of (making rock into something creative, > rather than just generic background music for blue collar workers), > but its execution -- especially by the biggest name acts -- often came > out aesthetically lopsided. Trick-heavy and missing the nail. I > wouldn't go so far as to "thank god" for anything, though, in this day > of window-ratting rapmobiles. > > > > > On Sat, 6 Nov 2004 09:04:22 -0500, Doug wrote: > > > > > > It's too late for that, but I really don't mind if you sit this one out. > > > Your words but a whisper our deafness a SHOUT. > > > > > > Sorry. (heh) > > > > > > > lol, sorry about the title, I couldn't resist > > > > Tull had some if the elements now and again, but I wouldn't call it progrock > > > > /"many's the day when I have done wrong" > > > > -- > > dupswapdrop -- the music-dsp mailing list and website: > > subscription info, FAQ, source code archive, list archive, book reviews, dsp links > > http://shoko.calarts.edu/musicdsp > > http://ceait.calarts.edu/mailman/listinfo/music-dsp > > > > > -- > I've seen all good people trim their hedge each day > -- I've seen all good people trim their hedge each day From postmaster at emotu.it Sun Nov 7 06:36:50 2004 From: postmaster at emotu.it (Carlo Chiari) Date: Sun Jan 21 12:10:30 2007 Subject: [music-dsp] I/O changes Message-ID: <418E08D2.1050301@emotu.it> I need to allow the user changing plug outputs settings almost as Voxengo Pristine space does. How could I do this? thanx regards Carlo From tonelli at anwida.com Sun Nov 7 09:32:23 2004 From: tonelli at anwida.com (Massimiliano Tonelli) Date: Sun Jan 21 12:10:30 2007 Subject: [music-dsp] I/O changes References: <418E08D2.1050301@emotu.it> Message-ID: <000601c4c4d6$99d6c090$0200a8c0@MASSI> Hi Carlo The suggested method is for the plug to call ioChanged () after setNumOutputs(); the host should issue a suspend/resume sequence then and update to the new value. To my experience this never worked too well, and it is very host dependent. It usually works in the constructor only. Best regards Massimiliano Tonelli From ansum at online.de Sun Nov 7 09:42:20 2004 From: ansum at online.de (Andreas Sumerauer) Date: Sun Jan 21 12:10:31 2007 Subject: SV: [music-dsp] Pitch Perception - with an inharmonic overtone spectrum In-Reply-To: <2525432.1099787164836.JavaMail.adm-moff@moffice6.nsc.no> References: <2525432.1099787164836.JavaMail.adm-moff@moffice6.nsc.no> Message-ID: <418E344C.9020602@online.de> Hi Risto, Thanks for answering. > As for pitch perception, there are some studies of mistuning one > single partial of a harmonic spectrum. As expected, this raises > the pitch, but only if the mistuning is small enough - otherwise this > partial is segregated and heard out as a separate tone. Yes, this is very much in line with my own observations. I would assume that the brain uses the harmonic pattern as a blue print for tonality as long as a deviation is relatively small, it can be compensated driving the percepted pitch in it's direction. only when it 'breaks the mold' so to speak it gets rejectd, which is heard as a dissonant tone. > What kind of spectra are you working with? Everything that can be composed of up to 16 modes. I know this is a relatively small number (drums can easily have hundereds of modes for example). However my computer won't calculate more in realtime. And I still like the results. :-) > (...) Unfortunately, this algorithm is far too simple to deal with > many types of inharmonic spectra, and so it often fails to detect > the perceived pitch. This is still an interesting approach. Since I have full control over where I place the resonant frequencies of my model, I won't have to do an analysis. I rather would want to implement the intonation correction as a part of the frequency calculation. i.e. while the user twiddles some knobs to spread or otherwise manipulate the spectrum the frequencies should be calculated in a way that the composite sound has a defined pitch (as long as when this is the desired result) > http://www.hibberts.co.uk/ Thanks for the link! This looks like a great ressource. I'll have to spend some time reading there. Andreas Risto Holopainen wrote: > Hello Andreas and the rest of you. I haven't posted to this list before, though I've been here for some time. I'm primarily a composer, but also interrested in synthesis and DSP things. > > As for pitch perception, there are some studies of mistuning one single partial of a harmonic spectrum. As expected, this raises the pitch, but only if the mistuning is small enough - otherwise this partial is segregated and heard out as a separate tone. > I don't know if anyone has come up with a formula for relating arbitrary inharmonic spectra to their perceived pitch yet, this tends to be a complicated matter. What kind of spectra are you working with? > However, I also thought about this problem a while ago, and tried to write a program to guess the pitch of a spectrum. The general idea is to multiply the spectrum with periodic functions such as (0.5cos(2pi f) + 0.5)^4 and integrating. As f goes from 20hz to about 4khz (the useful range of pitch perception), the maxima would indicate candidates for the perceived pitch. > Unfortunately, this algorithm is far too simple to deal with many types of inharmonic spectra, and so it often fails to detect the perceived pitch. > > Suggested reading: Albert S. Bregman's Auditory Scene Analysis. Doesn't provide an answer to your question, but may be useful. > Albrecht Schneider's Tonh?he - Skala - Klang may be something. I'm not fluent in german though, but it looks interresting. > There's also a resource on the tuning of church bells: > > I hope this helps. > Risto Holopainen > > > > > > > > > >>From: Andreas Sumerauer [ansum@online.de] >>Subject: [music-dsp] Pitch Perception - with an inharmonic overtone spectrum >> >>Hi everybody, >>I am currently experimenting with modal synthesis and found that the >>perceived pitch is very much dependent on the overtones. If the spectrum >>is spread just a little bit the perceived pitch of the sound will not be >>equal to the fundamental anymore. >>I am just wondering wether it is possible to predict the perceiced pitch >>when the (inharmonic) spectrum is known. are there any rules that allow >>to precisely estimate the pitch? >>This would help me to implement an automatic retuning when the spectrum >>changes. >>I would be greatful for any hints or literature on the topic. >> >>thanks >> >>Andreas Sumerauer > > From postmaster at emotu.it Sun Nov 7 10:02:20 2004 From: postmaster at emotu.it (Carlo Chiari) Date: Sun Jan 21 12:10:31 2007 Subject: [music-dsp] I/O changes In-Reply-To: <000601c4c4d6$99d6c090$0200a8c0@MASSI> References: <418E08D2.1050301@emotu.it> <000601c4c4d6$99d6c090$0200a8c0@MASSI> Message-ID: <418E38FC.7070204@emotu.it> Massimiliano Tonelli wrote: > Hi Carlo > > The suggested method is for the plug to call ioChanged () after > setNumOutputs(); the host should issue a suspend/resume sequence then > and update to the new value. To my experience this never worked too > well, and it is very host dependent. It usually works in the > constructor only. > > Best regards > Massimiliano Tonelli > -- > dupswapdrop -- the music-dsp mailing list and website: subscription > info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > > Hi Massimiliano, so the host should tell me to close the plug and then reload it? After I'll se the new outputs configuration? regards Carlo From lee at hawaii.edu Sun Nov 7 23:28:56 2004 From: lee at hawaii.edu (lee) Date: Sun Jan 21 12:10:31 2007 Subject: [music-dsp] scaling tweaked Butterworth lp filter Message-ID: <418EF608.2050106@hawaii.edu> I'm using the Butterworth algorithm from Patrice Terrabian as modified by Daniel Jacob Werner for a Soundfont lp filter, found at musicdsp.org. For which, thanks. It works well. However, it doesn't work well if I scale the output, following Werner's recommendation: "It can be made suitable to use as a SoundFont 2.0 filter by scaling the output so the overall gain matches the specification (i.e. if resonance is 6dB then you should scale the output by -3dB)." Just judging by how it sounds when playing midi files that use the brightness and harmonic content controllers, the notes just fade away when I scale the output, but sound fine when I don't. So maybe the output shouldn't be scaled. Greg From gene at ashly.com Mon Nov 8 08:30:59 2004 From: gene at ashly.com (Gene Goff) Date: Sun Jan 21 12:10:31 2007 Subject: [music-dsp] Dynamic time delays from single unified memory Message-ID: <002501c4c597$2f0c3800$b301a8c0@gene2> Hello, Any suggestions on how to change an audio time delay (say by increasing or decreasing the delay time by one sample for each successive sample) without disturbing a bunch of other audio time delays all in one unified block of memory? I've tried expanding one time delay and bumping-up the other delays above it in memory by copying each delay's last sample to the next address in memory. It works but I can always hear anomalies in all the other audio delays when changing a single given delay. Thanks, Gene From martin.eisenberg at udo.edu Mon Nov 8 12:28:06 2004 From: martin.eisenberg at udo.edu (Martin Eisenberg) Date: Sun Jan 21 12:10:31 2007 Subject: [music-dsp] Dynamic time delays from single unified memory References: <002501c4c597$2f0c3800$b301a8c0@gene2> Message-ID: <002501c4c5b8$5f96f700$1e0d060a@mooncode> From: "Gene Goff" > Any suggestions on how to change an audio time delay (say by > increasing or decreasing the delay time by one sample for each > successive sample) without disturbing a bunch of other audio > time delays all in one unified block of memory? Imagine a tape steadily passing by a sequence of read heads, each of which is independently movable. In software, the "tape" is a single delay line of the greatest length you'll need. A "head" is positioned by a fractional-sample offset from the write pointer. It uses samples around that notional buffer position to do an interpolated read. http://www.google.com/search?q=fractional+delay gives some nice hits. Martin From peter at sonicreef.com Tue Nov 9 20:05:42 2004 From: peter at sonicreef.com (Peter Thom) Date: Sun Jan 21 12:10:31 2007 Subject: [music-dsp] DA converter from vintage samplers In-Reply-To: <002501c4c597$2f0c3800$b301a8c0@gene2> Message-ID: <1100048730.26428@mx250c.mysite4now.com> When I load a sawtooth wave (with a perfectly steady slope) into some of the old 8 or 12 bit samplers, the wave it actually outputs, has a very curvy sawtooth. Can anyone explain to me, why that is, and how I could simulate this behavior in dsp? Peter From leechun at leechun.freeserve.co.uk Tue Nov 9 20:08:13 2004 From: leechun at leechun.freeserve.co.uk (chun lee) Date: Sun Jan 21 12:10:31 2007 Subject: [music-dsp] Detecting phase cycle with Hoeldrich method....... Message-ID: Hi there: Just joint the list, big HI to everyone:) ok, my first question is this. I am trying to write a code that generate saw-tooth waves at random frequency for each phase cycle. So, basically whenever the phase reaches 1, a random frequency value is generated for the next phase cycle. I got a piece of code for a saw-tooth oscillator and I would like to use it and modify it to my need. Now, here is the problem, this code uses the Hoeldrich method to generate the saw-tooth. So, how would I detect the end of each phase cycle? I have thought about the following: 1. using a if statement in the dsp_perfrom() or even inside the dsp loop to test the value of phase to see if its over 1 (not sure about the detail yet as the upper 32 bits of the phase variable is a constant in Hoeldrich method). 2. using timing/delay, when a new frequency value is generated, work out the time it will take to complete one cycle and set a delay accordingly to generate the next value. But somehow I feel this might be less accurate. Can anyone offer any advice and suggestion? I am sure there is a simple way out there in triggering certain action at the end of each phase cycle. Many thanks Chun From x at meta.lo-res.org Tue Nov 9 20:30:54 2004 From: x at meta.lo-res.org (CK) Date: Sun Jan 21 12:10:31 2007 Subject: [music-dsp] DA converter from vintage samplers In-Reply-To: <1100048730.26428@mx250c.mysite4now.com> from "Peter Thom" at Nov 09, 2004 05:05:42 PM Message-ID: <200411100130.iAA1UthC088020@meta.lo-res.org> I read: > When I load a sawtooth wave (with a perfectly steady slope) into some of the > old 8 or 12 bit samplers, the wave it actually outputs, has a very curvy > sawtooth. Can anyone explain to me, why that is, I guess the filters in/after the dac stage of the equipment. > and how I could simulate quantise the signal to 8 or 12 bits, experiment with high- and lowpassfilters to get the desired effect. HTH x -- chris@lo-res.org Postmodernism is german romanticism with better http://pilot.fm/ special effects. (Jeff Keuss / via ctheory.com) From dougalli at gmail.com Wed Nov 10 01:40:29 2004 From: dougalli at gmail.com (dougall) Date: Sun Jan 21 12:10:31 2007 Subject: [music-dsp] Detecting phase cycle with Hoeldrich method....... In-Reply-To: References: Message-ID: <3fdba47604110922401e54e5da@mail.gmail.com> > Just joint the list, big HI to everyone:) Hi > I got a piece of code for a saw-tooth oscillator and I would like to use it > and modify it to my need. Now, here is the problem, this code uses the > Hoeldrich method to generate the saw-tooth. So, how would I detect the end > of each phase cycle? I'm not familiar with the Hoeldrich method. Perhaps you could post the code to the list. From leechun at leechun.freeserve.co.uk Wed Nov 10 05:42:59 2004 From: leechun at leechun.freeserve.co.uk (chun lee) Date: Sun Jan 21 12:10:31 2007 Subject: [music-dsp] Detecting phase cycle with Hoeldrich method....... Message-ID: Hi there: >> Just joint the list, big HI to everyone:) >Hi > >> I got a piece of code for a saw-tooth oscillator and I would like to use it >> and modify it to my need. Now, here is the problem, this code uses the >> Hoeldrich method to generate the saw-tooth. So, how would I detect the end >> of each phase cycle? > >I'm not familiar with the Hoeldrich method. Perhaps you could post >the code to the list. Here is the code for it, thanks: #define UNITBIT32 1572864. /* 3*2^19; bit 32 has place value 1 */ #ifdef __linux__ #include #if !defined(__BYTE_ORDER) || !defined(__LITTLE_ENDIAN) #error No byte order defined #endif #if __BYTE_ORDER == __LITTLE_ENDIAN #define HIOFFSET 1 #define LOWOFFSET 0 #else #define HIOFFSET 0 /* word offset to find MSB */ #define LOWOFFSET 1 /* word offset to find LSB */ #endif /* __BYTE_ORDER */ #include #define int32 int32_t #else #ifdef MACOSX #define HIOFFSET 0 /* word offset to find MSB */ #define LOWOFFSET 1 /* word offset to find LSB */ #define int32 int /* a data type that has 32 bits */ #endif /* MACOSX */ #endif /* __linux__ */ union tabfudge { double tf_d; int32 tf_i[2]; }; /* -------------------------- phasor~ ------------------------------ */ static t_class *phasor_class, *scalarphasor_class; #if 1 /* in the style of R. Hoeldrich (ICMC 1995 Banff) */ typedef struct _phasor { t_object x_obj; double x_phase; float x_conv; float x_f; /* scalar frequency */ } t_phasor; . . . static t_int *phasor_perform(t_int *w) { t_phasor *x = (t_phasor *)(w[1]); t_float *in = (t_float *)(w[2]); t_float *out = (t_float *)(w[3]); int n = (int)(w[4]); double dphase = x->x_phase + UNITBIT32; union tabfudge tf; int normhipart; float conv = x->x_conv; tf.tf_d = UNITBIT32; normhipart = tf.tf_i[HIOFFSET]; tf.tf_d = dphase; while (n--) { tf.tf_i[HIOFFSET] = normhipart; dphase += *in++ * conv; *out++ = tf.tf_d - UNITBIT32; tf.tf_d = dphase; } tf.tf_i[HIOFFSET] = normhipart; x->x_phase = tf.tf_d - UNITBIT32; return (w+5); } #endif /* Hoeldrich version */ From gogins at pipeline.com Wed Nov 10 10:49:01 2004 From: gogins at pipeline.com (gogins@pipeline.com) Date: Sun Jan 21 12:10:31 2007 Subject: [music-dsp] NYCSUG Meeting Monday November 15 Message-ID: <280050-220041131015491282@M2W026.mail2web.com> Apologies for cross-posting, but I thought some on this list might be interested in the New York Csound Users' Group meeting coming up this Monday, November 15th, at 6:30 PM, at my house: Michael Gogins 150 West 95th Street Apartment 4-D New York NY 10025 The agenda includes listening to Csound pieces by attendees, discussing Csound compositional approaches, and discussing computer music in general. Please email me at gogins at pipeline dot com if you plan to attend. -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web.com/ . From postmaster at emotu.it Wed Nov 10 14:45:59 2004 From: postmaster at emotu.it (Carlo Chiari) Date: Sun Jan 21 12:10:31 2007 Subject: [music-dsp] I/O changes In-Reply-To: <000601c4c4d6$99d6c090$0200a8c0@MASSI> References: <418E08D2.1050301@emotu.it> <000601c4c4d6$99d6c090$0200a8c0@MASSI> Message-ID: <41926FF7.2010401@emotu.it> Massimiliano Tonelli wrote: > Hi Carlo > > The suggested method is for the plug to call ioChanged () after > setNumOutputs(); the host should issue a suspend/resume sequence then > and update to the new value. To my experience this never worked too > well, and it is very host dependent. It usually works in the > constructor only. > > Best regards > Massimiliano Tonelli > -- > dupswapdrop -- the music-dsp mailing list and website: subscription > info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > > It seems that Audio Mulch doesn't support ioChanges(). What about setSpeakerArrangement? hi From bobm.dsp at gmail.com Wed Nov 10 16:55:11 2004 From: bobm.dsp at gmail.com (Bob M) Date: Sun Jan 21 12:10:31 2007 Subject: [music-dsp] DA converter from vintage samplers In-Reply-To: <1100048730.26428@mx250c.mysite4now.com> References: <002501c4c597$2f0c3800$b301a8c0@gene2> <1100048730.26428@mx250c.mysite4now.com> Message-ID: Sounds to me like it is being low-pass filtered. As a starting point, I'd suggest looking at the output with some kind of spectrum analyzer (for example, record to WAV and use Cool Edit's FFT). This should show you where the cutoff point is. If you're looking to generate this kind of band-limited sawtooth, you can do this by generating only the first few harmonics of a sawtooth wave. The fewer harmonics you generate, the "curvier" it will be. The more (higher) harmonics you generate, the sharper it will be. For example, an ideal (very sharp) sawtooth wave has the following time and frequency domain graphs: http://www.csounds.com/ezine/spectra/table/waveform/stideal.html http://www.csounds.com/ezine/spectra/table/spectrum/stideal.html Note the frequency domain view and the harmonics that extend to a very high range. But if we low-pass filter and cutoff the higher harmonics, the "curvy" sawtooth wave is the result: http://www.csounds.com/ezine/spectra/table/waveform/stbl.html http://www.csounds.com/ezine/spectra/table/spectrum/stbl.html These graphs were all taken from the following site, which has an excellent section on waveforms if you scroll down to the section called "Classic waveshapes and their spectra." http://www.csounds.com/ezine/spectra/ So, simulating this in DSP is going to be an exercise in band-limited wave generation. While I've never taken this on personally, I can think of two methods to do this: 1. Use sin() function in C to generate each harmonic. This is simple to code, but computationally expensive: (1.0 * sin(2*pi*f*n)) + (0.5 * sin(2*pi*(2*f)*n)) + ... 2. Generate only the fundamental harmonic with sin() and generate the higher harmonics from that one by using chebyshev polynomials. In either case, you'd only want to generate the first 9 or so harmonics in order to retain the "wavy" shape you're looking for. Any other suggestions for generating band-limited waveforms from others here? Bob > When I load a sawtooth wave (with a perfectly steady slope) into some of the > old 8 or 12 bit samplers, the wave it actually outputs, has a very curvy > sawtooth. Can anyone explain to me, why that is, and how I could simulate > this behavior in dsp? From dfl at alum.mit.edu Wed Nov 10 16:56:52 2004 From: dfl at alum.mit.edu (David Lowenfels) Date: Sun Jan 21 12:10:31 2007 Subject: [music-dsp] Detecting phase cycle with Hoeldrich method....... In-Reply-To: <20041110064042.BB1DC17038D7@music.calarts.edu> References: <20041110064042.BB1DC17038D7@music.calarts.edu> Message-ID: <6DDFAE3D-3363-11D9-ACD5-000A957CD8B8@alum.mit.edu> Hi Chun Lee: I assume you are referring to the code from PD? I never really understood it, as it's kind of voodoo. I guess it is using overflow for the phase wrap-around? I emailed Miller Puckette once but he never gave me a good response. And the paper reference in the code is incorrect or was anecdotal. Are you able to explain it to us? Or can someone else explain it for the benefit of this list? ( Urs Heckmann are you out there? ) Here's a link from google: http://www.mit.edu/afs/sipb/project/sandbox/fustflum/src/pd-0.36- extended2/src/d_osc.c If I understand correctly, the reason to rely on integer overflow is to avoid branching with an if statement. This will avoid pipeline stalls in the process inner loop. My guess is that you can't have your cake and eat it too. Either you use a conditional to extract the phase wrapping event, or you use this "Hoeldrich" method. However if you find a way to "eat the cake", please let me know! :) I like to use the phase wrap so I can do "hard sync", but it requires branching as far as I have discovered. Is it really critical that you have blazing fast code for this application? Perhaps you should work on a version with the behavior that you desire before you move on with optimization. My suggestion is to just use a traditional phase accumulator, and during your phase wrap branch, change the phase increment to a random value. -David On Nov 9, 2004, at 10:40 PM, music-dsp-request@shoko.calarts.edu wrote: > > Message: 9 > Date: Wed, 10 Nov 2004 01:08:13 +0000 > From: chun lee > Subject: [music-dsp] Detecting phase cycle with Hoeldrich > method....... > To: > Message-ID: > Content-Type: text/plain; charset="US-ASCII" > > Hi there: > > Just joint the list, big HI to everyone:) > > ok, my first question is this. I am trying to write a code that > generate > saw-tooth waves at random frequency for each phase cycle. So, basically > whenever the phase reaches 1, a random frequency value is generated > for the > next phase cycle. > > I got a piece of code for a saw-tooth oscillator and I would like to > use it > and modify it to my need. Now, here is the problem, this code uses the > Hoeldrich method to generate the saw-tooth. So, how would I detect the > end > of each phase cycle? > > I have thought about the following: > > 1. using a if statement in the dsp_perfrom() or even inside the dsp > loop to > test the value of phase to see if its over 1 (not sure about the > detail yet > as the upper 32 bits of the phase variable is a constant in Hoeldrich > method). > > 2. using timing/delay, when a new frequency value is generated, work > out the > time it will take to complete one cycle and set a delay accordingly to > generate the next value. But somehow I feel this might be less > accurate. > > > Can anyone offer any advice and suggestion? I am sure there is a > simple way > out there in triggering certain action at the end of each phase cycle. > > Many thanks From dfl at alum.mit.edu Wed Nov 10 16:40:52 2004 From: dfl at alum.mit.edu (David Lowenfels) Date: Sun Jan 21 12:10:31 2007 Subject: SV: [music-dsp] Pitch Perception - with an inharmonic overtone spectrum In-Reply-To: <20041110064042.BB1DC17038D7@music.calarts.edu> References: <20041110064042.BB1DC17038D7@music.calarts.edu> Message-ID: <31DB4411-3361-11D9-ACD5-000A957CD8B8@alum.mit.edu> Hi Andreas: Here's an idea.. convolve your spectrum with a hanning window or some similar pulse, and then calculate the maximum of the Harmonic Product Spectrum. ( http://cnx.rice.edu/content/m11714/latest/ ) I think the result would be a good perceptual model to match your observations. Changing the width of the window/pulse will affect how far the dissonant harmonic can go before it becomes a separate perceptual entity, rather than effecting the perceived pitch. You can tune this width to match your perception. Best, David On Nov 9, 2004, at 10:40 PM, music-dsp-request@shoko.calarts.edu wrote: > > Message: 3 > Date: Sun, 07 Nov 2004 15:42:20 +0100 > From: Andreas Sumerauer > Subject: Re: SV: [music-dsp] Pitch Perception - with an inharmonic > overtone spectrum > To: a list for musical digital signal processing > > Message-ID: <418E344C.9020602@online.de> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Hi Risto, > Thanks for answering. > >> As for pitch perception, there are some studies of mistuning one >> single partial of a harmonic spectrum. As expected, this raises >> the pitch, but only if the mistuning is small enough - otherwise this >> partial is segregated and heard out as a separate tone. > > Yes, this is very much in line with my own observations. I would assume > that the brain uses the harmonic pattern as a blue print for tonality > as > long as a deviation is relatively small, it can be compensated driving > the percepted pitch in it's direction. only when it 'breaks the mold' > so > to speak it gets rejectd, which is heard as a dissonant tone. From dfl at alum.mit.edu Wed Nov 10 17:22:00 2004 From: dfl at alum.mit.edu (David Lowenfels) Date: Sun Jan 21 12:10:31 2007 Subject: [music-dsp] Hoeldrich method Message-ID: I haven't searched the music-dsp list archives for this yet, but I found a thread here: http://eca.cx/lad/2000/Sep/0188.html *** Pasted contents follow *** i recommend the glib.h version 1.3 for a great dissection; i'll cut and paste for your convenience: /* IEEE Standard 754 Single Precision Storage Format (gfloat): ?* ?* 31 30 23 22 0 ?* +--------+---------------+---------------+ ?* | s 1bit | e[30:23] 8bit | f[22:0] 23bit | ?* +--------+---------------+---------------+ ?* B0------------------->B1------->B2-->B3--> ?* ?* IEEE Standard 754 Double Precision Storage Format (gdouble): ?* ?* 63 62 52 51 32 31 0 ?* +--------+----------------+----------------+ +---------------+ ?* | s 1bit | e[62:52] 11bit | f[51:32] 20bit | | f[31:0] 32bit | ?* +--------+----------------+----------------+ +---------------+ ?* B0--------------->B1---------->B2--->B3----> B4->B5->B6->B7-> ?*/ /* subtract from biased_exponent to form base2 exponent (normal numbers) */ #define G_IEEE754_FLOAT_BIAS (127) #define G_IEEE754_DOUBLE_BIAS (1023) /* multiply with base2 exponent to get base10 exponent (nomal numbers) */ #define G_LOG_2_BASE_10 (0.30102999566398119521) #if G_BYTE_ORDER == G_LITTLE_ENDIAN union _GFloatIEEE754 { ??gfloat v_float; ??struct { ????guint mantissa : 23; ????guint biased_exponent : 8; ????guint sign : 1; ??} mpn; }; union _GDoubleIEEE754 { ??gdouble v_double; ??struct { ????guint mantissa_low : 32; ????guint mantissa_high : 20; ????guint biased_exponent : 11; ????guint sign : 1; ??} mpn; }; On Tue, 19 Sep 2000, Miller Puckette wrote: > Hi Benno, > > The technique was first written down by Robert Hoeldrich, in the 1995 ICMC > proceedings (Banff), but was folk knowledge much earlier. > > In the Pd oscillator, look for osc_perform(). It's ugly all right; the > second version of the inner loop is an unwrapped version of the first one > (hand unwrapping sped the thing up some.) > > The heart of the thing is the "union tabfudge" which is accesses as a > double (64 bits) and as a pair of "longs" (32 bits each.) YOu accumulate > into the "double" and then pull bits out of the "longs". To get the > fractional part back into floating point, bash the upper 32 bits to > a known value and subtract a constant. > > I can be more verbose if needed but perhaps I should do so privately... > > cheers > Miller > > On Tue, Sep 19, 2000 at 11:48:40PM +0200, Benno Senoner wrote: > > Hi Miller, > > > > On Tue, 19 Sep 2000, Miller Puckette wrote: > > > Hi all, > > > > > > You can do the trick in double precision and get at least 40 bits of > > > real precision. I usually use the bottom 32 bits for the fractional > > > part and some of the top 20 bits for the integer part; this would have > > > to be adjusted for huge "wavetables" though. > > > > Since I stream from disk, (thus from buffers), I have to adjust the pos (double) > > ponter when it gets bigger than the buffersize. > > So in theory 20bits would be enough. > > From jchandjr at bellsouth.net Wed Nov 10 17:31:20 2004 From: jchandjr at bellsouth.net (James Chandler Jr) Date: Sun Jan 21 12:10:31 2007 Subject: [music-dsp] DA converter from vintage samplers References: <002501c4c597$2f0c3800$b301a8c0@gene2><1100048730.26428@mx250c.mysite4now.com> Message-ID: <0a8901c4c775$026549b0$6401a8c0@JamesCompaq3080> > When I load a sawtooth wave (with a perfectly steady slope) into some of the > old 8 or 12 bit samplers, the wave it actually outputs, has a very curvy > sawtooth. Can anyone explain to me, why that is, and how I could simulate > this behavior in dsp? Any filtering will make a perfectly straight sawtooth look curvy-- LoPass, BandPass, HiPass, AllPass, or Notch. Many older samplers had fairly small DC-blocking capacitors. In that case, any fairly low notes would be curvey from the DC-blocking HiPass. Similarly, fairly high notes would be curvey from the action of the output anti-alias LoPass filter, even if the synth Time-Variant LoPass Filter is wide open (and the TVF is rarely wide open in practical patches). On some synths, setting the TVF 'wide open' doesn't necessarily open it all the way up to 20 KHz. To confuse the issue even more-- There are ramp waves in some older synths, where the phase of the harmonics seems to have been purposely manipulated. Perhaps this was to improve the sound of a crude hardware pitch-shifting technique? Dunno. If you take a Ramp wave, maintain the amplitude of all harmonics, but scramble the phase of the harmonics-- In most cases it still sounds like a Ramp wave, but it no longer resembles a Ramp wave. I accept that some Golden Ears are talented enough to hear scrambled phase, and can even hear if a wave is polarity-flipped. But other than certain Golden Ears, a scrambled-phase Ramp will sound like a Ramp. ===== For emulation, I'm guessing if your synth has a HiPass first-order 'dc block' filter with a fixed Fc somewhere between 20 and 40 Hz, and a time-variant LoPass filter set appropriate for a practical musical Ramp patch, the Ramp will have no choice but to look curvey in your emulation. But perhaps you may have to do something special if you need it 'even more curvey' (GRIN). JCJR From paranoiaspoisondoor at gmail.com Wed Nov 10 18:25:06 2004 From: paranoiaspoisondoor at gmail.com (Keith Handy) Date: Sun Jan 21 12:10:31 2007 Subject: [music-dsp] DA converter from vintage samplers In-Reply-To: <0a8901c4c775$026549b0$6401a8c0@JamesCompaq3080> References: <002501c4c597$2f0c3800$b301a8c0@gene2> <1100048730.26428@mx250c.mysite4now.com> <0a8901c4c775$026549b0$6401a8c0@JamesCompaq3080> Message-ID: <79a2ad41041110152572675bd3@mail.gmail.com> On Wed, 10 Nov 2004 17:31:20 -0500, James Chandler Jr wrote: > If you take a Ramp wave, maintain the amplitude of all harmonics, but scramble > the phase of the harmonics-- In most cases it still sounds like a Ramp wave, but > it no longer resembles a Ramp wave. I accept that some Golden Ears are talented > enough to hear scrambled phase, and can even hear if a wave is polarity-flipped. > But other than certain Golden Ears, a scrambled-phase Ramp will sound like a > Ramp. I'm curious what it would look like. You could do this with square- and other-shaped waves too, I'd imagine? Any benefits to doing this on purpose? -Keith From paranoiaspoisondoor at gmail.com Wed Nov 10 18:25:06 2004 From: paranoiaspoisondoor at gmail.com (Keith Handy) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] DA converter from vintage samplers In-Reply-To: <0a8901c4c775$026549b0$6401a8c0@JamesCompaq3080> References: <002501c4c597$2f0c3800$b301a8c0@gene2> <1100048730.26428@mx250c.mysite4now.com> <0a8901c4c775$026549b0$6401a8c0@JamesCompaq3080> Message-ID: <79a2ad41041110152572675bd3@mail.gmail.com> On Wed, 10 Nov 2004 17:31:20 -0500, James Chandler Jr wrote: > If you take a Ramp wave, maintain the amplitude of all harmonics, but scramble > the phase of the harmonics-- In most cases it still sounds like a Ramp wave, but > it no longer resembles a Ramp wave. I accept that some Golden Ears are talented > enough to hear scrambled phase, and can even hear if a wave is polarity-flipped. > But other than certain Golden Ears, a scrambled-phase Ramp will sound like a > Ramp. I'm curious what it would look like. You could do this with square- and other-shaped waves too, I'd imagine? Any benefits to doing this on purpose? -Keith From mcartwright at gmail.com Wed Nov 10 18:52:53 2004 From: mcartwright at gmail.com (Mark Cartwright) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] filters to prevent aliasing Message-ID: hi all, ok, so in something I'm working on, I'm increasing the playback rate of some buffered audio, and I want to avoid aliasing. Soo... I figure that I need to filter the buffer before playback at nyquist / playback rate. Is this the right approach? If so, what is the best way to filter it? I figure in order to keep as much frequency content as possible I need to use a sharp filter. Do I need to use an expensive 4-pole allpass? Is there a cheap brickwall filter? Or should I be avoiding these extreme filters due to their detrimental phase consequences, and instead just put a low order filter at an even lower cutoff than Nyquist / playbackRate, sacrificing some frequency content? Sorry for the novice questions, thanks in advance for you help. mark From leechun at leechun.freeserve.co.uk Wed Nov 10 19:53:43 2004 From: leechun at leechun.freeserve.co.uk (chun lee) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] Re: Detecting phase cycle with Hoeldrich method....... Message-ID: Hi dave: Thanks for your reply. This message is a bit long, you have been warned;) > I assume you are referring to the code from PD? I never really >understood it, as it's kind of voodoo. I guess it is using overflow for >the phase wrap-around? I emailed Miller Puckette once but he never gave >me a good response. And the paper reference in the code is incorrect or >was anecdotal. Are you able to explain it to us? Or can someone else >explain it for the benefit of this list? ( Urs Heckmann are you out >there? ) Yes, its Pd code:) what do you mean the reference in the code is incorrect? Ya, it took me a while to figure out how it works, plus reading on the LAD thread you also pointed to. I can quickly describe how I understood it. Please do point out any thing if I am wrong. 1-> a double variable UNITBIT32 is assigned to 1572864. And here is what it looks like in memory in a little endian machine. The reason for 1572864. Is that (I think) it takes up the space of byte 0 to 3 and the therefore byte 4 to 7 are used as fraction . Well, bit 32 has the place value of 1, I am not too clear on this yet. byte 7 byte 6 byte 5 byte 4 byte 3 byte 2 byte 1 byte 0 00000000 00000000 00000000 00000000 00000000 00000000 00111000 01000001 | fraction || 1572864 ||expo + sign| 2-> there is the tabfudge like: Union tabfudge { double tf_d; int32 tf_I[2]; } In dsp_perfrom: Union tabfudge tf; tf.tf_d = UNITBIT32; 3-> the phase is accumulated into tf_d plus the UNITBIT32 Double dphase = x_phase + UNITBIT32; 4-> byte 0 to byte 3 is stored as a separate variable as: int normhipart = tf.tf_I[HIOFFSET]; //where HIOFFSET is used to find MSB 5-> in the actually dsp block, although the phase is accumulated into tf.tf_d, the byte 0 to byte 3 of tf.tf_d are constantly forced to be a constant by: tf.tf_i[HIOFFSET] = normhipart; 6-> because of this, to get the fraction part out of the tf.tf_d, simply do: tf.tf_d - UNITBIT32; 7-> mission accomplished!!!!! Hoping I am making sense. Anyway, yes I can't have my cake and eat it too. Can't have both ways... My latest solution (not been coded yet) is to work out the last value before the phase wraps around by doing something like: Last_value = 1 - (44100/freq) * (1./44100) And the if might look like this: If(phase = last_value) do_something(); Since I only want one cycle of each freq, I think this will work. Ok, this is a bit long. Peace CHUN From jchandjr at bellsouth.net Wed Nov 10 20:03:21 2004 From: jchandjr at bellsouth.net (James Chandler Jr) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] DA converter from vintage samplers References: <002501c4c597$2f0c3800$b301a8c0@gene2><1100048730.26428@mx250c.mysite4now.com><0a8901c4c775$026549b0$6401a8c0@JamesCompaq3080> <79a2ad41041110152572675bd3@mail.gmail.com> Message-ID: <0b0b01c4c78a$3ed97730$6401a8c0@JamesCompaq3080> On Wed, 10 Nov 2004 17:31:20 -0500, James Chandler Jr > wrote: > >> If you take a Ramp wave, maintain the amplitude of all harmonics, but >> scramble >> the phase of the harmonics-- In most cases it still sounds like a Ramp wave, >> but >> it no longer resembles a Ramp wave. I accept that some Golden Ears are >> talented >> enough to hear scrambled phase, and can even hear if a wave is >> polarity-flipped. >> But other than certain Golden Ears, a scrambled-phase Ramp will sound like a >> Ramp. > > I'm curious what it would look like. You could do this with square- > and other-shaped waves too, I'd imagine? Any benefits to doing this > on purpose? Hi Keith Scrambling the harmonics' phases of square waves or other simple geometric waveshapes, make waves that don't look as simple or as geometric. But they sound about the same to most folk. A few years ago there was a music-dsp discussion about why some old ROM samples might have been 'scrambled'. Maybe just an unintentional result of sample pre-processing? Some folks would habitually sweeten samples with phase-mangling enhancers like the BBE. It was suggested that it may have been done to reduce the crest factor. Am not good at math, but I experimented by feeding geometric waves thru a series of all-pass filters. The crest factor seems to get bigger when you un-align the harmonics' phases. Perhaps a simple geometric wave is the minimum crest factor for that particular mix of harmonic amplitudes? Dunno. Geometric waves have large sudden transitions. If the harmonics can be re-aligned to reduce the magnitude of sudden value transitions, perhaps old crude drop-add sample transpose engines do not sound quite so awful? I haven't a clue! On modern synths, can't think of sane reasons to do it 'on purpose'. Here are some un-sane possibilities... * If a synth is designed to hard-sync-reset slave oscillators when the master oscillator crosses a threshold-- The hard sync might be 'interesting' if there are multiple threshold crossings per master oscillator wave cycle? * If doing Pulse Width Modulation by comparing the oscillator ramp wave to an envelope generator level-- If the ramp wave is scrambled so that it looks real odd, the PWM output would probably also sound odd? * If using a geometric wave LFO for vibrato (typically a triangle wave, though all the shapes are useful)-- If the wave shape is more complex, then the vibrato would sound more complex. Hmmm, that one might actually be worth trying out! Just tack on some low-tuned allpass filters to the LFO output! JCJR From joost at greenskin.net Wed Nov 10 20:17:29 2004 From: joost at greenskin.net (Joost Schuttelaar) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] 4,3 Hermite interpolator, math question Message-ID: <4192BDA9.1050503@greenskin.net> Hi everybody, I'm reading a paper on resampling [1] where right in the beginning a formula is given for a 4,3 Hermite interpolator. My math knowledge is pretty bad, and I was wondering if anyone can explain to me what the k and x variables are: [ 0, 2, 0, 0] [x k-1] [-1, 0, 1, 0] [x k ] f(t + k) = [1, t, t^2, t^3] * 1/2 * [ 2, -5, 4, -1] * [x k+1] [-1, 3, -3, 1] [x K+2] Reading [1] I understand that t is the input sample, but what is k? [1] The Quest For The Perfect Resampler by Laurent de Soras [2] http://www.cubic.org/~submissive/sourcerer/hermite.htm Thanks! And excuse my ignorance :) -- Joost Schuttelaar From musicdsp at lysse.co.uk Wed Nov 10 20:44:10 2004 From: musicdsp at lysse.co.uk (Lysse) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] DA converter from vintage samplers Message-ID: <200411110144.iAB1iAc32167@www.123-reg.co.uk> James Chandler jr wrote: > Geometric waves have large sudden transitions. If the harmonics can be > re-aligned to reduce the magnitude of sudden value transitions, perhaps old > crude drop-add sample transpose engines do not sound quite so awful? I haven't a > clue! Well, an Emax (12-bit samples stored as 8-bit deltas) would have benefitted from that, for one thing... From musicdsp at lysse.co.uk Wed Nov 10 20:59:04 2004 From: musicdsp at lysse.co.uk (Lysse) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] 4,3 Hermite interpolator, math question Message-ID: <200411110159.iAB1x4701027@www.123-reg.co.uk> Joost wrote: > I'm reading a paper on resampling [1] where right in the beginning a > formula is given for a 4,3 Hermite interpolator. My math knowledge is > pretty bad, and I was wondering if anyone can explain to me what the k > and x variables are: > > [ 0, 2, 0, 0] [x k-1] > [-1, 0, 1, 0] [x k ] > f(t + k) = [1, t, t^2, t^3] * 1/2 * [ 2, -5, 4, -1] * [x k+1] > [-1, 3, -3, 1] [x K+2] > > Reading [1] I understand that t is the input sample, but what is k? > > [1] The Quest For The Perfect Resampler by Laurent de Soras > [2] http://www.cubic.org/~submissive/sourcerer/hermite.htm > > Thanks! And excuse my ignorance :) As far as I can tell from looking at this... If you have a phase accumulator oscillator, with phase in P, k is the integer part of P and t is the fractional part. x is the array of input samples. No interpolation at all would be f(t+k) = x[k] and linear interpolation is f(t+k) = t*x[k] + (1-t)*x[k+1] Consequently, the multiply by the matrix gives a set of 4 cubic functions of t, which form coefficients for the 4 consecutive input samples; the final output sample ends up being made up of different proportions of those 4 input samples, and (hopefully) as close to the actual curve of the waveform as you can get by fitting a cubic curve to it. Does that makes things any clearer? From musicdsp at lysse.co.uk Wed Nov 10 21:05:46 2004 From: musicdsp at lysse.co.uk (Lysse) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] DA converter from vintage samplers Message-ID: <200411110205.iAB25kU04658@www.123-reg.co.uk> Peter Thom wrote: > When I load a sawtooth wave (with a perfectly steady slope) into some of the > old 8 or 12 bit samplers, the wave it actually outputs, has a very curvy > sawtooth. Can anyone explain to me, why that is, and how I could simulate > this behavior in dsp? Lots of people have already suggested that it's being filtered or otherwise distorted by the sampling process; but I do have one other suggestion. A few old, particularly 8-bit, samplers used a companding process on samples to improve the dynamic range - or used logarithmic sampling for much the same reason. Could the distortion you're seeing be an artefact of that process? Anyway, no matter what it looks like; does it SOUND like a sawtooth? ;) From joost at greenskin.net Wed Nov 10 21:17:24 2004 From: joost at greenskin.net (Joost Schuttelaar) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] 4,3 Hermite interpolator, math question In-Reply-To: <200411110159.iAB1x4701027@www.123-reg.co.uk> References: <200411110159.iAB1x4701027@www.123-reg.co.uk> Message-ID: <4192CBB4.8040308@greenskin.net> Lysse wrote: > Does that makes things any clearer? This makes things perfectly clear to me. I especially liked your parallel to no- and linear-interpolation. Thank you very much, Lysse. :) -- Joost Schuttelaar From peter at sonicreef.com Thu Nov 11 01:54:09 2004 From: peter at sonicreef.com (Peter Thom) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] DA converter from vintage samplers In-Reply-To: <200411110205.iAB25kU04658@www.123-reg.co.uk> Message-ID: <1100156043.14771@mx250c.mysite4now.com> What do you mean by companding process? It sure sounds like a sawtooth, but more like a minimoog sawtooth (more punch) than a perfect sawtooth (as used in later generation ICs) Peter -----Original Message----- From: music-dsp-bounces@ceait.calarts.edu [mailto:music-dsp-bounces@ceait.calarts.edu] On Behalf Of Lysse Sent: Wednesday, November 10, 2004 6:06 PM To: A List For Musical Digital Signal Processing Subject: Re: [music-dsp] DA converter from vintage samplers Peter Thom wrote: > When I load a sawtooth wave (with a perfectly steady slope) into some > of the old 8 or 12 bit samplers, the wave it actually outputs, has a > very curvy sawtooth. Can anyone explain to me, why that is, and how I > could simulate this behavior in dsp? Lots of people have already suggested that it's being filtered or otherwise distorted by the sampling process; but I do have one other suggestion. A few old, particularly 8-bit, samplers used a companding process on samples to improve the dynamic range - or used logarithmic sampling for much the same reason. Could the distortion you're seeing be an artefact of that process? Anyway, no matter what it looks like; does it SOUND like a sawtooth? ;) -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From yacob_uk at yahoo.com Thu Nov 11 04:34:55 2004 From: yacob_uk at yahoo.com (Jay Gattuso) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] I'm pretty new to all this Message-ID: <20041111093455.68912.qmail@web52905.mail.yahoo.com> I am making a DSP device for a uni project. I have so far learnt the very basics of Z transforms etc and I am trying to get my head round it all. I wonder if anyone can point me in the direction of some resources that: 1) explain the basics of putting a filter together (particually notch filters) and 2) How to realise these filters in a DSP devo board. I appreciate that a cirtian amount of 'C' will need to be learnt to enable this, for both the actual filtering and the 'admin' side of controlling filters and running the program. Does anyone know of any good resources to aid this process? I have a very basic block diagram of how I think the system will function, but not being a coder I wonder if any of you have an tips or advice on the process needed to realise this system. I'm not looking for anyone to tell me 'the answers' I am looking for learning resources to aid my learning process to allow me to make this thing work! Thanks for your time. __________________________________ Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com From postmaster at emotu.it Thu Nov 11 09:02:15 2004 From: postmaster at emotu.it (Carlo Chiari) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] [OT] fstream linker problem Message-ID: <419370E7.5020407@emotu.it> Hi, I cannot build the project. I'm using fstream classes to manage a .INI text file from the AudioEffect. Compliler ok, but linker tells me that: Linking... Creating library Debug/XPlayer.lib and object Debug/XPlayer.exp XPlayer.obj : error LNK2001: unresolved external symbol "public: void __thiscall fstream::open(char const *,int,int)" (?open@fstream@@QAEXPBDHH@Z) XPlayer.obj : error LNK2001: unresolved external symbol "public: static int const filebuf::openprot" (?openprot@filebuf@@2HB) XPlayer.obj : error LNK2001: unresolved external symbol "public: __thiscall fstream::fstream(void)" (??0fstream@@QAE@XZ) XPlayer.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall ios::~ios(void)" (??1ios@@UAE@XZ) XPlayer.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall fstream::~fstream(void)" (??1fstream@@UAE@XZ) XPlayer.obj : error LNK2001: unresolved external symbol "public: void __thiscall fstream::close(void)" (?close@fstream@@QAEXXZ) Debug/XPlayer.dll : fatal error LNK1120: 6 unresolved externals Error executing link.exe. I'm sorry, for the question, it may be out of theme here. bye From xue.wen at elec.qmul.ac.uk Thu Nov 11 09:39:24 2004 From: xue.wen at elec.qmul.ac.uk (Wen X) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] filters to prevent aliasing References: Message-ID: <004e01c4c7fc$4f6c4c40$7421258a@wenpc> hi there, if you're raising the playback rate of the audio interface, e.g. by setting some parameters of the sound card, nothing needs to be done to the data buffer. on the other hand, if this is done by software, the problem is a typical downsampling and most of the time (for arbitary output rate) an ANALOG fir filter is used. so for digital resampling task, i guess, a 4-pole digital filter is already very cheap, compared to the usual fir. however it's not convenient for interpolating the data and thus is mostly used for an integer downsampling factor. xue ----- Original Message ----- From: "Mark Cartwright" To: Sent: Wednesday, November 10, 2004 11:52 PM Subject: [music-dsp] filters to prevent aliasing > hi all, > ok, so in something I'm working on, I'm increasing the playback rate > of some buffered audio, and I want to avoid aliasing. Soo... I figure > that I need to filter the buffer before playback at nyquist / playback > rate. Is this the right approach? If so, what is the best way to > filter it? I figure in order to keep as much frequency content as > possible I need to use a sharp filter. Do I need to use an expensive > 4-pole allpass? Is there a cheap brickwall filter? Or should I be > avoiding these extreme filters due to their detrimental phase > consequences, and instead just put a low order filter at an even lower > cutoff than Nyquist / playbackRate, sacrificing some frequency > content? Sorry for the novice questions, thanks in advance for you > help. > > mark > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, > dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From jchandjr at bellsouth.net Thu Nov 11 09:45:57 2004 From: jchandjr at bellsouth.net (James Chandler Jr) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] I'm pretty new to all this References: <20041111093455.68912.qmail@web52905.mail.yahoo.com> Message-ID: <0bb901c4c7fd$27aa1dd0$6401a8c0@JamesCompaq3080> Hi Jay Here is a very good book you can download: "The Scientist and Engineer's Guide to Digital Signal Processing" http://www.dspguide.com/ It is easy to read and gives a good beginning overview. Also, the musicdsp web archives have many interesting code snippets. JCJR ----- Original Message ----- From: "Jay Gattuso" To: Sent: Thursday, November 11, 2004 4:34 AM Subject: [music-dsp] I'm pretty new to all this >I am making a DSP device for a uni project. I have so far learnt the > very basics of Z transforms etc and I am trying to get my head round > it all. > > I wonder if anyone can point me in the direction of some resources > that: > 1) explain the basics of putting a filter together (particually notch > filters) and > 2) How to realise these filters in a DSP devo board. > > I appreciate that a cirtian amount of 'C' will need to be learnt to > enable this, for both the actual filtering and the 'admin' side of > controlling filters and running the program. Does anyone know of any > good resources to aid this process? > > I have a very basic block diagram of how I think the system will > function, but not being a coder I wonder if any of you have an tips > or advice on the process needed to realise this system. > > I'm not looking for anyone to tell me 'the answers' I am looking for > learning resources to aid my learning process to allow me to make > this thing work! > > Thanks for your time. > > > > __________________________________ > Do you Yahoo!? > Check out the new Yahoo! Front Page. > www.yahoo.com > > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp > links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From xue.wen at elec.qmul.ac.uk Thu Nov 11 09:46:46 2004 From: xue.wen at elec.qmul.ac.uk (Wen X) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] I'm pretty new to all this References: <20041111093455.68912.qmail@web52905.mail.yahoo.com> Message-ID: <006201c4c7fd$56478ec0$7421258a@wenpc> most chip manufacturers also publish developments kits that helps to turn the mcu or dsp chip into a system with only a few additional things -- usually including one or two circuit boards with computer interfaces, manuals, compilers and example programs -- have you got these things? regrads, xue ----- Original Message ----- From: "Jay Gattuso" To: Sent: Thursday, November 11, 2004 9:34 AM Subject: [music-dsp] I'm pretty new to all this >I am making a DSP device for a uni project. I have so far learnt the > very basics of Z transforms etc and I am trying to get my head round > it all. > > I wonder if anyone can point me in the direction of some resources > that: > 1) explain the basics of putting a filter together (particually notch > filters) and > 2) How to realise these filters in a DSP devo board. > > I appreciate that a cirtian amount of 'C' will need to be learnt to > enable this, for both the actual filtering and the 'admin' side of > controlling filters and running the program. Does anyone know of any > good resources to aid this process? > > I have a very basic block diagram of how I think the system will > function, but not being a coder I wonder if any of you have an tips > or advice on the process needed to realise this system. > > I'm not looking for anyone to tell me 'the answers' I am looking for > learning resources to aid my learning process to allow me to make > this thing work! > > Thanks for your time. > > > > __________________________________ > Do you Yahoo!? > Check out the new Yahoo! Front Page. > www.yahoo.com > > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, > dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From jschoeni at gmx.net Thu Nov 11 15:29:50 2004 From: jschoeni at gmx.net (=?iso-8859-1?q?J=FCrgen_Sch=F6neberg?=) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] Motorola EVM56 C-compiler Message-ID: <200411112129.51196.jschoeni@gmx.net> Hej! I'm looking for a c-compiler for the EVM56002 board. Has anybody an idea where I can find one?(for Linux) thank you Juergen From musicdsp at lysse.co.uk Thu Nov 11 21:30:54 2004 From: musicdsp at lysse.co.uk (Lysse) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] DA converter from vintage samplers Message-ID: <200411120230.iAC2Usc28033@www.123-reg.co.uk> Peter Thom wrote: > What do you mean by companding process? A matched pair of compressor before the A/D convertor, and expander after the D/A convertor. But it occurs to me as I write this that I'm probably wrong. :) From signalzerodb at yahoo.co.uk Thu Nov 11 23:08:12 2004 From: signalzerodb at yahoo.co.uk (Dave Gamble) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] DA converter from vintage samplers In-Reply-To: <200411120230.iAC2Usc28033@www.123-reg.co.uk> References: <200411120230.iAC2Usc28033@www.123-reg.co.uk> Message-ID: <7890B3EA-3460-11D9-8365-000A958903DE@yahoo.co.uk> On 12 Nov 2004, at 02:30, Lysse wrote: > Peter Thom wrote: >> What do you mean by companding process? > > A matched pair of compressor before the A/D convertor, and > expander after the D/A convertor. But it occurs to me as I > write this that I'm probably wrong. :) A trick I used to see sometimes was using (say) 12 or 16bit A/Ds, and then converting to an 8bit log format to reduce the amount of space needed to store the data. Also, you could do enveloping with addition/subtraction. :) Mixing was fun though :) Dave. From jchandjr at bellsouth.net Thu Nov 11 23:55:56 2004 From: jchandjr at bellsouth.net (James Chandler Jr) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] DA converter from vintage samplers References: <200411120230.iAC2Usc28033@www.123-reg.co.uk> <7890B3EA-3460-11D9-8365-000A958903DE@yahoo.co.uk> Message-ID: <0d0801c4c873$e5bfc100$6401a8c0@JamesCompaq3080> > > On 12 Nov 2004, at 02:30, Lysse wrote: > >> Peter Thom wrote: >>> What do you mean by companding process? >> >> A matched pair of compressor before the A/D convertor, and >> expander after the D/A convertor. But it occurs to me as I >> write this that I'm probably wrong. :) > A trick I used to see sometimes was using (say) 12 or 16bit A/Ds, and then > converting to an 8bit log format to reduce the amount of space needed to store > the data. > Also, you could do enveloping with addition/subtraction. :) > Mixing was fun though :) > > Dave. There could have been other models, but am pretty sure the EMU Emulator II had 8 bit log storage. Small numbers had smaller DAC steps than big numbers! Most early samplers were weird one way or t'other. The Ensoniq EPS stored 12 bit samples, likely because RAM was horribly expensive. The EPS had a 68K controller + custom synth playback chip. AFAIK, the RAM was wired with the low byte unconnected. It thought it was a 16 bit sampler, but with dead RAM on the low 8 bits! The keyboard mechanism was brilliantly designed, with no keyboard contacts to wear out, and wonderful poly pressure implementation! The EPS and ESQ-1 had VERY well-written OS and embedded sequencers for that era. Ensoniq had some very bright embedded software programmers (though other synth companies did too). JCJR From jchandjr at bellsouth.net Fri Nov 12 00:03:08 2004 From: jchandjr at bellsouth.net (James Chandler Jr) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] DA converter from vintage samplers References: <200411120230.iAC2Usc28033@www.123-reg.co.uk><7890B3EA-3460-11D9-8365-000A958903DE@yahoo.co.uk> <0d0801c4c873$e5bfc100$6401a8c0@JamesCompaq3080> Message-ID: <0d1601c4c874$e714ad30$6401a8c0@JamesCompaq3080> > AFAIK, the RAM was wired with the low byte unconnected. It thought it was a 16 > bit sampler, but with dead RAM on the low 8 bits! Apologies. That should have read "dead RAM on the low 4 bits". JCJR From Anders.Clerwall at dice.se Fri Nov 12 04:22:08 2004 From: Anders.Clerwall at dice.se (Anders Clerwall) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] Doppler shift Message-ID: <4D204F68A11D64409DA0E69C487F1CC4950DBD@gandalf.dice.se> Hello all, This is going to sound stupid (or na?ve and wishful) but, is there a way to implement Doppler Shift while maintaining a constant buffer size? This is for a real-time application so speed is more important than precision/range of the shift. To clarify what I want: n input samples -> shift -> n output samples Which would be awesome since it wouldn't require more data to be streamed in as pitch increases unlike the obvious method of just changing the "step size". I've looked at Stephan M. Bernsee's method for pitch shifting (www.dspdimension.com) but it looks way too expensive! Cheers -- Anders Clerwall From Anders.Clerwall at dice.se Fri Nov 12 04:57:06 2004 From: Anders.Clerwall at dice.se (Anders Clerwall) Date: Sun Jan 21 12:10:32 2007 Subject: [music-dsp] Non-point sound sources Message-ID: <4D204F68A11D64409DA0E69C487F1CC4950DBF@gandalf.dice.se> Hello again, I'm also looking for information about non-point sound sources and how one might implement them. Any information on this would be very appreciated! Cheers -- Anders Clerwall From alexm at af.kiev.ua Fri Nov 12 05:01:14 2004 From: alexm at af.kiev.ua (Alexey Menshikov) Date: Sun Jan 21 12:10:33 2007 Subject: [music-dsp] Non-point sound sources In-Reply-To: <4D204F68A11D64409DA0E69C487F1CC4950DBF@gandalf.dice.se> References: <4D204F68A11D64409DA0E69C487F1CC4950DBF@gandalf.dice.se> Message-ID: <789289389.20041112120114@af.kiev.ua> Hmm DICE making new software audio engine - hardware is not enough nowadays?) Okay you can find some info in the openAL source code for *nix systems - afaik there is was Doppler code. For volumetric sound sources: you can create simply '2d' panning sources with wide spread. Spread angle depends on object size. Or do as everyone - just several point sources with different minmac radiuses. Very pity that Aureal,Inc`s secrets not univelled yet :) Alexey Menshikov Action Forms Ltd. Friday, November 12, 2004, 11:57:06 AM, you wrote: AC> Hello again, AC> I'm also looking for information about non-point sound sources and how AC> one might implement them. AC> Any information on this would be very appreciated! From joshscholar at yahoo.com Fri Nov 12 05:42:45 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:33 2007 Subject: [music-dsp] Non-point sound sources References: <4D204F68A11D64409DA0E69C487F1CC4950DBF@gandalf.dice.se> Message-ID: <001001c4c8a4$5af3b7d0$82e22641@antssoftware.com> Do you mean physical none-point sound sources or some sort of software virtualization of non-point sound sources? If you're talking about a non-point speaker system then a solution might be to array a bunch of speakers, depending what you want. I've seen that done before at an installation in Disney world. The engineer who put it together pointed out that sound was very loud within each small room, but that the sound didn't carry outside the room, a useful effect. Joshua Scholar ----- Original Message ----- From: Anders Clerwall To: a list for musical digital signal processing Sent: Friday, November 12, 2004 1:57 AM Subject: [music-dsp] Non-point sound sources Hello again, I'm also looking for information about non-point sound sources and how one might implement them. Any information on this would be very appreciated! Cheers -- Anders Clerwall From Anders.Clerwall at dice.se Fri Nov 12 05:44:22 2004 From: Anders.Clerwall at dice.se (Anders Clerwall) Date: Sun Jan 21 12:10:33 2007 Subject: [music-dsp] Non-point sound sources Message-ID: <4D204F68A11D64409DA0E69C487F1CC4950DC0@gandalf.dice.se> I'm interested in rendering this in software, although the Disney World thing sounds interesting as well :) --anders -----Original Message----- From: music-dsp-bounces@ceait.calarts.edu [mailto:music-dsp-bounces@ceait.calarts.edu] On Behalf Of Joshua Scholar Sent: den 12 november 2004 11:43 To: a list for musical digital signal processing Subject: Re: [music-dsp] Non-point sound sources Do you mean physical none-point sound sources or some sort of software virtualization of non-point sound sources? If you're talking about a non-point speaker system then a solution might be to array a bunch of speakers, depending what you want. I've seen that done before at an installation in Disney world. The engineer who put it together pointed out that sound was very loud within each small room, but that the sound didn't carry outside the room, a useful effect. Joshua Scholar ----- Original Message ----- From: Anders Clerwall To: a list for musical digital signal processing Sent: Friday, November 12, 2004 1:57 AM Subject: [music-dsp] Non-point sound sources Hello again, I'm also looking for information about non-point sound sources and how one might implement them. Any information on this would be very appreciated! Cheers -- Anders Clerwall -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From joshscholar at yahoo.com Fri Nov 12 06:38:15 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:33 2007 Subject: [music-dsp] Non-point sound sources References: <4D204F68A11D64409DA0E69C487F1CC4950DC0@gandalf.dice.se> Message-ID: <002401c4c8ac$1a7d83e0$82e22641@antssoftware.com> Well I think the uhm "point" he was making was that coherent plane sources beam and doesn't spread much. A line source (that's what this was) radiates at a right angle to the line, but beams along the plane of the line. So, depending on the design of the room, a room with an open portal (which is what this was) could have loud sound that was directional so that it dispersed within the room without radiating out of the portal, much. There may have been some trick with the phasing of the speakers to exagurate this. In this case a line source was made by just lining up a bunch of speakers. I noticed that each speaker was in a tube, but I don't know if that was significant. I suspect that the wavelength of subsonics may be too long to control this way, but I'd have to do some calculations to be sure. Joshua Scholar ----- Original Message ----- From: Anders Clerwall To: a list for musical digital signal processing Sent: Friday, November 12, 2004 2:44 AM Subject: RE: [music-dsp] Non-point sound sources I'm interested in rendering this in software, although the Disney World thing sounds interesting as well :) --anders -----Original Message----- From: music-dsp-bounces@ceait.calarts.edu [mailto:music-dsp-bounces@ceait.calarts.edu] On Behalf Of Joshua Scholar Sent: den 12 november 2004 11:43 To: a list for musical digital signal processing Subject: Re: [music-dsp] Non-point sound sources Do you mean physical none-point sound sources or some sort of software virtualization of non-point sound sources? If you're talking about a non-point speaker system then a solution might be to array a bunch of speakers, depending what you want. I've seen that done before at an installation in Disney world. The engineer who put it together pointed out that sound was very loud within each small room, but that the sound didn't carry outside the room, a useful effect. Joshua Scholar ----- Original Message ----- From: Anders Clerwall To: a list for musical digital signal processing Sent: Friday, November 12, 2004 1:57 AM Subject: [music-dsp] Non-point sound sources Hello again, I'm also looking for information about non-point sound sources and how one might implement them. Any information on this would be very appreciated! Cheers -- Anders Clerwall From joshscholar at yahoo.com Fri Nov 12 07:02:26 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:33 2007 Subject: [music-dsp] Doppler shift References: <4D204F68A11D64409DA0E69C487F1CC4950DBD@gandalf.dice.se> Message-ID: <003a01c4c8af$7b59ef20$82e22641@antssoftware.com> You know I have done resampling in a game engine years ago. That only had to do 2 and 4 times oversampling and undersampling, not arbitrary resampling, but from that I learned that short windowed sinc resampling can sound pretty good. That particular implementation didn't even use a multiply instruction (I used hardwired approximate multiplies by constants)... So I would probably oversample by 2 because it's easy to do. If I really wanted quality I'd oversample twice. Then I'd use a spline to interpolate while arbitrarily resampling. Though because these processes aren't 100% distortion free, I'd want to put in a special case that would stream data through unfiltered in the case of no motion. To deal with the buffer overrun / underrun I'd prefer to make the samples available on demand and simply let the resampler demand as few or as many samples as it needed to stay somewhat ahead of need. If an object can recede forever and that means that the sample rate can be permanently lower than a stationary object... The longer an object can rush at you and still be audible, the longer it's rate will be higher than a stationary object. If you set limits on how far away an object can be rendered, and how close it can get to you then I guess you can calculate how much slack you need in your buffer by doing dry runs... But this sounds too limiting - it's creating opportunities for bugs and limitations. Why not bite the bullet and allow the system to demand samples as needed? The range of rates it will demand samples at is pretty narrow - I doubt that you're going to be render objects moving at the speed of sound. Joshua Scholar ----- Original Message ----- From: Anders Clerwall To: a list for musical digital signal processing Sent: Friday, November 12, 2004 1:22 AM Subject: [music-dsp] Doppler shift Hello all, This is going to sound stupid (or na?ve and wishful) but, is there a way to implement Doppler Shift while maintaining a constant buffer size? This is for a real-time application so speed is more important than precision/range of the shift. To clarify what I want: n input samples -> shift -> n output samples Which would be awesome since it wouldn't require more data to be streamed in as pitch increases unlike the obvious method of just changing the "step size". I've looked at Stephan M. Bernsee's method for pitch shifting (www.dspdimension.com) but it looks way too expensive! Cheers -- Anders Clerwall -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From joshscholar at yahoo.com Fri Nov 12 07:05:03 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:33 2007 Subject: [music-dsp] Doppler shift References: <4D204F68A11D64409DA0E69C487F1CC4950DBD@gandalf.dice.se> Message-ID: <003e01c4c8af$d8a2b3b0$82e22641@antssoftware.com> Oh and one last thing. If you ARE rendering object that move at any significant fraction of the speed of sound, then you'll need an aliasing filter for objects moving toward you. A simple solutions (because it doesn't need a sliding filter) is to do your calculations oversampled by 2 and then to have a single decimating filter. Joshua Scholar From xue.wen at elec.qmul.ac.uk Fri Nov 12 07:59:06 2004 From: xue.wen at elec.qmul.ac.uk (Wen X) Date: Sun Jan 21 12:10:33 2007 Subject: [music-dsp] Doppler shift References: <4D204F68A11D64409DA0E69C487F1CC4950DBD@gandalf.dice.se> Message-ID: <003701c4c8b7$7668da50$5f21258a@wenpc> i doubt it's not a problem of pitch shifting but rather resampling, as joshua has mentioned. if the direction of the moving source passes the point of listener, the resampling factor is a constant; otherwise it's a continuously changing value. i don't have any experience with a resampler with variating resampling factor but i guess it might be possible to accomplish using the very classics convolution method while the involved filter evolves with time. best, xue ----- Original Message ----- From: "Anders Clerwall" To: "a list for musical digital signal processing" Sent: Friday, November 12, 2004 9:22 AM Subject: [music-dsp] Doppler shift Hello all, This is going to sound stupid (or na?ve and wishful) but, is there a way to implement Doppler Shift while maintaining a constant buffer size? This is for a real-time application so speed is more important than precision/range of the shift. To clarify what I want: n input samples -> shift -> n output samples Which would be awesome since it wouldn't require more data to be streamed in as pitch increases unlike the obvious method of just changing the "step size". I've looked at Stephan M. Bernsee's method for pitch shifting (www.dspdimension.com) but it looks way too expensive! Cheers -- Anders Clerwall -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From erikd-music-dsp at mega-nerd.com Fri Nov 12 08:02:31 2004 From: erikd-music-dsp at mega-nerd.com (Erik de Castro Lopo) Date: Sun Jan 21 12:10:33 2007 Subject: [music-dsp] Doppler shift In-Reply-To: <003701c4c8b7$7668da50$5f21258a@wenpc> References: <4D204F68A11D64409DA0E69C487F1CC4950DBD@gandalf.dice.se> <003701c4c8b7$7668da50$5f21258a@wenpc> Message-ID: <20041113000231.5d66eb71.erikd-music-dsp@mega-nerd.com> On Fri, 12 Nov 2004 12:59:06 -0000 "Wen X" wrote: > i doubt it's not a problem of pitch shifting but rather resampling, as > joshua has mentioned. if the direction of the moving source passes > the point of listener, the resampling factor is a constant; otherwise > it's a continuously changing value. i don't have any experience with > a resampler with variating resampling factor but i guess it might be > possible to accomplish using the very classics convolution method > while the involved filter evolves with time. Secret Rabbit Code is capable of time varying conversions. http://www.mega-nerd.com/SRC/ It may not be the final solution to your problem, but may be useful for the purposes of experimentation. Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) +-----------------------------------------------------------+ Linux, the UNIX defragmentation tool. From joshscholar at yahoo.com Fri Nov 12 08:19:33 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:33 2007 Subject: [music-dsp] Doppler shift References: <4D204F68A11D64409DA0E69C487F1CC4950DBD@gandalf.dice.se> <003701c4c8b7$7668da50$5f21258a@wenpc> Message-ID: <007001c4c8ba$40d1a590$82e22641@antssoftware.com> Ooh yeah, I didn't even notice that Anders mentioned "pitch shifting" Pitch shifting is WRONG. A doppler shift compresses or expands time as a whole. A recedeing sound will be lower pitched _and_ _longer_! A "blue shifted" sound will be higher pitched _and_ _faster_. Resampling is _exactly_ the right thing to do. ----- Original Message ----- From: Wen X To: a list for musical digital signal processing Sent: Friday, November 12, 2004 4:59 AM Subject: Re: [music-dsp] Doppler shift i doubt it's not a problem of pitch shifting but rather resampling, as joshua has mentioned. if the direction of the moving source passes the point of listener, the resampling factor is a constant; otherwise it's a continuously changing value. i don't have any experience with a resampler with variating resampling factor but i guess it might be possible to accomplish using the very classics convolution method while the involved filter evolves with time. best, xue ----- Original Message ----- From: "Anders Clerwall" To: "a list for musical digital signal processing" Sent: Friday, November 12, 2004 9:22 AM Subject: [music-dsp] Doppler shift Hello all, This is going to sound stupid (or na?ve and wishful) but, is there a way to implement Doppler Shift while maintaining a constant buffer size? This is for a real-time application so speed is more important than precision/range of the shift. To clarify what I want: n input samples -> shift -> n output samples Which would be awesome since it wouldn't require more data to be streamed in as pitch increases unlike the obvious method of just changing the "step size". I've looked at Stephan M. Bernsee's method for pitch shifting (www.dspdimension.com) but it looks way too expensive! Cheers -- Anders Clerwall -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From Anders.Clerwall at dice.se Fri Nov 12 08:22:29 2004 From: Anders.Clerwall at dice.se (Anders Clerwall) Date: Sun Jan 21 12:10:33 2007 Subject: [music-dsp] Doppler shift Message-ID: <4D204F68A11D64409DA0E69C487F1CC4950DC1@gandalf.dice.se> Right. Thanks guys for the information, I will of course have to bite the bullet and do it the obvious way. "A gal can dream..." at least :) Cheers --anders -----Original Message----- From: music-dsp-bounces@ceait.calarts.edu [mailto:music-dsp-bounces@ceait.calarts.edu] On Behalf Of Joshua Scholar Sent: den 12 november 2004 14:20 To: a list for musical digital signal processing Subject: Re: [music-dsp] Doppler shift Ooh yeah, I didn't even notice that Anders mentioned "pitch shifting" Pitch shifting is WRONG. A doppler shift compresses or expands time as a whole. A recedeing sound will be lower pitched _and_ _longer_! A "blue shifted" sound will be higher pitched _and_ _faster_. Resampling is _exactly_ the right thing to do. ----- Original Message ----- From: Wen X To: a list for musical digital signal processing Sent: Friday, November 12, 2004 4:59 AM Subject: Re: [music-dsp] Doppler shift i doubt it's not a problem of pitch shifting but rather resampling, as joshua has mentioned. if the direction of the moving source passes the point of listener, the resampling factor is a constant; otherwise it's a continuously changing value. i don't have any experience with a resampler with variating resampling factor but i guess it might be possible to accomplish using the very classics convolution method while the involved filter evolves with time. best, xue ----- Original Message ----- From: "Anders Clerwall" To: "a list for musical digital signal processing" Sent: Friday, November 12, 2004 9:22 AM Subject: [music-dsp] Doppler shift Hello all, This is going to sound stupid (or na?ve and wishful) but, is there a way to implement Doppler Shift while maintaining a constant buffer size? This is for a real-time application so speed is more important than precision/range of the shift. To clarify what I want: n input samples -> shift -> n output samples Which would be awesome since it wouldn't require more data to be streamed in as pitch increases unlike the obvious method of just changing the "step size". I've looked at Stephan M. Bernsee's method for pitch shifting (www.dspdimension.com) but it looks way too expensive! Cheers -- Anders Clerwall -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From earlevel at earlevel.com Fri Nov 12 13:33:16 2004 From: earlevel at earlevel.com (Nigel Redmon) Date: Sun Jan 21 12:10:33 2007 Subject: [music-dsp] Doppler shift In-Reply-To: <003a01c4c8af$7b59ef20$82e22641@antssoftware.com> References: <4D204F68A11D64409DA0E69C487F1CC4950DBD@gandalf.dice.se> <003a01c4c8af$7b59ef20$82e22641@antssoftware.com> Message-ID: <51932C1C-34D9-11D9-B143-000A959AF1E4@earlevel.com> I'll add: Don't overlook linear interpolation after you've upsampled by 2 or 4 with sinc. Linear interpolation is equivalent to bandlimited oversampling with a lame-ish lowpass--high frequency roll-off and larger stop band lobes than you'd like. But the initial higher-quality oversampling gives you the frequency headroom you need to make that work. On Nov 12, 2004, at 4:02 AM, Joshua Scholar wrote: > So I would probably oversample by 2 because it's easy to do. If I > really > wanted quality I'd oversample twice. > > Then I'd use a spline to interpolate while arbitrarily resampling. From xue.wen at elec.qmul.ac.uk Fri Nov 12 13:56:05 2004 From: xue.wen at elec.qmul.ac.uk (Wen X) Date: Sun Jan 21 12:10:33 2007 Subject: [music-dsp] Doppler shift References: <4D204F68A11D64409DA0E69C487F1CC4950DBD@gandalf.dice.se><003a01c4c8af$7b59ef20$82e22641@antssoftware.com> <51932C1C-34D9-11D9-B143-000A959AF1E4@earlevel.com> Message-ID: <000701c4c8e9$55876bd0$5f21258a@wenpc> i'll add: it seems with whatever interpolation it's better to involve more than just 2 input samples to produce an output sample -- to think it as a filter, a filter with too short an inpulse response can hardly ever be good enough. ----- Original Message ----- From: "Nigel Redmon" To: "a list for musical digital signal processing" Sent: Friday, November 12, 2004 6:33 PM Subject: Re: [music-dsp] Doppler shift > I'll add: Don't overlook linear interpolation after you've upsampled by 2 > or 4 with sinc. Linear interpolation is equivalent to bandlimited > oversampling with a lame-ish lowpass--high frequency roll-off and larger > stop band lobes than you'd like. But the initial higher-quality > oversampling gives you the frequency headroom you need to make that work. > > > On Nov 12, 2004, at 4:02 AM, Joshua Scholar wrote: > >> So I would probably oversample by 2 because it's easy to do. If I really >> wanted quality I'd oversample twice. >> >> Then I'd use a spline to interpolate while arbitrarily resampling. > > -- > dupswapdrop -- the music-dsp mailing list and website: subscription info, > FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From eli+ at cs.cmu.edu Fri Nov 12 14:57:31 2004 From: eli+ at cs.cmu.edu (Eli Brandt) Date: Sun Jan 21 12:10:33 2007 Subject: [music-dsp] Doppler shift In-Reply-To: <4D204F68A11D64409DA0E69C487F1CC4950DC1@gandalf.dice.se> from "Anders Clerwall" at Nov 12, 2004 02:22:29 PM Message-ID: <20041112195757.54916171894C@music.calarts.edu> Anders Clerwall wrote: > Thanks guys for the information, I will of course have to bite the = > bullet and do it the obvious way. One cheap hack to consider is pushing the shift further back, into the control signals, rather than doing it on audio. If you're Doppler-shifting an oscillator, do it by varying the oscillator's pitch. This hack only gets you so far, but it's nice and manageable up to a point. Yeah, strictly speaking you'll have to stretch the envelope too, and for large shifts it sounds poor if you skimp on that, but for small shifts you can get away without it. (As you suspect, doing Doppler shift directly with a variable delay can be a pain. For example, at the moment an approaching source becomes audible, its Doppler delay line needs to have been prefilled by a certain amount, since it will be playing back fast, depleting this prefill. And in a real-time system you can't compute this prefill material just when it's needed, so you have to do some lookahead.) -- Eli Brandt | eli+@cs.cmu.edu | http://www.cs.cmu.edu/~eli/ From urs at u-he.com Sat Nov 13 08:06:48 2004 From: urs at u-he.com (Urs Heckmann) Date: Sun Jan 21 12:10:33 2007 Subject: [music-dsp] Detecting phase cycle with Hoeldrich method....... In-Reply-To: <6DDFAE3D-3363-11D9-ACD5-000A957CD8B8@alum.mit.edu> References: <20041110064042.BB1DC17038D7@music.calarts.edu> <6DDFAE3D-3363-11D9-ACD5-000A957CD8B8@alum.mit.edu> Message-ID: Hiya, David Lowenfels: > ( Urs Heckmann are you out there? ) I don't understand it either :-p (and you know, I'm a retarded math punk, I can't even read the formulas in the papers) > If I understand correctly, the reason to rely on integer overflow is > to avoid branching with an if statement. This will avoid pipeline > stalls in the process inner loop. > > My guess is that you can't have your cake and eat it too. Either you > use a conditional to extract the phase wrapping event, or you use this > "Hoeldrich" method. However if you find a way to "eat the cake", > please let me know! :) I like to use the phase wrap so I can do "hard > sync", but it requires branching as far as I have discovered. Well... there is a method, indeed... but it's tricky... I don't know how it would work on each platform, but on PowerPC, you can just use the comparison result for calculations rather than for branching. Putting it simple, if you have a comparison, say "myInt < 107", then there's a bit set or not (true or false) in the Condition Register which can be used in subsequent instructions, like addc (add with carrying). This can be used for enormously fast code without branching, but it has its pitfalls: If you code in C, you gotta look carefully at your assembly code, or the compiler might add a "hidden" branch. Example (discovered just yesterday): int greaterZero = (myInt > 0); // embraced // BAD: gcc 3.3 PPC produces a conditional branch int greaterZero = myInt > 0; // no braces... // GOOD: gcc 3.3 PPC loads 0 into greaterZero and uses adde on *itself* to load the carry flag So, if you keep this in mind, there are simple ways to build Syncing Oscillators without branching: /* * Code Example for 2 simple Sawtooth Oscillators * OSC1 hardsyncs OSC2 without branching */ // Variables: // phase accumulator for OSC1 and OSC2 unsigned int phase1; unsigned int phase2; // 22 of 23 bit floating point mantissa... // ... we need 1 bit headroom for mixing 2 oscillators... const static unsigned int maxPhase = 1 << 21; unsigned int offset1; // "frequency" / phase offset unsigned int offset2; // between 1 and maxPhase/2 (Nyquist) // Procedure: void dualSyncOscLoop ( const int inNumSamples, float* outSamples ) { // Magic Array const static unsigned int phaseWrap[] = { maxPhase, 0 }; // Don't worry, we know that we produce floats. // But we also know what an IEEE float looks like, bit-wise :-p unsigned int *outSamplesInt = ( unsigned int* ) outSamples; for ( int i = 0; i < inNumSamples; i++ ) { phase1 += offset1; phase2 += offset2; // sic! int NoOverflow1 = phase1 < maxPhase; int NoOverflow2 = phase2 < maxPhase; phase1 -= phaseWrap[ NoOverflow1 ]; phase2 -= phaseWrap[ NoOverflow2 ]; // HardSync OSC1->OSC2 without branching // phase2 zeros when (rather than if) phase1 wraps phase2 *= NoOverflow1; // now convert to floating point, but without casting // just taking the 23 bits as mantissa and add exponent for 2^1 (?) // the output is between 1.f and <2.f // in a subsequent loop, you may want to do // *outSamples = *outSamples++ * 2.f - 1.f; *outSamplesInt++ = ( phase1 + phase2 ) | 0x3F800000; // only 8 short lines of code so far, no branch 8-)) // could be 7 if we do "&= (maxPhase - 1)" on phase2 // pretty much space left to do other stuff in here, if desired... } } // end of confusion Hope there are not too many bugs, I just had my first coffee... Well, this is crap, mostly, because *no bandlimiting* and we can't adjust volume of the oscillators or anything. Only Sawtooths... ... but you get the point ;-) (and Sawtooth = Phase, i.e. for bandlimited wavetables etc.) What do you think? Cheers, ;) Urs urs heckmann urs@u-he.com www.u-he.com From douglas at roar.music.columbia.edu Mon Nov 15 00:00:10 2004 From: douglas at roar.music.columbia.edu (douglas repetto) Date: Sun Jan 21 12:10:33 2007 Subject: [music-dsp] [admin] music-dsp FAQ Message-ID: <200411150500.iAF50Amd025371@roar.music.columbia.edu> hi, just a reminder that if you are new to the list you should read the music-dsp FAQ. it contains answers to both technical _and_ adminstrative questions that often come up on the list. if your question appears in the FAQ it is safe to assume that it has been discussed on the list many times in the past, and you should probably have a look through the list archives before posting your question to the list. http://shoko.calarts.edu/musicdsp/musicdspFAQ.html also of interest to new and not-so-new list members: the music-dsp list archives http://shoko.calarts.edu/musicdsp/musicdsparchives.html the music-dsp source code archive http://www.musicdsp.org music-dsp books and reviews http://shoko.calarts.edu/musicdsp/dspbooks.html all this and more at: http://shoko.calarts.edu/musicdsp hotdawg! douglas (this is an automated message sent out on the 1st and 15th of each month) From kouhia at nic.funet.fi Fri Nov 12 11:29:41 2004 From: kouhia at nic.funet.fi (Juhana Sadeharju) Date: Sun Jan 21 12:10:34 2007 Subject: [music-dsp] Re: Analog Modelling Message-ID: >From: antti@smartelectronix.com > >pseudo-matlab code follows: [ ... ] >vc1 += g*(tanh(x) - t1); >t1 = tanh(vc1); [ ... ] >Now, does that look like rocket science to you? Yes. ;-) Five minutes experimentation yielded the following: tanh(t) ~ 0.84*t - 0.09*t^3, for -2 < t < 2 One could find better approximation with some software, but I had now only a crude ascii plotting software available. Has Linux any open source software which can fit polynomials to given functions? If t is out of range (-2,2), then t should be clamped. One could just return -1 or 1 when t is out of range but the above approximation is not tuned good enough for that; some minor error exists at -2 and 2. What values are feeded to tanh()s in Antti's filter if the input stays in the range (-1,1)? Perhaps clampings are not needed at all. The input to the filter could be kept within range (-1,1) with a waveshaper (e.g., tanh(), atan(), if-else). Juhana -- http://music.columbia.edu/mailman/listinfo/linux-graphics-dev for developers of open source graphics software From kouhia at nic.funet.fi Fri Nov 12 11:29:38 2004 From: kouhia at nic.funet.fi (Juhana Sadeharju) Date: Sun Jan 21 12:10:34 2007 Subject: [music-dsp] Re: new OSC controller, ... Message-ID: >From: george barlow > >But my design >has a patent-pending noise-rejection circuit that makes it much easier >to get a "snappy" response, instead of the mushy action shown in the >Lemur. I also get several times greater resolution. Could you give us circuit diagrams so that we could home-build a tablet? Is your patent already in www.uspto.gov/patft? What patent classes I should check out for these technologies? Do you have a list of journal references on the topic? What I know so far is that the circuits looks quite cheap compared to the camera and projector system. But I would like to have detailed cost estimations if anyone has them. What kind of signals one gets from the circuits? What would be the sampling rate? I'm wondering if one needs a microcontroller with firmware, or could a cheap audio card be used for sampling. An audio card based approach would be very attractive. Camera would require some processing as well. How the video digitizers in graphics cards does work: can the digitized image be processed in GPU without first bringing the image to CPU? Juhana -- http://music.columbia.edu/mailman/listinfo/linux-graphics-dev for developers of open source graphics software From erikd-music-dsp at mega-nerd.com Mon Nov 15 02:30:07 2004 From: erikd-music-dsp at mega-nerd.com (Erik de Castro Lopo) Date: Sun Jan 21 12:10:34 2007 Subject: [music-dsp] Re: Analog Modelling In-Reply-To: References: Message-ID: <20041115183007.680a0ee6.erikd-music-dsp@mega-nerd.com> On Fri, 12 Nov 2004 18:29:41 +0200 Juhana Sadeharju wrote: > Yes. ;-) > > Five minutes experimentation yielded the following: > > tanh(t) ~ 0.84*t - 0.09*t^3, for -2 < t < 2 > > One could find better approximation with some software, but > I had now only a crude ascii plotting software available. > Has Linux any open source software which can fit polynomials to > given functions? GNU Octave works pretty well and has a polyfit function. Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) +-----------------------------------------------------------+ Never argue with stupid people. They'll just drag you down to their level and beat you with experience From eddie at roughproductions.co.uk Mon Nov 15 06:36:37 2004 From: eddie at roughproductions.co.uk (Eddie Al-Shakarchi) Date: Sun Jan 21 12:10:34 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? Message-ID: <001301c4cb07$6203ead0$030200c0@australia> Hi guys I'm the one who posted that annoying coding attack/delay times post and am having a bit of trouble with my compressor. Basically, apart from my problems with averaging and rms stuff, i am having trouble with the 'peak' version of my compressor. I am not too sure about my envelope implementation (i'm working with java, btw), and i'm not too sure if i'm working out the currentCompressionRatio correctly. When i detect some samples over the threshold (ratio is set in db's, and already converted to amplitudes by the time it hits this method/function), all i do is divide by the currenCompressionRatio. Is that correct? I've attached my code below, if anyone could have a quick look at it in case there is something obvious, i'd appreciate that. It's a snippet, with no surplus stuff. I've commented it out the attackIncrement code i was using - i changed it after looking at the envelope follower code on the dsp archives (gave me errors if attack - 0ms anyway) Thanks a lot guys, i hope someone can see what i'm doing wrong. The sound is distorted and doesn't 'pump' at all. It just sounds clipped. Cheers Eddie ============================================================ public short[] process(short input[]){ short[] output = new short[input.length]; int[] temp = new int[input.length]; int outputSample = 0; int finalSample = 0; int maxValue = 0; // attackIncrement = (double)compressionRatio / (double)attackTime; // releaseIncrement = (double)compressionRatio / (double)releaseTime; attackIncrement = Math.pow(0.01, -1.0 / attackTime); releaseIncrement = Math.pow(0.01, -1.0 / releaseTime ); // For each sample in the array... for (int n=0; n < input.length; n++){ // Stops the compression ratio from going out of range if (currentCompressionRatio > compressionRatio) { currentCompressionRatio = compressionRatio; } // Stops the compression ratio from going out of range if (currentCompressionRatio < 1.0){ currentCompressionRatio = 1.0; } if (detection.equals("Peak")){ if (Math.abs(input[n]) > (int)thresholdLevel) //switch on { currentCompressionRatio = currentCompressionRatio + attackIncrement; outputSample = (int)(input[n] / currentCompressionRatio); } else { currentCompressionRatio = currentCompressionRatio - releaseIncrement; outputSample = input[n]; } } /// Then output, or whatever From antti at smartelectronix.com Mon Nov 15 07:19:29 2004 From: antti at smartelectronix.com (antti@smartelectronix.com) Date: Sun Jan 21 12:10:34 2007 Subject: [music-dsp] Re: Analog Modelling In-Reply-To: References: Message-ID: On Fri, 12 Nov 2004, Juhana Sadeharju wrote: > Five minutes experimentation yielded the following: > tanh(t) ~ 0.84*t - 0.09*t^3, for -2 < t < 2 But this changes the gain (remember, you want the first derivative to be 1.0 at t = 0). You can scale the whole function to compensate for that, but then it doesn't resemble tanh() much anymore. Interpolated table lookup is also not too expensive compared to polynomial and clamping. I added the Moog filter to my Augur synth (http://www.hut.fi/~ajhuovil/vst.html) in addition to the previous four pole linear filter and the cpu usage increased only about 20%. > What values are feeded to tanh()s in Antti's filter if the > input stays in the range (-1,1)? Perhaps clampings are not There is no need for input to stay in (-1,1) range. Some of the best sounds can be had by overdriving the input. Antti From dan at octapod.org Mon Nov 15 07:20:00 2004 From: dan at octapod.org (dan mackinlay ()) Date: Sun Jan 21 12:10:34 2007 Subject: [music-dsp] Re: Analog Modelling In-Reply-To: <20041115072754.CCB61172805A@music.calarts.edu> References: <20041115072754.CCB61172805A@music.calarts.edu> Message-ID: > From: Juhana Sadeharju > >> From: antti@smartelectronix.com >> >> pseudo-matlab code follows: > [ ... ] >> vc1 += g*(tanh(x) - t1); >> t1 = tanh(vc1); > [ ... ] >> Now, does that look like rocket science to you? > > Yes. ;-) > > Five minutes experimentation yielded the following: > > tanh(t) ~ 0.84*t - 0.09*t^3, for -2 < t < 2 > > One could find better approximation with some software, but > I had now only a crude ascii plotting software available. > Has Linux any open source software which can fit polynomials to > given functions? scliab www.scilab.org can fit polynomials to arbitrary data octave i think also http://www.gnu.org/software/octave/ but I'm a scilab kinda guy (and it looks more shamelessly like matlab.) can't ya just use the taylor series, though? f(t) ~ f(0)/(0!) + f'(0)/(1!)t + f''(0)/(2!)t^2 + f'''(0)/(3!)t^3 + ... i.e. tanh(t) ~ tanh(0) + (1-tanh(0)^2)t - tanh(0)(1-tanh(0)^2)t^2 - 2(1-tanh(0)^2)^2+ 4tanh(0)^2 (1-tanh(0)^2)t^3 + ... = t - t^3/3 + (2/15)t^5 + ... ---dan() From andy-list at vellocet.com Mon Nov 15 07:56:25 2004 From: andy-list at vellocet.com (Andrew Simper) Date: Sun Jan 21 12:10:34 2007 Subject: [music-dsp] Re: Analog Modelling References: <20041115072754.CCB61172805A@music.calarts.edu> Message-ID: <008201c4cb12$84700440$3800a8c0@andysbox> Thanks Dan for posting the right thing, my last one was ArcTan not Tanh, so for those that want some numbers here they are: Tanh(x) ~= x - 1/3.x^3 + 2/15.x^5 - 17/315.x^7 + 62/2835.x^9 - 1382/155925.x^11 ... Andrew. ----- Original Message ----- From: dan mackinlay To: music-dsp@shoko.calarts.edu Sent: Monday, November 15, 2004 12:20 PM Subject: [music-dsp] Re: Analog Modelling > From: Juhana Sadeharju > >> From: antti@smartelectronix.com >> >> pseudo-matlab code follows: > [ ... ] >> vc1 += g*(tanh(x) - t1); >> t1 = tanh(vc1); > [ ... ] >> Now, does that look like rocket science to you? > > Yes. ;-) > > Five minutes experimentation yielded the following: > > tanh(t) ~ 0.84*t - 0.09*t^3, for -2 < t < 2 > > One could find better approximation with some software, but > I had now only a crude ascii plotting software available. > Has Linux any open source software which can fit polynomials to > given functions? scliab www.scilab.org can fit polynomials to arbitrary data octave i think also http://www.gnu.org/software/octave/ but I'm a scilab kinda guy (and it looks more shamelessly like matlab.) can't ya just use the taylor series, though? f(t) ~ f(0)/(0!) + f'(0)/(1!)t + f''(0)/(2!)t^2 + f'''(0)/(3!)t^3 + ... i.e. tanh(t) ~ tanh(0) + (1-tanh(0)^2)t - tanh(0)(1-tanh(0)^2)t^2 - 2(1-tanh(0)^2)^2+ 4tanh(0)^2 (1-tanh(0)^2)t^3 + ... = t - t^3/3 + (2/15)t^5 + ... ---dan() -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From signalzerodb at yahoo.co.uk Mon Nov 15 09:33:01 2004 From: signalzerodb at yahoo.co.uk (Dave Gamble) Date: Sun Jan 21 12:10:34 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? In-Reply-To: <001301c4cb07$6203ead0$030200c0@australia> References: <001301c4cb07$6203ead0$030200c0@australia> Message-ID: <40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk> On 15 Nov 2004, at 11:36, Eddie Al-Shakarchi wrote: > Hi guys > > I'm the one who posted that annoying coding attack/delay times post > and am having a bit of trouble with my compressor. Basically, apart > from my problems with averaging and rms stuff, i am having trouble > with the 'peak' version of my compressor. I am not too sure about my > envelope implementation (i'm working with java, btw), and i'm not too > sure if i'm working out the currentCompressionRatio correctly. When i > detect some samples over the threshold (ratio is set in db's, and > already converted to amplitudes by the time it hits this > method/function), all i do is divide by the currenCompressionRatio. Is > that correct? > For a start, it only compresses during attack. So it has an infinitely short release... which will sound distorted. Also, the compression 'ratio' doesn't act like a ratio; it doesn't care how /far/ over the threshold the signal is, it just attacks -whilst- the signal is over the threshold. I posted a description of how to implement a compressor before, and it got ignored. I may even have posted a reference to Zolzer's Digital Audio Signal Processing. If I didn't, I should have. It contains a section on this. It's on the musicdsp booklist. > I've attached my code below, if anyone could have a quick look at it > in case there is something obvious, i'd appreciate that. It's a > snippet, with no surplus stuff. I've commented it out the > attackIncrement code i was using - i changed it after looking at the > envelope follower code on the dsp archives (gave me errors if attack - > 0ms anyway) > This fella will kick the compression in, which will be at some arbitrary level, whenever you cross the threshold. The attack time is not an attack time, but a time for 'soaking up' gain reduction - which isn't what it's supposed to be. The ratio has nothing to do with signal level excursion here. Suppose I put in an impulse of 0.5, what compression do I get? Now an impulse of 1.0? The compression is the same. This isn't a compressor, because it doesn't do what a compressor does. I am quite certain that when you get this sounding good, it will be a very marketable dynamics processor, with a unique, signature sound. I will probably buy a copy. But it's not a compressor. > Thanks a lot guys, i hope someone can see what i'm doing wrong. The > sound is distorted and doesn't 'pump' at all. It just sounds clipped. > Just because I like to repeat myself, here again is what a compressor does, and how it works. You've nearly hit on the sidechain vs audio path structure, but not quite. Your loop should be: for (each sample) get input gain_coeff=sidechain_function(input) put input*gain_coeff end This is nearly what you have here, but please note the outputSample=input[n] line, which will output the input sample 'as is' when the compressor is in release. This you certainly do not mean. As for how a sidechain should work, I refer your to Zolzer, who puts it thus: sidechain_function(input) num_dbs = 20log10 ( abs(input) ) excursion = num_dbs - threshold_in_dbs if (excursion > 0) correction = excursion * ((1/ratio) - 1) else correction = 0 if (correction > current_correction) current_correction = current_correction * attack_coeff + correction*(1-attack_coeff) else current_correction = current_correction * (1-release_coefficient) + correction*release_coefficient return 10^(current_correction/20) end This needs analysis. Firstly, you log. You can avoid this stage when optimising your implementation, but not now. You find out how many dbs above the threshold you are. Then you calculate how many dbs of gain reduction are implied by the ratio. If you are below the threshold, you want 0 gain reduction, if you are above the threshold, you want -something dbs of reduction. Then, you implement two parallel 1st order single pole filters for the attack and the release. Now, you convert from dbs to the actual number to multiply by. Observe that this value should always be negative. Return the gain multiplier and finish. This is roughly how Zolzer presents his compressor in DASP, and I think that it's the standard reference for beginning work on dynamics processors. All of the above can be modified in innumerable ways, but this is the 'theoretical' technique. Dave. From eddie at roughproductions.co.uk Mon Nov 15 09:38:22 2004 From: eddie at roughproductions.co.uk (Eddie Al-Shakarchi) Date: Sun Jan 21 12:10:34 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? References: <001301c4cb07$6203ead0$030200c0@australia> <40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk> Message-ID: <002f01c4cb20$c56ca440$030200c0@australia> wow, thank you for that, i will print it off and read it all again thoroughly immediately! thank you again Eddie ----- Original Message ----- From: "Dave Gamble" To: "a list for musical digital signal processing" Sent: Monday, November 15, 2004 2:33 PM Subject: Re: [music-dsp] Why does my compressor sound so bad/distorted? > On 15 Nov 2004, at 11:36, Eddie Al-Shakarchi wrote: > >> Hi guys >> >> I'm the one who posted that annoying coding attack/delay times post and >> am having a bit of trouble with my compressor. Basically, apart from my >> problems with averaging and rms stuff, i am having trouble with the >> 'peak' version of my compressor. I am not too sure about my envelope >> implementation (i'm working with java, btw), and i'm not too sure if i'm >> working out the currentCompressionRatio correctly. When i detect some >> samples over the threshold (ratio is set in db's, and already converted >> to amplitudes by the time it hits this method/function), all i do is >> divide by the currenCompressionRatio. Is that correct? >> > For a start, it only compresses during attack. So it has an infinitely > short release... which will sound distorted. > > Also, the compression 'ratio' doesn't act like a ratio; it doesn't care > how /far/ over the threshold the signal is, > it just attacks -whilst- the signal is over the threshold. > > I posted a description of how to implement a compressor before, and it got > ignored. > > I may even have posted a reference to Zolzer's Digital Audio Signal > Processing. If I didn't, I should have. It contains a section on this. > It's on the musicdsp booklist. > >> I've attached my code below, if anyone could have a quick look at it in >> case there is something obvious, i'd appreciate that. It's a snippet, >> with no surplus stuff. I've commented it out the attackIncrement code i >> was using - i changed it after looking at the envelope follower code on >> the dsp archives (gave me errors if attack - 0ms anyway) >> > This fella will kick the compression in, which will be at some arbitrary > level, whenever you cross the threshold. > > The attack time is not an attack time, but a time for 'soaking up' gain > reduction - which isn't what it's supposed to be. > The ratio has nothing to do with signal level excursion here. > > Suppose I put in an impulse of 0.5, what compression do I get? > Now an impulse of 1.0? The compression is the same. > > This isn't a compressor, because it doesn't do what a compressor does. > > I am quite certain that when you get this sounding good, it will be a very > marketable dynamics processor, with a unique, signature sound. I will > probably buy a copy. > > But it's not a compressor. > >> Thanks a lot guys, i hope someone can see what i'm doing wrong. The sound >> is distorted and doesn't 'pump' at all. It just sounds clipped. >> > Just because I like to repeat myself, here again is what a compressor > does, and how it works. > > You've nearly hit on the sidechain vs audio path structure, but not quite. > Your loop should be: > > for (each sample) > get input > gain_coeff=sidechain_function(input) > put input*gain_coeff > end > > This is nearly what you have here, but please note the > outputSample=input[n] line, which will output the input sample 'as is' > when the compressor is in release. This you certainly do not mean. > > As for how a sidechain should work, I refer your to Zolzer, who puts it > thus: > > sidechain_function(input) > num_dbs = 20log10 ( abs(input) ) > excursion = num_dbs - threshold_in_dbs > if (excursion > 0) > correction = excursion * ((1/ratio) - 1) > else > correction = 0 > > if (correction > current_correction) > current_correction = current_correction * attack_coeff + > correction*(1-attack_coeff) > else > current_correction = current_correction * (1-release_coefficient) + > correction*release_coefficient > > return 10^(current_correction/20) > end > > This needs analysis. Firstly, you log. You can avoid this stage when > optimising your implementation, but not now. > You find out how many dbs above the threshold you are. Then you calculate > how many dbs of gain reduction are > implied by the ratio. If you are below the threshold, you want 0 gain > reduction, if you are above the threshold, > you want -something dbs of reduction. > > Then, you implement two parallel 1st order single pole filters for the > attack and the release. > Now, you convert from dbs to the actual number to multiply by. Observe > that this value should always be negative. > Return the gain multiplier and finish. > > This is roughly how Zolzer presents his compressor in DASP, and I think > that it's the standard reference for beginning work > on dynamics processors. > > All of the above can be modified in innumerable ways, but this is the > 'theoretical' technique. > > Dave. > > -- > dupswapdrop -- the music-dsp mailing list and website: subscription info, > FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From eddie at roughproductions.co.uk Mon Nov 15 09:54:37 2004 From: eddie at roughproductions.co.uk (Eddie Al-Shakarchi) Date: Sun Jan 21 12:10:34 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? References: <001301c4cb07$6203ead0$030200c0@australia><40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk> <002f01c4cb20$c56ca440$030200c0@australia> Message-ID: <003a01c4cb23$0a0721f0$030200c0@australia> you were also correct that when i compressed when under threshold also, the distortion went away. now i'll carry on reading to find out how to make it a real compressor edd ----- Original Message ----- From: "Eddie Al-Shakarchi" To: "a list for musical digital signal processing" Sent: Monday, November 15, 2004 2:38 PM Subject: Re: [music-dsp] Why does my compressor sound so bad/distorted? > wow, thank you for that, i will print it off and read it all again > thoroughly immediately! > > thank you again > > Eddie > From jchandjr at bellsouth.net Mon Nov 15 10:50:48 2004 From: jchandjr at bellsouth.net (James Chandler Jr) Date: Sun Jan 21 12:10:34 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? References: <001301c4cb07$6203ead0$030200c0@australia><40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk> <002f01c4cb20$c56ca440$030200c0@australia> Message-ID: <00c901c4cb2a$e19c2c30$6401a8c0@JamesCompaq3080> Hi Eddie In case it might help, there is a compressor-related music-dsp message here-- http://music.calarts.edu/pipermail/music-dsp/2004-February/026064.html At the bottom of the message is the source code guts of a conventional-behaving compressor-expander that works OK as far as I can tell. It is written in pascal with a bit of asm. Regardless of language, might be worth a look-thru for ideas. To avoid lots of log calculations during the processing loop, it uses a gain lookup table calculated according to the compressor's knob settings. When the user changes a panel knob, the gain lookup table is recalculated. The little bits of asm are just an attempt to speed up the interpolatation into the gain lookup table. Even if you want to do log calculations in your audio loop, or use plain java to lookup gain table values, whatever, there might be useful stuff in the envelope detector code or whatever. For code comprehension, would like to emphasize-- the variables 'MinGain' and 'TmpMinGain' are SOLELY for drawing the on-screen gain reduction meter. Those vars don't have anything to do with the audio processing. JCJR From pmcleod at cs.otago.ac.nz Mon Nov 15 19:00:25 2004 From: pmcleod at cs.otago.ac.nz (Philip Mcleod) Date: Sun Jan 21 12:10:34 2007 Subject: [music-dsp] Zero padded FFT's vs Discrete Cosine/Sine Transform In-Reply-To: Message-ID: I am doing alot of autocorrelations, using using the following method - Zero pad data window to twice its length - FFT - Square and abs (or imag part times real part) of the co-efficients - IFFT Is it possible to use a Discrete Cosine and sine transforms instead of an FFT - without having to zero pad to get the same result. I.e. saving some computation? Is this common practice? I really don't under stand the DCT and DST that well, maybe this dosn't work. Just wondering whether it is worth spending time looking into this. Also my data windows are overlapping sometimes 50% or 75%. Is it possible to store some partially computed values from previous FFT's or DCT's to speed up the next one which is overlapped? Any references or feedback would be great. Phil From kvos at qualcomm.com Mon Nov 15 19:48:18 2004 From: kvos at qualcomm.com (Koen Vos) Date: Sun Jan 21 12:10:34 2007 Subject: [music-dsp] Zero padded FFT's vs Discrete Cosine/Sine Transform In-Reply-To: References: Message-ID: <6.0.0.22.2.20041115160401.03be6ec0@qcmail1.qualcomm.com> With some work you could indeed replace the IFFT by an IDCT operating on only the positive frequencies. But that probably won't gain you much, as this IDCT is often implemented with the same IFFT you just eliminated :) Are you applying a window (eg Hanning) to your data before the FFT? That would complicate the reuse of results from previous overlapping windows. Other things you could look into: 1. No need to zero pad the data al the way to twice the length. You only need as many zeros as the order of the autocorrelation you're after (10th order ac -> 10 zeros). Padding more zeros won't change your final result. 2. Both your FFT and IFFT operate on real data (I presume). FFTs exist that are optimized for real data. Alternatively, you can use a single FFT to compute two spectra, by placing the two data vectors in the real and imaginary parts of the FFT input. Afterwards you'll need to "unscramble" the result, using properties of (anti-)symmetry of the spectra of real and imaginary data. Similar for the IFFT. Or use a single FFT to compute the Fourier transform of the current window and the inverse Fourier transform of the previous window. 3. If you need just a few autocorrelation coefficients, compute them directly in time. koen. At 04:00 PM 11/15/2004, Philip Mcleod wrote: >I am doing alot of autocorrelations, using using the following method >- Zero pad data window to twice its length >- FFT >- Square and abs (or imag part times real part) of the co-efficients >- IFFT > >Is it possible to use a Discrete Cosine and sine transforms instead >of an FFT - without having to zero pad to get the same result. I.e. saving >some computation? >Is this common practice? >I really don't under stand the DCT and DST that well, maybe this dosn't >work. >Just wondering whether it is worth spending time looking into this. > >Also my data windows are overlapping sometimes 50% or 75%. >Is it possible to store some partially computed values from previous FFT's >or DCT's to speed up the next one which is overlapped? > >Any references or feedback would be great. > >Phil From joshscholar at yahoo.com Mon Nov 15 20:13:52 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:34 2007 Subject: [music-dsp] Zero padded FFT's vs Discrete Cosine/Sine Transform References: Message-ID: <000b01c4cb79$8bd9e1d0$30e22641@antssoftware.com> Yes it's possible to save some calculation with a special cased overlapping FFT. I don't have time to calculate exactly how it works - but that won't save you anything on your IFTs so there's still a significant limit on your savings. ----- Original Message ----- From: Philip Mcleod To: a list for musical digital signal processing Sent: Monday, November 15, 2004 4:00 PM Subject: [music-dsp] Zero padded FFT's vs Discrete Cosine/Sine Transform I am doing alot of autocorrelations, using using the following method - Zero pad data window to twice its length - FFT - Square and abs (or imag part times real part) of the co-efficients - IFFT Is it possible to use a Discrete Cosine and sine transforms instead of an FFT - without having to zero pad to get the same result. I.e. saving some computation? Is this common practice? I really don't under stand the DCT and DST that well, maybe this dosn't work. Just wondering whether it is worth spending time looking into this. Also my data windows are overlapping sometimes 50% or 75%. Is it possible to store some partially computed values from previous FFT's or DCT's to speed up the next one which is overlapped? Any references or feedback would be great. Phil -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From rbj at surfglobal.net Mon Nov 15 21:13:12 2004 From: rbj at surfglobal.net (robert bristow-johnson) Date: Sun Jan 21 12:10:34 2007 Subject: [music-dsp] Zero padded FFT's vs Discrete Cosine/Sine Transform In-Reply-To: <6.0.0.22.2.20041115160401.03be6ec0@qcmail1.qualcomm.com> Message-ID: on 11/15/2004 19:48, Koen Vos at kvos@qualcomm.com wrote: > With some work you could indeed replace the IFFT by an IDCT operating on > only the positive frequencies. But that probably won't gain you much, as > this IDCT is often implemented with the same IFFT you just eliminated :) > > Are you applying a window (eg Hanning) to your data before the FFT? That > would complicate the reuse of results from previous overlapping windows. > > Other things you could look into: > > 1. No need to zero pad the data al the way to twice the length. You only > need as many zeros as the order of the autocorrelation you're after (10th > order ac -> 10 zeros). Padding more zeros won't change your final result. when we square and abs in one domain (in this case, the discrete frequency domain), we are multiplying two spectrums together, X[k] and conj(X[k]). multiplying in one domain means convoluting in the other and with the DFT (or FFT) that means circular convolution. if we don't zero pad to twice the length, is there not a danger of aliasing? maybe it's not a problem for autocorrelation, but it's not immediately obvious to me why not. > 2. Both your FFT and IFFT operate on real data (I presume). FFTs exist that > are optimized for real data. Alternatively, you can use a single FFT to > compute two spectra, by placing the two data vectors in the real and > imaginary parts of the FFT input. Afterwards you'll need to "unscramble" > the result, using properties of (anti-)symmetry of the spectra of real and > imaginary data. Similar for the IFFT. that's a good old trick. useful for fast convolution. better use a good floating-point FFT. don't do this with small word-size because one data vector will contaminate the other, due to quantization. > Or use a single FFT to compute the > Fourier transform of the current window and the inverse Fourier transform > of the previous window. that's a trick i never thought of. instead of doing things two buffers at a time. it shouldn't be much different in computational burden but should simplify the code. > 3. If you need just a few autocorrelation coefficients, compute them > directly in time. if it's pitch detection, there are likely some he won't need. if it's LPC or similar, he'll need them all. r b-j > At 04:00 PM 11/15/2004, Philip Mcleod wrote: >> I am doing alot of autocorrelations, using using the following method >> - Zero pad data window to twice its length >> - FFT >> - Square and abs (or imag part times real part) of the co-efficients >> - IFFT >> >> Is it possible to use a Discrete Cosine and sine transforms instead >> of an FFT - without having to zero pad to get the same result. I.e. saving >> some computation? >> Is this common practice? >> I really don't under stand the DCT and DST that well, maybe this dosn't >> work. >> Just wondering whether it is worth spending time looking into this. >> >> Also my data windows are overlapping sometimes 50% or 75%. >> Is it possible to store some partially computed values from previous FFT's >> or DCT's to speed up the next one which is overlapped? From kvos at qualcomm.com Tue Nov 16 00:11:49 2004 From: kvos at qualcomm.com (Koen Vos) Date: Sun Jan 21 12:10:34 2007 Subject: [music-dsp] Zero padded FFT's vs Discrete Cosine/Sine Transform In-Reply-To: References: <6.0.0.22.2.20041115160401.03be6ec0@qcmail1.qualcomm.com> Message-ID: <6.0.0.22.2.20041115204048.01a964a0@qcmail1.qualcomm.com> At 06:13 PM 11/15/2004, Robert Bristow-Johnson wrote: >when we square and abs in one domain (in this case, the discrete frequency >domain), we are multiplying two spectrums together, X[k] and conj(X[k]). >multiplying in one domain means convoluting in the other and with the DFT >(or FFT) that means circular convolution. if we don't zero pad to twice the >length, is there not a danger of aliasing? Pad your data vector with d zeros. Then do a circular convolution with itself. Of the result, the first d+1 values are not affected by the wrap-around of the circular convolution; they would have been the same with a regular convolution. The aliasing thus occurs for the higher-order autocorrelation coefficients only. And implementing the circular convolution with (I)FFTs doesn't matter for the result. >that's a good old trick. useful for fast convolution. I think a single IFFT can in fact compute 4 autocorrelation sequences from 4 power spectra. A power spectrum is both symmetric and real. >instead of doing things two buffers at a >time. it shouldn't be much different in computational burden but should >simplify the code. Pipelined instead of parallel. koen. From ansum at online.de Tue Nov 16 06:06:38 2004 From: ansum at online.de (Andreas Sumerauer) Date: Sun Jan 21 12:10:34 2007 Subject: [music-dsp] Doppler shift In-Reply-To: <20041112195757.54916171894C@music.calarts.edu> References: <20041112195757.54916171894C@music.calarts.edu> Message-ID: <4199DF3E.5060107@online.de> Anders, > One cheap hack to consider is pushing the shift further back, into the > control signals, rather than doing it on audio. You could also consider a combination of both approaches: Have the oscillator(noise generator) run at at a higher pitch and in case of audio files upsample them beforehand (the ratio is determined by the highest speed that an approaching object can have) During playback you then only have to downsample the signal according to its speed. This has two benefits: no need to have the playback buffer prefilled as Eli pointed out and very nice too: There is practically no need to bother with those expensive anti aliasing filters at runtime. Instead of using upsampling and/or relatively long interpolation filters You could also try and use a short allpass interpolator. It computes fast and has no high frequency rolloff. It will of course introduce a frequency dependent phase shift (and a couple of other minor artefacts) but in many situations this can be easier afforded than using scarse computing power for the higher quality signal. A listening test should tell which way to go. Andreas Eli Brandt wrote: > Anders Clerwall wrote: > >>Thanks guys for the information, I will of course have to bite the = >>bullet and do it the obvious way. > > > One cheap hack to consider is pushing the shift further back, into the > control signals, rather than doing it on audio. If you're > Doppler-shifting an oscillator, do it by varying the oscillator's > pitch. This hack only gets you so far, but it's nice and manageable > up to a point. Yeah, strictly speaking you'll have to stretch the > envelope too, and for large shifts it sounds poor if you skimp on > that, but for small shifts you can get away without it. > > (As you suspect, doing Doppler shift directly with a variable delay > can be a pain. For example, at the moment an approaching source > becomes audible, its Doppler delay line needs to have been prefilled > by a certain amount, since it will be playing back fast, depleting > this prefill. And in a real-time system you can't compute this > prefill material just when it's needed, so you have to do some > lookahead.) > From pmcleod at cs.otago.ac.nz Tue Nov 16 06:31:31 2004 From: pmcleod at cs.otago.ac.nz (Philip Mcleod) Date: Sun Jan 21 12:10:34 2007 Subject: [music-dsp] Zero padded FFT's vs Discrete Cosine/Sine Transform In-Reply-To: <6.0.0.22.2.20041115204048.01a964a0@qcmail1.qualcomm.com> Message-ID: > Are you applying a window (eg Hanning) to your data before the FFT? That > would complicate the reuse of results from previous overlapping windows. In one algorithm yes, and another no. But improving effieciency in either would be great. > Yes it's possible to save some calculation with a special cased overlapping > FFT. I don't have time to calculate exactly how it works - but that won't > save you anything on your IFTs so there's still a significant limit on your > savings. Saving on just the overlapping FFT would be Great! Do you have some references? Do you store sub values within the Radix-2 algorithm? Maybe you can give me some more hints when you have time, and I can figure the rest out. > 1. No need to zero pad the data al the way to twice the length. You only > need as many zeros as the order of the autocorrelation you're after (10th > order ac -> 10 zeros). Padding more zeros won't change your final result. Good point. I am using the first half of the co-efficients, so I only need to zero pad an extra half the length. > 2. Both your FFT and IFFT operate on real data (I presume). FFTs exist that > are optimized for real data. Yes. The data is real. It is Sound waves. And yip, I am using them optimized for real data. But I just discovered on the fftw.org website they discuss what is called a Pruned FFT, which is what I think I was initially looking for. The speed up could be a little, i'll look into it some more. > > 3. If you need just a few autocorrelation coefficients, compute them > > directly in time. > > if it's pitch detection, there are likely some he won't need. if it's LPC > or similar, he'll need them all. Yes, I am using it in pitch detection. I am actually using it in a modified Auto Square Difference Function (ASDF) that i'm working on. I need the first n/2 coefficients - where n is the original data window size (before zero padding). Why would I not be needing many? Computing this many in time domain is much slower when I have window sizes of 1024 or 2048 typically. But good suggestion. Phil From eddie at roughproductions.co.uk Tue Nov 16 11:38:20 2004 From: eddie at roughproductions.co.uk (Eddie Al-Shakarchi) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? References: <001301c4cb07$6203ead0$030200c0@australia> <40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk> Message-ID: <000801c4cbfa$b23b26a0$030200c0@australia> Hi dave, and all I've implemented a compressor as you described, but i'm getting strange results. I think the main problem is to do with my attack/delay envelopes (ie how i've coded them). my main for loop does indeed now call a side chain as described (for each sample gainCoefficient = gainSideChain(input[n], attackIncrement, releaseIncrement), then times this coefficient by the input sample). However the code for the attack/delay envelope is wierd. If i use, as i originally was using: attackIncrement = (float)compressionRatio / (float)attackTime; releaseIncrement = (float)compressionRatio / (float)releaseTime; where compression ratio could be '2' (for 2:1 ratio) and attack time is actually in samples (eg 441 samples for 10ms attack). Then using the sidechain method i get and extremely small returned value (like 0.003...etc for many samples). It does this for all samples, and if the ratio is anything over 1.1:1 then it practically zero's the whole wave. If i use some code from the music dsp archives: attackIncrement = (float)(Math.pow(0.01, -1.0 / attackTime)); releaseIncrement = (float)(Math.pow(0.01, -1.0 / releaseTime)); Then the value returned is larger the 1 and so actually 'expands' the values. I cant' really tell what i'm doing wrong - i think also i'm confused with the conversion between db's and samples. Once we've worked out how many db's the wave must be reduced by, shouldn't we convert back to samples? Any help *at all* would be appreciated Thanks to all Eddie From eddie at roughproductions.co.uk Tue Nov 16 11:48:30 2004 From: eddie at roughproductions.co.uk (Eddie Al-Shakarchi) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? References: <001301c4cb07$6203ead0$030200c0@australia> <40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk> Message-ID: <000d01c4cbfc$1d5a22a0$030200c0@australia> Hi Sorry to spam - but this is the code for my compressors sidechain, it's basically as you gave, i think it's ok? public float gainSideChain(short input, float attackCoefficient, float releaseCoefficient) { /* Omitted for dsp mailing list - Variable Declaration */ numOfDbs = (float)(20 * Math.log(Math.abs(input))); excursion = numOfDbs - thresholdInDBs; if (excursion > 0) { correction = (float)(excursion * ((1/compressionRatio) - 1)); } else {correction = 0; } // This is the two parallel 1st order single pole filters for attack and the release if (correction > currentCorrection) { currentCorrection = ((float)(currentCorrection * attackCoefficient) + (correction * (1 - attackCoefficient))); } else { // Then release currentCorrection = ((float)(currentCorrection * releaseCoefficient) + (correction * (1 - releaseCoefficient))); } gain = ((float)Math.pow(10, (currentCorrection/20))); return gain; } Thanks again From signalzerodb at yahoo.co.uk Tue Nov 16 12:26:21 2004 From: signalzerodb at yahoo.co.uk (Dave Gamble) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? In-Reply-To: <000801c4cbfa$b23b26a0$030200c0@australia> References: <001301c4cb07$6203ead0$030200c0@australia> <40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk> <000801c4cbfa$b23b26a0$030200c0@australia> Message-ID: On 16 Nov 2004, at 16:38, Eddie Al-Shakarchi wrote: > Hi dave, and all > Hi, :) > I've implemented a compressor as you described, but i'm getting > strange results. I think the main problem is to do with my > attack/delay envelopes (ie how i've coded them). my main for loop does > indeed now call a side chain as described (for each sample > gainCoefficient = gainSideChain(input[n], attackIncrement, > releaseIncrement), then times this coefficient by the input sample). > However the code for the attack/delay envelope is wierd. If i use, as > i originally was using: > > attackIncrement = (float)compressionRatio / (float)attackTime; > releaseIncrement = (float)compressionRatio / (float)releaseTime; > attackIncrement and releaseIncrement aren't really 'increments' as such, using this approach. Since the code you're using uses 1st order filters, it's exponential now. As such, you're looking for aI and rI between 0 and 1. Also, the attack time and release time shouldn't depend on the ratio - unless you're working on something very clever, like an intelligent compressor! But in that case, you'd be explicitly adjusting them, rather than using them directly like this. > where compression ratio could be '2' (for 2:1 ratio) and attack time > is actually in samples (eg 441 samples for 10ms attack). Then using > the sidechain method i get and extremely small returned value (like > 0.003...etc for many samples). Hmm... > It does this for all samples, and if the ratio is anything over 1.1:1 > then it practically zero's the whole wave. If i use some code from the > music dsp archives: > What is your threshold set to? Try -6, just as a test. Then, try 0. > attackIncrement = (float)(Math.pow(0.01, -1.0 / attackTime)); > releaseIncrement = (float)(Math.pow(0.01, -1.0 / releaseTime)); > This is a little odd... I don't use quite this stuff... I think you might be out by a minus sign here. > Then the value returned is larger the 1 and so actually 'expands' the > values. I cant' really tell what i'm doing wrong You've missed something very subtle (so there's no shame in having missed it!! ;-) correction = (float)(excursion * ((1/compressionRatio) - 1)); } Consider that compressionRatio is always positive, so 1/compressionRatio is positive. Now, assuming compressionRatio is always greater than 1, this makes 1/compressionRatio always less than 1. Which makes (1/compressionRatio)-1 always negative. So, correction is negative. It's a negative number. You attack when the correction is more negative, so change this: if (correction > currentCorrection) { to: if (correction < currentCorrection) { Now, for my benefit, change this: currentCorrection = ((float)(currentCorrection * attackCoefficient) + (correction * (1 - attackCoefficient))); to: currentCorrection = ((float)(currentCorrection * (1-attackCoefficient)) + (correction * attackCoefficient)); and change: currentCorrection = ((float)(currentCorrection * releaseCoefficient) + (correction * (1 - releaseCoefficient))); to: currentCorrection = ((float)(currentCorrection * (1-releaseCoefficient)) + (correction * releaseCoefficient)); Okies, here's the groundwork you'll be interested in: attackCoefficient is a number between 0 and 1, representing the percentage (if you will) of the difference that gets made up in one sample. releaseCoefficient is a number between 0 and 1, representing the percentage of the compression which is lost in one sample. For a Very fast attack, you might see 0.5. For a slow attack, 0.0001 is expected. For a slow release - a few seconds at 192k, it'll be so small you might need a double to store it! The standard way of calculating these things is like this: attackCoefficient= 1- exp(-1/(time_in_sec*samples_per_second)) releaseCoefficient=1- exp(-1/(time_in_sec*samples_per_second)) samples_per_second is just the sample rate - the number of samples, per second, i.e. 44100 time_in_sec is the time, in seconds, of the attack time. You will probably want to change the exp(-1/ bit to exp(-something_else/, since -1 doesn't feel particularly intuitive. You'll be pleased to know that there's no official standard on that. :) > - i think also i'm confused with the conversion between db's and > samples. Once we've worked out how many db's the wave must be reduced > by, shouldn't we convert back to samples? The last line of your code does just that. return pow(10,currentCorrection/20); remember, sample=pow(10,db/20). There's your conversion back to samples :) > Any help *at all* would be appreciated > Hope this helps, Dave. From kvos at qualcomm.com Tue Nov 16 17:45:13 2004 From: kvos at qualcomm.com (Koen Vos) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Zero padded FFT's vs Discrete Cosine/Sine Transform In-Reply-To: References: <6.0.0.22.2.20041115204048.01a964a0@qcmail1.qualcomm.com> Message-ID: <6.0.0.22.2.20041116142601.03c1acd0@qcmail1.qualcomm.com> > > Are you applying a window (eg Hanning) to your data before the FFT? > >In one algorithm yes, and another no. But improving effieciency in either >would be great. What I had in mind was calculating the autocorrelation for only the new data since the previous window. And then add several (2/4 for 50/75% overlap) of these vectors to obtain the autocorrelation vector of your complete window. However, this doesn't give the same result as what you're doing now, and the error increases with the autocorrelation lag. Since you're using so many autocorrelation values, this won't work for you. There might be better ways though. >I am actually using it in a >modified Auto Square Difference Function (ASDF) that i'm working on. Sounds interesting, but what is it? >Why would I not be needing many? For linear prediction you need just a few autocorrelation values (as R B-J also mentioned). koen. From rbj at surfglobal.net Tue Nov 16 19:45:16 2004 From: rbj at surfglobal.net (robert bristow-johnson) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Zero padded FFT's vs Discrete Cosine/Sine Transform In-Reply-To: <6.0.0.22.2.20041116142601.03c1acd0@qcmail1.qualcomm.com> Message-ID: on 11/16/2004 17:45, Koen Vos at kvos@qualcomm.com wrote: > >> Why would I not be needing many? > > For linear prediction you need just a few autocorrelation values (as R B-J > also mentioned). dunno exactly what i wrote, but i *meant* the opposite. for pitch-detection, you might not need many autocorrelation values if you already have an idea of what the pitch is. but, i think, to do LPC, you need all of the autocorrelation values up to the reciprocal of the lowest frequency of interest. ain't that the case? -- r b-j From kvos at qualcomm.com Tue Nov 16 23:02:24 2004 From: kvos at qualcomm.com (Koen Vos) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Zero padded FFT's vs Discrete Cosine/Sine Transform In-Reply-To: References: <6.0.0.22.2.20041116142601.03c1acd0@qcmail1.qualcomm.com> Message-ID: <6.0.0.22.2.20041116193822.030407c0@qcmail1.qualcomm.com> Robert Bristow-Johnson wrote: >but, i think, to do LPC, you >need all of the autocorrelation values up to the reciprocal of the lowest >frequency of interest. That's the number you need to capture all individual harmonics of a periodic signal. LPC is also used for all-pole modeling the spectral envelope of a signal, without necessarily resolving any harmonics. Then, a low order (10 ~ 30) is typically sufficient. koen. From eddie at roughproductions.co.uk Wed Nov 17 06:07:01 2004 From: eddie at roughproductions.co.uk (Eddie Al-Shakarchi) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? References: <001301c4cb07$6203ead0$030200c0@australia><40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk><000801c4cbfa$b23b26a0$030200c0@australia> Message-ID: <002401c4cc95$934df650$030200c0@australia> hi dave >> It does this for all samples, and if the ratio is anything over 1.1:1 >> then it practically zero's the whole wave. >> > What is your threshold set to? Try -6, just as a test. Then, try 0. By default, the threshold is set to -20db (actually -19.9, 2:1 ratio, 6ms attack, 12ms release - same as logic) - i've tried it at several different levels and it seems to have the same affect. it seems like the whole wave is being affected? If i set the ratio to 1 then the wave stays the same size (obviously) - if i increase it to 2, everything is increased. i've tried -6 and 0db thresholds, and it still affects the whole wave! I've tried -50db and 0db, there is only a tiny difference in the waveform (in that both are not the same as the uncompressed wave, and but vary in size slightly (-50db is slightly larger). if i set threshold to 0db, it shouldn't really change anything. The gainCoefficient is still greater than 1. In my 'test' wav., there is a quiet part at the beginning, it should be way under the compressors radar, and so the gainCoefficient should be 1, but it never is, unless the samples amplitude is 0. Perhaps it's impossible to avoid changing the amplitude of the samples below the threshold slightly. But surely 1 should be the MAX of the gain coefficient, and that is for samples under threshold only. So currentCorrection is not negative by the time it reaches the final equation? Sorry i'm trying to work it through in my head! currentCompression greater/less than 1 issue aside, i am confused/worried that samples under the threshold (BEFORE the threshold has even been exceeded) are being changed? > You've missed something very subtle (so there's no shame in having missed > it!! ;-) > correction = (float)(excursion * ((1/compressionRatio) - 1)); } > > Consider that compressionRatio is always positive, so > 1/compressionRatio > is positive. Now, assuming compressionRatio is always greater than 1, > this makes/compressionRatio always less than 1. Which makes > (1/compressionRatio)-1 always negative. So, correction is negative. It's a > negative number. You attack when the correction is more negative, so > change this: > > if (correction > currentCorrection) { > to: > if (correction < currentCorrection) { Done! :-) > Now, for my benefit, change this: > currentCorrection = ((float)(currentCorrection * attackCoefficient) + > (correction * (1 - attackCoefficient))); > to: > currentCorrection = ((float)(currentCorrection * (1-attackCoefficient)) > + (correction * attackCoefficient)); > > and change: > currentCorrection = ((float)(currentCorrection * releaseCoefficient) + > (correction * (1 - releaseCoefficient))); > to: > currentCorrection = ((float)(currentCorrection * (1-releaseCoefficient)) > + (correction * releaseCoefficient)); Done - I am not 100% in my understanding of this however - this could be the reason i am getting strange results? > The standard way of calculating these things is like this: > attackCoefficient= 1- exp(-1/(time_in_sec*samples_per_second)) > releaseCoefficient=1- exp(-1/(time_in_sec*samples_per_second)) Surprisingly, i've adopted this too ;-) Thanks Cheers dave Eddie From eddie at roughproductions.co.uk Wed Nov 17 06:17:56 2004 From: eddie at roughproductions.co.uk (Eddie Al-Shakarchi) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? References: <001301c4cb07$6203ead0$030200c0@australia><40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk><000801c4cbfa$b23b26a0$030200c0@australia> <002401c4cc95$934df650$030200c0@australia> Message-ID: <003501c4cc97$19f919e0$030200c0@australia> The problem may be to do with the 'excursion' code. If i do: numOfDbs = (float)(20 * Math.log(Math.abs(input))); excursion = numOfDbs - thresholdInDBs; if (excursion > 0) { correction = (float)(excursion * ((1/compressionRatio) - 1)); System.out.println("test 1"); } else { correction = 0; System.out.println("test 2"); Then of course, unless the amplitude of the sample was 0, then if (excursion > 0) will always be true (i.e it will always print test 1). Shouldn't samples under the threshold have correction = 0? Eddie From urs at u-he.com Wed Nov 17 07:21:24 2004 From: urs at u-he.com (Urs Heckmann) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? In-Reply-To: <003501c4cc97$19f919e0$030200c0@australia> References: <001301c4cb07$6203ead0$030200c0@australia><40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk><000801c4cbfa$b23b26a0$030200c0@australia> <002401c4cc95$934df650$030200c0@australia> <003501c4cc97$19f919e0$030200c0@australia> Message-ID: <3263FD83-3893-11D9-BDD1-000A9595B180@u-he.com> schrieb Eddie Al-Shakarchi: > excursion = numOfDbs - thresholdInDBs; > > if (excursion > 0) > > Then of course, unless the amplitude of the sample was 0, then if > (excursion > 0) will always be true (i.e it will always print test 1). > Shouldn't samples under the threshold have correction = 0? Huh? - excursion is greater than zero only if the input sample is greater than the threshold. If for instance the input sample is 0.25 and threshold is (float)(20 * Math.log(0.3)), excursion > 0 will not be true... Hihihi, you should take some sleep for a couple of hours 8-)) Cheers, ;) Urs urs heckmann urs@u-he.com www.u-he.com From eddie at roughproductions.co.uk Wed Nov 17 07:45:23 2004 From: eddie at roughproductions.co.uk (Eddie) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? References: <001301c4cb07$6203ead0$030200c0@australia><40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk><000801c4cbfa$b23b26a0$030200c0@australia><002401c4cc95$934df650$030200c0@australia><003501c4cc97$19f919e0$030200c0@australia> <3263FD83-3893-11D9-BDD1-000A9595B180@u-he.com> Message-ID: <000e01c4cca3$514ccde0$030200c0@australia> Hi. You're right, i am knackered. Coffee time! I think my units may be wrong though. Input is a (short) amplitude value between -32767 and 32767. Also threshold is in (negative) db's, as this is how i thought dave said it should be? Basically the input sample in db's will *nearly* always be greater than the threshold: A 'loud' sample of amplitude 30,000 will be nearly 90db. A quieter sample with amplitude of only 100 STILL has a db value of 40db. This is much higher than the default threshold of 19.9, or -19.9. i guess, i should be converting back to linear, as that would be easier to compare. That's what i was doing last time. Instead of using 19.9db's as the value, i'd do: thresholdLevel = (int)(Math.pow(10, (thresh/ 20)) * 32767); But now with this method i'm confused :-( Let me know if i'm being really dumb :-) Cheers urs Eddie ----- Original Message ----- From: "Urs Heckmann" To: "a list for musical digital signal processing" Sent: Wednesday, November 17, 2004 12:21 PM Subject: Re: [music-dsp] Why does my compressor sound so bad/distorted? > schrieb Eddie Al-Shakarchi: > >> excursion = numOfDbs - thresholdInDBs; >> >> if (excursion > 0) >> >> Then of course, unless the amplitude of the sample was 0, then if >> (excursion > 0) will always be true (i.e it will always print test 1). >> Shouldn't samples under the threshold have correction = 0? > > Huh? - excursion is greater than zero only if the input sample is greater > than the threshold. If for instance the input sample is 0.25 and threshold > is (float)(20 * Math.log(0.3)), excursion > 0 will not be true... > > Hihihi, you should take some sleep for a couple of hours 8-)) > > Cheers, > > ;) Urs > > > urs heckmann > urs@u-he.com > www.u-he.com > > -- > dupswapdrop -- the music-dsp mailing list and website: subscription info, > FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From urs at u-he.com Wed Nov 17 08:02:12 2004 From: urs at u-he.com (Urs Heckmann) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? In-Reply-To: <000e01c4cca3$514ccde0$030200c0@australia> References: <001301c4cb07$6203ead0$030200c0@australia><40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk><000801c4cbfa$b23b26a0$030200c0@australia><002401c4cc95$934df650$030200c0@australia><003501c4cc97$19f919e0$030200c0@australia> <3263FD83-3893-11D9-BDD1-000A9595B180@u-he.com> <000e01c4cca3$514ccde0$030200c0@australia> Message-ID: Am 17.11.2004 um 13:45 schrieb Eddie: > Let me know if i'm being really dumb :-) I think we all had tomatoes on our eyes 8-)) Your samples are integers between -32767 and 32767 while the examples Dave and others relied to want floating point numbers between -1.0 and +1.0. This is a little different, to say the least ;-) *ROTFL* I'd say that for each input sample you should do this: float inSample = (float) sample / 32767.0; and after calculation you should do int outSample = (int) ( compressedSample * 32767 ); There you go. Cheers, ;) Urs urs heckmann urs@u-he.com www.u-he.com From signalzerodb at yahoo.co.uk Wed Nov 17 08:34:01 2004 From: signalzerodb at yahoo.co.uk (Dave Gamble) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? In-Reply-To: References: <001301c4cb07$6203ead0$030200c0@australia><40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk><000801c4cbfa$b23b26a0$030200c0@australia><002401c4cc95$934df650$030200c0@australia><003501c4cc97$19f919e0$030200c0@australia> <3263FD83-3893-11D9-BDD1-000A9595B180@u-he.com> <000e01c4cca3$514ccde0$030200c0@australia> Message-ID: <57B2E000-389D-11D9-9292-000A958903DE@yahoo.co.uk> Hey, On 17 Nov 2004, at 13:02, Urs Heckmann wrote: > > Am 17.11.2004 um 13:45 schrieb Eddie: > >> Let me know if i'm being really dumb :-) > > I think we all had tomatoes on our eyes 8-)) > Hey Urs, How's stuff? :) > Your samples are integers between -32767 and 32767 while the examples > Dave and others relied to want floating point numbers between -1.0 and > +1.0. This is a little different, to say the least ;-) *ROTFL* > Gah. I should have guessed when he said .wav file! :-/ > I'd say that for each input sample you should do this: > > float inSample = (float) sample / 32767.0; > > and after calculation you should do > > int outSample = (int) ( compressedSample * 32767 ); > I'm 100% with you there :) Dave. From eddie at roughproductions.co.uk Wed Nov 17 08:51:46 2004 From: eddie at roughproductions.co.uk (Eddie) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? References: <001301c4cb07$6203ead0$030200c0@australia><40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk><000801c4cbfa$b23b26a0$030200c0@australia><002401c4cc95$934df650$030200c0@australia><003501c4cc97$19f919e0$030200c0@australia><3263FD83-3893-11D9-BDD1-000A9595B180@u-he.com><000e01c4cca3$514ccde0$030200c0@australia> <57B2E000-389D-11D9-9292-000A958903DE@yahoo.co.uk> Message-ID: <001c01c4ccac$980fccb0$030200c0@australia> ahhhhhhhhhhhhhhhhhhhhhhh! i knew something was fishy :-) can't i just do (in the main method, not the sidechain): float inSample = (float)(input[n]/ 32767.0); gainCoefficient = gainSideChain(inSample, attackIncrement, releaseIncrement); if (detection.equals("Peak")){ outputSample = (int)(input[n] * gainCoefficient); } and then i don't have to convert back again? it will just return a gainCoefficient which can be multiplied by the integer value input[n] in the if statement? would that be better? can i just ask guys - what do you program that requires you to use floating points between -1 and 1? I am coding DSP stuff in java for a piece of semi-scientific software and everything i've done so far has been self-taught. i am obviously just a beginner at this stuff, but really wanna get better. Cheers guys! Eddie ----- Original Message ----- From: "Dave Gamble" To: "a list for musical digital signal processing" Sent: Wednesday, November 17, 2004 1:34 PM Subject: Re: [music-dsp] Why does my compressor sound so bad/distorted? > Hey, > > On 17 Nov 2004, at 13:02, Urs Heckmann wrote: > >> >> Am 17.11.2004 um 13:45 schrieb Eddie: >> >>> Let me know if i'm being really dumb :-) >> >> I think we all had tomatoes on our eyes 8-)) >> > Hey Urs, How's stuff? :) > >> Your samples are integers between -32767 and 32767 while the examples >> Dave and others relied to want floating point numbers between -1.0 and >> +1.0. This is a little different, to say the least ;-) *ROTFL* >> > Gah. I should have guessed when he said .wav file! :-/ > >> I'd say that for each input sample you should do this: >> >> float inSample = (float) sample / 32767.0; >> >> and after calculation you should do >> >> int outSample = (int) ( compressedSample * 32767 ); >> > I'm 100% with you there :) > > Dave. > > -- > dupswapdrop -- the music-dsp mailing list and website: subscription info, > FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From signalzerodb at yahoo.co.uk Wed Nov 17 09:02:20 2004 From: signalzerodb at yahoo.co.uk (Dave Gamble) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? In-Reply-To: <001c01c4ccac$980fccb0$030200c0@australia> References: <001301c4cb07$6203ead0$030200c0@australia><40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk><000801c4cbfa$b23b26a0$030200c0@australia><002401c4cc95$934df650$030200c0@australia><003501c4cc97$19f919e0$030200c0@australia><3263FD83-3893-11D9-BDD1-000A9595B180@u-he.com><000e01c4cca3$514ccde0$030200c0@australia> <57B2E000-389D-11D9-9292-000A958903DE@yahoo.co.uk> <001c01c4ccac$980fccb0$030200c0@australia> Message-ID: <4C4BC791-38A1-11D9-9292-000A958903DE@yahoo.co.uk> On 17 Nov 2004, at 13:51, Eddie wrote: > ahhhhhhhhhhhhhhhhhhhhhhh! i knew something was fishy :-) can't i just > do (in the main method, not the sidechain): > > float inSample = (float)(input[n]/ 32767.0); > gainCoefficient = gainSideChain(inSample, attackIncrement, > releaseIncrement); > > if (detection.equals("Peak")){ > outputSample = (int)(input[n] * gainCoefficient); > } > But of course! > and then i don't have to convert back again? it will just return a > gainCoefficient which can be multiplied by the integer value input[n] > in the if statement? would that be better? > Ah; there's a trick here. To multiply a float by an int, the compiler adds in code to convert the int to a float, do the multiply with two floats, and casts back to an int. The formalised version of your line is: outputSample = (int)((float)input[n] * gainCoefficient); > can i just ask guys - what do you program that requires you to use > floating points between -1 and 1? Because we have all written too much RTAS/VST/AudioUnit code!! ;) All the plugin specs use floating-point data between -1 and 1. Also, consistency makes mistakes like this go away! Worrying about ints is not worth spending time on when prototyping an algorithm; just cast /everything/ to float, do all your DSP with floats or doubles, and sort out the converts explicitly on the way in and the way out. > I am coding DSP stuff in java for a piece of semi-scientific software > and everything i've done so far has been self-taught. i am obviously > just a beginner at this stuff, but really wanna get better. Cool! Good company name, btw! What's the semi-scientific software? Take care, Dave. From eddie at roughproductions.co.uk Wed Nov 17 09:35:41 2004 From: eddie at roughproductions.co.uk (Eddie) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? References: <001301c4cb07$6203ead0$030200c0@australia><40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk><000801c4cbfa$b23b26a0$030200c0@australia><002401c4cc95$934df650$030200c0@australia><003501c4cc97$19f919e0$030200c0@australia><3263FD83-3893-11D9-BDD1-000A9595B180@u-he.com><000e01c4cca3$514ccde0$030200c0@australia><57B2E000-389D-11D9-9292-000A958903DE@yahoo.co.uk><001c01c4ccac$980fccb0$030200c0@australia> <4C4BC791-38A1-11D9-9292-000A958903DE@yahoo.co.uk> Message-ID: <000801c4ccb2$ba2d9150$030200c0@australia> Hi! > Ah; there's a trick here. To multiply a float by an int, the compiler adds > in code to convert the int to a float, do the multiply with two floats, > and casts back to an int. The formalised version of your line is: > outputSample = (int)((float)input[n] * gainCoefficient); Cool :-) >> can i just ask guys - what do you program that requires you to use > Because we have all written too much RTAS/VST/AudioUnit code!! ;) > All the plugin specs use floating-point data between -1 and 1. > > Also, consistency makes mistakes like this go away! Worrying about ints is > not worth spending time on when prototyping an algorithm; just cast > /everything/ to float, do all your DSP with floats or doubles, and sort > out the converts explicitly on the way in and the way out. > Thanks mate :-) It's the kinda advice i need! I hope to, in my spare time, possibly, convert some of my algorithms over to vst/AU's - the software i'm coding for is called triana www.triana.co.uk - it allows users to create their own algorithms using some of the built in 'tool's. i'm making those tools - i'm coding all the audio stuff and kind of doing it 'topic' at a time - i've done delays, and from them built reverbs (and so the user can create their own versions of reverbs by grabbing/dragging comb filters/allpass filters and adding as many as their computers can take), a VariableDelay (where the settings can be changed to create a chorus/phaser/flanger) unit, and loads of other tools - like wave inverts, reverses, simple distortion. like i say i've done it 'topic' at a time, i've done time delay based effects, and lots of standard processing stuff - now i'm doing dynamics (i can use this code for an expander too, hopefully), i'll make a simple gate and limiter etc. then after this i'll work on EQ & filters.... which i don't know much about, other than the filters theory i learnt when doing the reverb stuff. there's still a long way to go, and i have to adapt and think about how to get it working with smaller chunks of audio, not all in one go (ie i had to adapt the delays/reverbs to work on chunks, was a brain killer at the time!) About the compressor (again - sorry!) - One thing i've noticed, is that when the samples aren'ta bove threshold then the gain = 1.0 - fantastic! but when it is, it still goes GREATER than 1, not smaller? the second thing is, when using: excursion = numOfDbs - thresholdInDBs; threshold is actually already a 'minus' - should it be postive or negative? many thanks guys Eddie > -- > dupswapdrop -- the music-dsp mailing list and website: subscription info, > FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From urs at u-he.com Wed Nov 17 09:36:48 2004 From: urs at u-he.com (Urs Heckmann) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? In-Reply-To: <57B2E000-389D-11D9-9292-000A958903DE@yahoo.co.uk> References: <001301c4cb07$6203ead0$030200c0@australia><40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk><000801c4cbfa$b23b26a0$030200c0@australia><002401c4cc95$934df650$030200c0@australia><003501c4cc97$19f919e0$030200c0@australia> <3263FD83-3893-11D9-BDD1-000A9595B180@u-he.com> <000e01c4cca3$514ccde0$030200c0@australia> <57B2E000-389D-11D9-9292-000A958903DE@yahoo.co.uk> Message-ID: <1CFA2036-38A6-11D9-BDD1-000A9595B180@u-he.com> schrieb Dave Gamble: > Hey Urs, How's stuff? :) Hahaha, it's growing ;-) ...been working on some insane things, like that (unfinished prototype): http://www.u-he.com/img/g-snapshot.jpg Kept me from doing other things... like posting my subversive half-finished paper on "branchless algorithms using comparison results without if" to the list, which will - if ever finished - contain sample code for a branchless adsr envelope and peak detection (see branchless hardsync oscillator source code I posted a couple of days ago, subject "Detecting phase cycle with Hoeldrich method.......")... sigh, where do all the hours go each and every day?!? >> Your samples are integers between -32767 and 32767 while the examples >> Dave and others relied to want floating point numbers between -1.0 >> and +1.0. This is a little different, to say the least ;-) *ROTFL* >> > Gah. I should have guessed when he said .wav file! :-/ Yep! Will be a funny anecdote anyway 8-)) > I'm 100% with you there :) Cool ;) Cheers, ;) Urs (sorry for posting a little off topic 8-) urs heckmann urs@u-he.com www.u-he.com From jchandjr at bellsouth.net Wed Nov 17 10:18:28 2004 From: jchandjr at bellsouth.net (James Chandler Jr) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? References: <001301c4cb07$6203ead0$030200c0@australia><40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk><000801c4cbfa$b23b26a0$030200c0@australia><002401c4cc95$934df650$030200c0@australia><003501c4cc97$19f919e0$030200c0@australia><3263FD83-3893-11D9-BDD1-000A9595B180@u-he.com><000e01c4cca3$514ccde0$030200c0@australia><57B2E000-389D-11D9-9292-000A958903DE@yahoo.co.uk> <001c01c4ccac$980fccb0$030200c0@australia> Message-ID: <01d801c4ccb8$b2b9b420$6401a8c0@JamesCompaq3080> From: "Eddie" > can i just ask guys - what do you program that requires you to use floating > points between -1 and 1? Hi Eddie In addition to the answer "most folks do it that way"... One might think up theoretical math reasons why it is easier to think about signals in that {-1..+1} nominal range. But some practical reasons-- 1. If all yer math uses that standard range (with float samples and double coefficients and calculations), you don't have to rewrite all your code if you buy a 24 bit sound card! Just add a new int->float->int converter module to yer code. There are so many different tower of babel sound file formats, it is convenient to divorce the sample format from your processing code. 2. If your sample converter code is well-behaved, you can count on a peak value of 1 being 0 dB, beyond which the output will clip, regardless of your sound card details. But, for internal calculations, the float samples have a wide safe dynamic range above 0 dB, as long as you wangle the levels back below 0 dB before sending data to the sound card. If saving to float format sound files (you can write float-format WAV files if you wish), it is 'safe' to let the signals exceed 0 dB in temp sound files, as long as you somewhere-along-the-line wangle the levels back below 0 dB before writing a final integer sound file or sending the data to a typical contemporary sound card. Perhaps some sound cards in the future will be marvelous float format gadgets that have some safe headroom above 0 dB? Dunno. Perhaps that would be an advantage, or maybe its better to always have 0 dB the point at which the output signal will clip? 3. There are some open source file-format converters, which will read/write numerous file formats, and allow you to work with standard-level floats in your code without having to reinvent the wheel for file i/o. Check out libsndfile-- http://www.mega-nerd.com/libsndfile/ Rolling yer own int->float->int converters is not rocket science, but there are edge cases to consider. A well written converter lib will have accounted for the edge cases. Also, perhaps such converters have been optimized for speed. An edge case-- I think a 16 bit -> float converter should be-- floatsample = intsample / 32768; intsample = floatsample * 32768; But there are other opinions. The above assures that no incoming float samples have a value exceeding +1.0 or -1.0. But if you output a value of +1.0, the above code will wrap around to -32768 and sound awful. Therefore sane sample format converter code must at least manage the +1.0 edge case by clipping to 32767 rather than wrapping around. Actually, converter code must make sure to clip all values that are too big to fit in the output sample format. That's just the way 2's complement integers work-- the positive excursion is 1 unit less than the negative excursion. In the past there were long music-dsp threads on the issue, if you are masochistic enough to search for them (GRIN). JCJR From eddie at roughproductions.co.uk Wed Nov 17 10:31:48 2004 From: eddie at roughproductions.co.uk (Eddie) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? References: <001301c4cb07$6203ead0$030200c0@australia><40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk><000801c4cbfa$b23b26a0$030200c0@australia><002401c4cc95$934df650$030200c0@australia><003501c4cc97$19f919e0$030200c0@australia><3263FD83-3893-11D9-BDD1-000A9595B180@u-he.com><000e01c4cca3$514ccde0$030200c0@australia><57B2E000-389D-11D9-9292-000A958903DE@yahoo.co.uk><001c01c4ccac$980fccb0$030200c0@australia> <01d801c4ccb8$b2b9b420$6401a8c0@JamesCompaq3080> Message-ID: <001301c4ccba$912fd170$030200c0@australia> wow! thanks for that james - i'm printing off posts like that and keeping them in a folder for reference and thorough reading! thanks again Eddie ps - dave or urs - any idea why the gain value is coming out greater than 1? thanks! ----- Original Message ----- From: "James Chandler Jr" To: "a list for musical digital signal processing" Sent: Wednesday, November 17, 2004 3:18 PM Subject: Re: [music-dsp] Why does my compressor sound so bad/distorted? > From: "Eddie" > >> can i just ask guys - what do you program that requires you to use >> floating points between -1 and 1? > > Hi Eddie > > In addition to the answer "most folks do it that way"... > > One might think up theoretical math reasons why it is easier to think > about signals in that {-1..+1} nominal range. > > But some practical reasons-- > > 1. If all yer math uses that standard range (with float samples and double > coefficients and calculations), you don't have to rewrite all your code if > you buy a 24 bit sound card! Just add a new int->float->int converter > module to yer code. > > There are so many different tower of babel sound file formats, it is > convenient to divorce the sample format from your processing code. > > 2. If your sample converter code is well-behaved, you can count on a peak > value of 1 being 0 dB, beyond which the output will clip, regardless of > your sound card details. But, for internal calculations, the float samples > have a wide safe dynamic range above 0 dB, as long as you wangle the > levels back below 0 dB before sending data to the sound card. > > If saving to float format sound files (you can write float-format WAV > files if you wish), it is 'safe' to let the signals exceed 0 dB in temp > sound files, as long as you somewhere-along-the-line wangle the levels > back below 0 dB before writing a final integer sound file or sending the > data to a typical contemporary sound card. > > Perhaps some sound cards in the future will be marvelous float format > gadgets that have some safe headroom above 0 dB? Dunno. Perhaps that would > be an advantage, or maybe its better to always have 0 dB the point at > which the output signal will clip? > > 3. There are some open source file-format converters, which will > read/write numerous file formats, and allow you to work with > standard-level floats in your code without having to reinvent the wheel > for file i/o. > > Check out libsndfile-- > > http://www.mega-nerd.com/libsndfile/ > > Rolling yer own int->float->int converters is not rocket science, but > there are edge cases to consider. A well written converter lib will have > accounted for the edge cases. Also, perhaps such converters have been > optimized for speed. > > An edge case-- I think a 16 bit -> float converter should be-- > > floatsample = intsample / 32768; > intsample = floatsample * 32768; > > But there are other opinions. The above assures that no incoming float > samples have a value exceeding +1.0 or -1.0. But if you output a value of > +1.0, the above code will wrap around to -32768 and sound awful. Therefore > sane sample format converter code must at least manage the +1.0 edge case > by clipping to 32767 rather than wrapping around. Actually, converter code > must make sure to clip all values that are too big to fit in the output > sample format. > > That's just the way 2's complement integers work-- the positive excursion > is 1 unit less than the negative excursion. In the past there were long > music-dsp threads on the issue, if you are masochistic enough to search > for them (GRIN). > > JCJR > -- > dupswapdrop -- the music-dsp mailing list and website: subscription info, > FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From eddie at roughproductions.co.uk Wed Nov 17 10:52:26 2004 From: eddie at roughproductions.co.uk (Eddie) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? References: <001301c4cb07$6203ead0$030200c0@australia><40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk><000801c4cbfa$b23b26a0$030200c0@australia><002401c4cc95$934df650$030200c0@australia><003501c4cc97$19f919e0$030200c0@australia><3263FD83-3893-11D9-BDD1-000A9595B180@u-he.com><000e01c4cca3$514ccde0$030200c0@australia><57B2E000-389D-11D9-9292-000A958903DE@yahoo.co.uk> <1CFA2036-38A6-11D9-BDD1-000A9595B180@u-he.com> Message-ID: <000e01c4ccbd$72a50880$030200c0@australia> Guys, if i change the attack/release forumlas to: attackIncrement = (float)((Math.pow(0.01, -1.0 / attackTime))); releaseIncrement = (float)((Math.pow(0.01, -1.0 / releaseTime))); (ie get rid of the 1 - Math.pow(0.0..........) then it doesn't go over 1... is this a bodge way of doing it though? Cheeeeeeers! Eddie ----- Original Message ----- From: "Urs Heckmann" To: "a list for musical digital signal processing" Sent: Wednesday, November 17, 2004 2:36 PM Subject: Re: [music-dsp] Why does my compressor sound so bad/distorted? > > schrieb Dave Gamble: > >> Hey Urs, How's stuff? :) > > Hahaha, it's growing ;-) ...been working on some insane things, like that > (unfinished prototype): > > http://www.u-he.com/img/g-snapshot.jpg > > Kept me from doing other things... like posting my subversive > half-finished paper on "branchless algorithms using comparison results > without if" to the list, which will - if ever finished - contain sample > code for a branchless adsr envelope and peak detection (see branchless > hardsync oscillator source code I posted a couple of days ago, subject > "Detecting phase cycle with Hoeldrich method.......")... sigh, where do > all the hours go each and every day?!? > >>> Your samples are integers between -32767 and 32767 while the examples >>> Dave and others relied to want floating point numbers between -1.0 and >>> +1.0. This is a little different, to say the least ;-) *ROTFL* >>> >> Gah. I should have guessed when he said .wav file! :-/ > > Yep! Will be a funny anecdote anyway 8-)) > >> I'm 100% with you there :) > > Cool ;) > > Cheers, > > ;) Urs > > (sorry for posting a little off topic 8-) > > urs heckmann > urs@u-he.com > www.u-he.com > > -- > dupswapdrop -- the music-dsp mailing list and website: subscription info, > FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From signalzerodb at yahoo.co.uk Wed Nov 17 11:29:15 2004 From: signalzerodb at yahoo.co.uk (Dave Gamble) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? In-Reply-To: <000e01c4ccbd$72a50880$030200c0@australia> References: <001301c4cb07$6203ead0$030200c0@australia><40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk><000801c4cbfa$b23b26a0$030200c0@australia><002401c4cc95$934df650$030200c0@australia><003501c4cc97$19f919e0$030200c0@australia><3263FD83-3893-11D9-BDD1-000A9595B180@u-he.com><000e01c4cca3$514ccde0$030200c0@australia><57B2E000-389D-11D9-9292-000A958903DE@yahoo.co.uk> <1CFA2036-38A6-11D9-BDD1-000A9595B180@u-he.com> <000e01c4ccbd$72a50880$030200c0@australia> Message-ID: umm... On 17 Nov 2004, at 15:52, Eddie wrote: > Guys, if i change the attack/release forumlas to: > > attackIncrement = (float)((Math.pow(0.01, -1.0 / attackTime))); > releaseIncrement = (float)((Math.pow(0.01, -1.0 / releaseTime))); > > (ie get rid of the 1 - Math.pow(0.0..........) then it doesn't go over > 1... is this a bodge way of doing it though? > Most important is that it's between 0 and 1... Frankly, once you're happy with the coefficient representing the % change step per sample, you can use whatever you like to calculate the coefficient. I would be inclined to suspect that everyone in the industry has a slightly different rule for this. The thing with powers is this: for a^b: (a to the power of b) if a>1, b>0, a^b>1 if a<1, b>0, a^b<1 if a>1, b<0, a^b<1 if a<1, b<0, a^b>1 (...someone might want to check the details on this!) So, you have a<1 (0.01) and b<0 (-1/attackTime), so a^b>1, in general. (try 0.5^-2 = 4) Your base power has to be positive, to ensure that all the powers exist. So, to get a^b<1, then either a<1, b>0 or a>1, b<0. Why is this so? because a^(-b) = (1/a)^b I originally suggested using e^(-1/attackTime). e=2.71828183, which is a>1, b<0 since attackTime is +ve and -1/+ve <0. This constrains a^b<1. If you graph: e^(-1/attackTime) against attackTime, you'll notice that it gets bigger (moves towards 1) as attackTime increases. This is the opposite of what we want, so we use 1-e^(-1/attackTime), which converges towards zero as attackTime increases. Do I get a free copy? :) Dave. > Cheeeeeeers! > > Eddie > > ----- Original Message ----- From: "Urs Heckmann" > To: "a list for musical digital signal processing" > > Sent: Wednesday, November 17, 2004 2:36 PM > Subject: Re: [music-dsp] Why does my compressor sound so bad/distorted? > > >> >> schrieb Dave Gamble: >> >>> Hey Urs, How's stuff? :) >> >> Hahaha, it's growing ;-) ...been working on some insane things, like >> that (unfinished prototype): >> >> http://www.u-he.com/img/g-snapshot.jpg >> >> Kept me from doing other things... like posting my subversive >> half-finished paper on "branchless algorithms using comparison >> results without if" to the list, which will - if ever finished - >> contain sample code for a branchless adsr envelope and peak detection >> (see branchless hardsync oscillator source code I posted a couple of >> days ago, subject "Detecting phase cycle with Hoeldrich >> method.......")... sigh, where do all the hours go each and every >> day?!? >> >>>> Your samples are integers between -32767 and 32767 while the >>>> examples Dave and others relied to want floating point numbers >>>> between -1.0 and +1.0. This is a little different, to say the least >>>> ;-) *ROTFL* >>>> >>> Gah. I should have guessed when he said .wav file! :-/ >> >> Yep! Will be a funny anecdote anyway 8-)) >> >>> I'm 100% with you there :) >> >> Cool ;) >> >> Cheers, >> >> ;) Urs >> >> (sorry for posting a little off topic 8-) >> >> urs heckmann >> urs@u-he.com >> www.u-he.com >> >> -- >> dupswapdrop -- the music-dsp mailing list and website: subscription >> info, FAQ, source code archive, list archive, book reviews, dsp links >> http://shoko.calarts.edu/musicdsp >> http://ceait.calarts.edu/mailman/listinfo/music-dsp > > -- > dupswapdrop -- the music-dsp mailing list and website: subscription > info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From eddie at roughproductions.co.uk Wed Nov 17 12:25:13 2004 From: eddie at roughproductions.co.uk (Eddie) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? References: <001301c4cb07$6203ead0$030200c0@australia><40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk><000801c4cbfa$b23b26a0$030200c0@australia><002401c4cc95$934df650$030200c0@australia><003501c4cc97$19f919e0$030200c0@australia><3263FD83-3893-11D9-BDD1-000A9595B180@u-he.com><000e01c4cca3$514ccde0$030200c0@australia><57B2E000-389D-11D9-9292-000A958903DE@yahoo.co.uk><1CFA2036-38A6-11D9-BDD1-000A9595B180@u-he.com><000e01c4ccbd$72a50880$030200c0@australia> Message-ID: <000e01c4ccca$69386460$030200c0@australia> hi another one printed out :-) what i said didn't work anyway. the situation at the moment is that it works perfectly.... ie if doesn't compress the whole wave, only samples under the threshold (ie for samples under threshold, gain = 1), but for the samples ABOVE the threshold, the gain is MORE than 1, so they become bigger. i'm sure it's simple but my brain is fried. if you guys know what it would be (can i just wack another minus in there?), please let me know! but it's home time for now, i've already been here far too long. maybe it will be clearer tomorrow. thanks for all your help today guys! this mailing list is amazing. cheers Eddie ----- Original Message ----- From: "Dave Gamble" To: "a list for musical digital signal processing" Sent: Wednesday, November 17, 2004 4:29 PM Subject: Re: [music-dsp] Why does my compressor sound so bad/distorted? > umm... > > On 17 Nov 2004, at 15:52, Eddie wrote: > >> Guys, if i change the attack/release forumlas to: >> >> attackIncrement = (float)((Math.pow(0.01, -1.0 / attackTime))); >> releaseIncrement = (float)((Math.pow(0.01, -1.0 / releaseTime))); >> >> (ie get rid of the 1 - Math.pow(0.0..........) then it doesn't go over >> 1... is this a bodge way of doing it though? >> > Most important is that it's between 0 and 1... > > Frankly, once you're happy with the coefficient representing the % change > step per sample, you can use whatever you like to calculate the > coefficient. I would be inclined to suspect that everyone in the industry > has a slightly different rule for this. > > The thing with powers is this: for a^b: (a to the power of b) > if a>1, b>0, a^b>1 > if a<1, b>0, a^b<1 > if a>1, b<0, a^b<1 > if a<1, b<0, a^b>1 > (...someone might want to check the details on this!) > > So, you have a<1 (0.01) and b<0 (-1/attackTime), so a^b>1, in general. > (try 0.5^-2 = 4) > > Your base power has to be positive, to ensure that all the powers exist. > So, to get a^b<1, then either a<1, b>0 or > a>1, b<0. > > Why is this so? > > because a^(-b) = (1/a)^b > > I originally suggested using e^(-1/attackTime). > e=2.71828183, which is a>1, b<0 since attackTime is +ve and -1/+ve <0. > This constrains a^b<1. > > If you graph: e^(-1/attackTime) against attackTime, you'll notice that it > gets bigger (moves towards 1) as attackTime increases. This is the > opposite of what we want, so we use 1-e^(-1/attackTime), which converges > towards zero as attackTime increases. > > Do I get a free copy? :) > > Dave. > >> Cheeeeeeers! >> >> Eddie >> >> ----- Original Message ----- From: "Urs Heckmann" >> To: "a list for musical digital signal processing" >> >> Sent: Wednesday, November 17, 2004 2:36 PM >> Subject: Re: [music-dsp] Why does my compressor sound so bad/distorted? >> >> >>> >>> schrieb Dave Gamble: >>> >>>> Hey Urs, How's stuff? :) >>> >>> Hahaha, it's growing ;-) ...been working on some insane things, like >>> that (unfinished prototype): >>> >>> http://www.u-he.com/img/g-snapshot.jpg >>> >>> Kept me from doing other things... like posting my subversive >>> half-finished paper on "branchless algorithms using comparison results >>> without if" to the list, which will - if ever finished - contain sample >>> code for a branchless adsr envelope and peak detection (see branchless >>> hardsync oscillator source code I posted a couple of days ago, subject >>> "Detecting phase cycle with Hoeldrich method.......")... sigh, where do >>> all the hours go each and every day?!? >>> >>>>> Your samples are integers between -32767 and 32767 while the examples >>>>> Dave and others relied to want floating point numbers between -1.0 and >>>>> +1.0. This is a little different, to say the least ;-) *ROTFL* >>>>> >>>> Gah. I should have guessed when he said .wav file! :-/ >>> >>> Yep! Will be a funny anecdote anyway 8-)) >>> >>>> I'm 100% with you there :) >>> >>> Cool ;) >>> >>> Cheers, >>> >>> ;) Urs >>> >>> (sorry for posting a little off topic 8-) >>> >>> urs heckmann >>> urs@u-he.com >>> www.u-he.com >>> >>> -- >>> dupswapdrop -- the music-dsp mailing list and website: subscription >>> info, FAQ, source code archive, list archive, book reviews, dsp links >>> http://shoko.calarts.edu/musicdsp >>> http://ceait.calarts.edu/mailman/listinfo/music-dsp >> >> -- >> dupswapdrop -- the music-dsp mailing list and website: subscription info, >> FAQ, source code archive, list archive, book reviews, dsp links >> http://shoko.calarts.edu/musicdsp >> http://ceait.calarts.edu/mailman/listinfo/music-dsp >> > > -- > dupswapdrop -- the music-dsp mailing list and website: subscription info, > FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From signalzerodb at yahoo.co.uk Wed Nov 17 12:28:45 2004 From: signalzerodb at yahoo.co.uk (Dave Gamble) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? In-Reply-To: <000e01c4ccca$69386460$030200c0@australia> References: <001301c4cb07$6203ead0$030200c0@australia><40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk><000801c4cbfa$b23b26a0$030200c0@australia><002401c4cc95$934df650$030200c0@australia><003501c4cc97$19f919e0$030200c0@australia><3263FD83-3893-11D9-BDD1-000A9595B180@u-he.com><000e01c4cca3$514ccde0$030200c0@australia><57B2E000-389D-11D9-9292-000A958903DE@yahoo.co.uk><1CFA2036-38A6-11D9-BDD1-000A9595B180@u-he.com><000e01c4ccbd$72a50880$030200c0@australia> <000e01c4ccca$69386460$030200c0@australia> Message-ID: <22356AA8-38BE-11D9-9292-000A958903DE@yahoo.co.uk> On 17 Nov 2004, at 17:25, Eddie wrote: > hi another one printed out :-) > > what i said didn't work anyway. > > the situation at the moment is that it works perfectly.... ie if > doesn't compress the whole wave, only samples under the threshold (ie > for samples under threshold, gain = 1), but for the samples ABOVE the > threshold, the gain is MORE than 1, so they become bigger. > > i'm sure it's simple but my brain is fried. if you guys know what it > would be (can i just wack another minus in there?), please let me > know! > Yep. stick a minus in. But do figure out why it's the wrong way around. 10^(-something/20) is less than 1. your variable should be positive after the threshold stage negative after the ratio stage negative after the attack/release stage less than 1 after the pow(10,var/20) stage. Dave. From stu at outpost.org.uk Wed Nov 17 12:31:44 2004 From: stu at outpost.org.uk (Stuart Yarrow) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] circular buffers of filtered noise Message-ID: <8CC626DA-38BE-11D9-872E-000393AE45E2@outpost.org.uk> Hi all, I am working on some synthesis software that requires a lot of high quality filtered noise. In order to avoid having to generate it on the fly, I am considering filling up a nice big buffer with noise beforehand, then FIR filtering it as if it was a continuous loop - i.e. start at one end of the buffer with the filter delay line preloaded with the contents of the other end of the buffer. Having thought about this a bit, I think that I should then be able to use the buffer as a looping source of filtered noise with no discontinuities. I can then have various randomly scattered taps moving around the buffer (in both directions) supplying noise to where I need it, hopefully without any audible effects from the looping as long as the taps are sufficiently spread out and the buffer is long enough to avoid any audio frequency repetition. Anyway, my question is: is there any precedent for this? Has anyone used a system like this before, or heard about it being done? Am I making any silly assumptions? cheers -Stuart Stuart Yarrow ------------------------------------------------------------- Subcity Radio - http://www.subcity.org/ http://fingamidi.sourceforge.net/ http://www.outpost.org.uk/ http://www.SSPaberdeensouth.org.uk/ From joshscholar at yahoo.com Wed Nov 17 12:47:10 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] circular buffers of filtered noise References: <8CC626DA-38BE-11D9-872E-000393AE45E2@outpost.org.uk> Message-ID: <08a701c4cccd$7d568280$f8e22641@antssoftware.com> I think people can pull patterns out of noise if it's looped too quickly - actually that could be quite interesting in itself. I remember reading someone on this list talking about that. So you may need long buffers so that people don't start to notice repeats. I guess you could even break up the patterns a bit by crossfading at random. Joshua Scholar From xue.wen at elec.qmul.ac.uk Wed Nov 17 12:59:28 2004 From: xue.wen at elec.qmul.ac.uk (Wen X) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] circular buffers of filtered noise References: <8CC626DA-38BE-11D9-872E-000393AE45E2@outpost.org.uk> Message-ID: <004e01c4cccf$4067d660$6a21258a@wenpc> basically every pseudal random series is periodic -- it can be implemented as a circular buffer sampled at a constant interval 1. a trick is to make the period of the random sequence larger than the buffer size by sampling the buffer differently, at the cost of a little additional operations. this saves the buffer size. however the buffered noise shall be white enough for a good result. xue ----- Original Message ----- From: "Stuart Yarrow" To: Sent: Wednesday, November 17, 2004 5:31 PM Subject: [music-dsp] circular buffers of filtered noise > Hi all, > > I am working on some synthesis software that requires a lot of high > quality filtered noise. In order to avoid having to generate it on the > fly, I am considering filling up a nice big buffer with noise beforehand, > then FIR filtering it as if it was a continuous loop - i.e. start at one > end of the buffer with the filter delay line preloaded with the contents > of the other end of the buffer. Having thought about this a bit, I think > that I should then be able to use the buffer as a looping source of > filtered noise with no discontinuities. > > I can then have various randomly scattered taps moving around the buffer > (in both directions) supplying noise to where I need it, hopefully without > any audible effects from the looping as long as the taps are sufficiently > spread out and the buffer is long enough to avoid any audio frequency > repetition. > > Anyway, my question is: is there any precedent for this? Has anyone used a > system like this before, or heard about it being done? Am I making any > silly assumptions? > > cheers > > -Stuart > > > Stuart Yarrow > > ------------------------------------------------------------- > Subcity Radio - http://www.subcity.org/ > http://fingamidi.sourceforge.net/ > http://www.outpost.org.uk/ > http://www.SSPaberdeensouth.org.uk/ > > -- > dupswapdrop -- the music-dsp mailing list and website: subscription info, > FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From alex at pixar.com Wed Nov 17 14:21:40 2004 From: alex at pixar.com (Alex Stahl) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] circular buffers of filtered noise References: <8CC626DA-38BE-11D9-872E-000393AE45E2@outpost.org.uk> <08a701c4cccd$7d568280$f8e22641@antssoftware.com> Message-ID: <419BA4C4.E7131FDE@pixar.com> Yeah, many noise sources sound like they have a temporal pattern. Sometimes they even feel quite rhythmic, at a tempo far above their pseudo-random sequence length. I imagine these noise patterns could be the side effect of some kind of psychoacoustic autocorrelator running over echoic memory, eagerly looking for the sounds of approaching hooves or language patterns or something like that. If so, a longer buffer should help but any repetition might be reinforced over time. If you guarantee that a noise source is flat all the way down past frequencies we hear as pitches through the periodicities of tempo, meter, and musical form, would it tend to reduce those patterns? I kind of like the idea but I doubt it. Maybe it's a silly question, because most noise generators are inherently flat in the subsonic range already? If anyone knows a psycho-physical answer or has run relevant experiments, I'd love to know more. -Alex S. Joshua Scholar wrote: > > I think people can pull patterns out of noise if it's looped too quickly - > actually that could be quite interesting in itself. I remember reading > someone on this list talking about that. > > So you may need long buffers so that people don't start to notice repeats. > I guess you could even break up the patterns a bit by crossfading at random. > > Joshua Scholar > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From joshscholar at yahoo.com Wed Nov 17 14:41:38 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] circular buffers of filtered noise References: <8CC626DA-38BE-11D9-872E-000393AE45E2@outpost.org.uk><08a701c4cccd$7d568280$f8e22641@antssoftware.com> <419BA4C4.E7131FDE@pixar.com> Message-ID: <08b101c4ccdd$758e5f40$f8e22641@antssoftware.com> Well I've mentioned here before a situation where a linear congruency rng just wasn't good enough to make the sort of noise I needed, and it took a pretty complex hash to make the output of the rng good enough. So don't trust your random number generator. ----- Original Message ----- From: Alex Stahl To: a list for musical digital signal processing Sent: Wednesday, November 17, 2004 11:21 AM Subject: Re: [music-dsp] circular buffers of filtered noise Yeah, many noise sources sound like they have a temporal pattern. Sometimes they even feel quite rhythmic, at a tempo far above their pseudo-random sequence length. I imagine these noise patterns could be the side effect of some kind of psychoacoustic autocorrelator running over echoic memory, eagerly looking for the sounds of approaching hooves or language patterns or something like that. If so, a longer buffer should help but any repetition might be reinforced over time. If you guarantee that a noise source is flat all the way down past frequencies we hear as pitches through the periodicities of tempo, meter, and musical form, would it tend to reduce those patterns? I kind of like the idea but I doubt it. Maybe it's a silly question, because most noise generators are inherently flat in the subsonic range already? If anyone knows a psycho-physical answer or has run relevant experiments, I'd love to know more. -Alex S. Joshua Scholar wrote: > > I think people can pull patterns out of noise if it's looped too quickly - > actually that could be quite interesting in itself. I remember reading > someone on this list talking about that. > > So you may need long buffers so that people don't start to notice repeats. > I guess you could even break up the patterns a bit by crossfading at random. > > Joshua Scholar > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From stu at outpost.org.uk Wed Nov 17 17:11:46 2004 From: stu at outpost.org.uk (Stuart Yarrow) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] circular buffers of filtered noise In-Reply-To: <6252375.1100725038589.JavaMail.adm-moff@moffice2.nsc.no> References: <6252375.1100725038589.JavaMail.adm-moff@moffice2.nsc.no> Message-ID: Thanks for your comments everyone... I'm not so worried about the periodicity of the noise at the moment as the buffer will be very long, maybe ~10s (memory is not too much of an issue). I was more unsure about whether I can LP filter the buffer in advance so that it can be looped with no discontinuities. Having said that, I'm pretty sure I can do this successfully, provided that I use an FIR filter of lesser order than the length of the filter (~2**19 - shouldn't be difficult :-). BTW the RNG I am using is a fairly standard multiplicative linear congruential job with (I think) a period of 2**31. On 17 Nov 2004, at 20:57, Risto Holopainen wrote: > > > This sounds a bit like the Karplus-Strong algorithm, although that is > probably not what you are doing if the buffer is too long to have an > audio frequency repetition rate. > > I just did some experiments with generating noise by IFFT with > rectangular windows and randomized phases for each new window. This > indeed generates a clearly perceived periodicity, but I think it could > be improved simply by calling srand() each time a new window is to be > generated. I believe pseudo random generators generally have a 2^n > period, which the FFT of course also has. Anyway, I'd be interrested > in what amplitude distribution this synthesised noise has, since it > doesn't seem to be uniform. Does anyone know? > > Risto > Stuart Yarrow ------------------------------------------------------------- Subcity Radio - http://www.subcity.org/ http://fingamidi.sourceforge.net/ http://www.outpost.org.uk/ http://www.SSPaberdeensouth.org.uk/ From rholop at online.no Wed Nov 17 17:14:12 2004 From: rholop at online.no (Risto) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] circular buffers of filtered noise In-Reply-To: <419BA4C4.E7131FDE@pixar.com> References: <8CC626DA-38BE-11D9-872E-000393AE45E2@outpost.org.uk> <08a701c4cccd$7d568280$f8e22641@antssoftware.com> <419BA4C4.E7131FDE@pixar.com> Message-ID: <419BCD34.7060105@online.no> I just did some experiments with generating noise by IFFT with rectangular windows and randomized phases for each new window. This indeed generates a clearly perceived periodicity, but I think it could be improved simply by calling srand() each time a new window is to be generated. I believe pseudo random generators generally have a 2^n period, which the FFT of course also has, so this would inherently be a bad combination. Anyway, I'd be interrested in what amplitude distribution this synthesised noise has, since it doesn't seem to be uniform. Does anyone know? And for you noise afficionados, why not collect thermal noise from the machinery? Another thought just strikes me: we usually just investigate the power spectrum, and if it is flat, we say it's noise, but shouldn't we also look at the phase spectrum (in consecutive windows) or the autocorrelation? Risto Alex Stahl wrote: > Yeah, many noise sources sound like they have a temporal pattern. > Sometimes they even feel quite rhythmic, at a tempo far above their > pseudo-random sequence length. > > I imagine these noise patterns could be the side effect of some kind of > psychoacoustic autocorrelator running over echoic memory, eagerly > looking for the sounds of approaching hooves or language patterns or > something like that. If so, a longer buffer should help but any > repetition might be reinforced over time. > > If you guarantee that a noise source is flat all the way down past > frequencies we hear as pitches through the periodicities of tempo, > meter, and musical form, would it tend to reduce those patterns? I kind > of like the idea but I doubt it. Maybe it's a silly question, because > most noise generators are inherently flat in the subsonic range already? > > If anyone knows a psycho-physical answer or has run relevant > experiments, I'd love to know more. > > -Alex S. > From paranoiaspoisondoor at gmail.com Wed Nov 17 17:51:59 2004 From: paranoiaspoisondoor at gmail.com (Keith Handy) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] circular buffers of filtered noise In-Reply-To: <419BCD34.7060105@online.no> References: <8CC626DA-38BE-11D9-872E-000393AE45E2@outpost.org.uk> <08a701c4cccd$7d568280$f8e22641@antssoftware.com> <419BA4C4.E7131FDE@pixar.com> <419BCD34.7060105@online.no> Message-ID: <79a2ad4104111714511703d7d7@mail.gmail.com> On Wed, 17 Nov 2004 23:14:12 +0100, Risto wrote: > Another thought just strikes me: we usually just investigate the power > spectrum, and if it is flat, we say it's noise, but shouldn't we also > look at the phase spectrum (in consecutive windows) or the autocorrelation? This reminds me of something else I've been wondering; I've read Stephan M. Bernsee's explanation of how you can get a more exact pitch by comparing phase from one window to another; doesn't this mean that if you were analyzing a 4096-sample window, you could also split it into two 2048-sample windows and use the same technique to get that in-between pitch information, without having to look at the next or previous window? -Keith From gogins at pipeline.com Wed Nov 17 20:35:36 2004 From: gogins at pipeline.com (Michael Gogins) Date: Sun Jan 21 12:10:35 2007 Subject: [music-dsp] circular buffers of filtered noise References: <8CC626DA-38BE-11D9-872E-000393AE45E2@outpost.org.uk> Message-ID: <007901c4cd0e$e7993430$6501a8c0@Generator> You can probably generate high-quality pseudo-random noise as quickly as you can read it from a large table. There is arithmetic in the generation, but a large enough table might either swap or crowd other stuff out of memory so that it swaps, which is a lot more expensive than multiplying. ----- Original Message ----- From: "Stuart Yarrow" To: Sent: Wednesday, November 17, 2004 12:31 PM Subject: [music-dsp] circular buffers of filtered noise > Hi all, > > I am working on some synthesis software that requires a lot of high > quality filtered noise. In order to avoid having to generate it on the > fly, I am considering filling up a nice big buffer with noise beforehand, > then FIR filtering it as if it was a continuous loop - i.e. start at one > end of the buffer with the filter delay line preloaded with the contents > of the other end of the buffer. Having thought about this a bit, I think > that I should then be able to use the buffer as a looping source of > filtered noise with no discontinuities. > > I can then have various randomly scattered taps moving around the buffer > (in both directions) supplying noise to where I need it, hopefully without > any audible effects from the looping as long as the taps are sufficiently > spread out and the buffer is long enough to avoid any audio frequency > repetition. > > Anyway, my question is: is there any precedent for this? Has anyone used a > system like this before, or heard about it being done? Am I making any > silly assumptions? > > cheers > > -Stuart > > > Stuart Yarrow > > ------------------------------------------------------------- > Subcity Radio - http://www.subcity.org/ > http://fingamidi.sourceforge.net/ > http://www.outpost.org.uk/ > http://www.SSPaberdeensouth.org.uk/ > > -- > dupswapdrop -- the music-dsp mailing list and website: subscription info, > FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From gogins at pipeline.com Wed Nov 17 20:38:03 2004 From: gogins at pipeline.com (Michael Gogins) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] circular buffers of filtered noise References: <8CC626DA-38BE-11D9-872E-000393AE45E2@outpost.org.uk><08a701c4cccd$7d568280$f8e22641@antssoftware.com><419BA4C4.E7131FDE@pixar.com> <08b101c4ccdd$758e5f40$f8e22641@antssoftware.com> Message-ID: <009001c4cd0f$3eb465f0$6501a8c0@Generator> There are plenty of PRNGs that have a period quite sufficient to this purpose. There are a number of efficient implementations of the Mersenne twister around. I use the one in boost. I wouldn't be surprised if there were better ones somewhere. Physicists really need these things to be fast and not to repeat for Monte Carlo simulations. ----- Original Message ----- From: "Joshua Scholar" To: "a list for musical digital signal processing" Sent: Wednesday, November 17, 2004 2:41 PM Subject: Re: [music-dsp] circular buffers of filtered noise > Well I've mentioned here before a situation where a linear congruency rng > just wasn't good enough to make the sort of noise I needed, and it took a > pretty complex hash to make the output of the rng good enough. So don't > trust your random number generator. > > ----- Original Message ----- > From: Alex Stahl > To: a list for musical digital signal processing > Sent: Wednesday, November 17, 2004 11:21 AM > Subject: Re: [music-dsp] circular buffers of filtered noise > > > Yeah, many noise sources sound like they have a temporal pattern. > Sometimes they even feel quite rhythmic, at a tempo far above their > pseudo-random sequence length. > > I imagine these noise patterns could be the side effect of some kind of > psychoacoustic autocorrelator running over echoic memory, eagerly > looking for the sounds of approaching hooves or language patterns or > something like that. If so, a longer buffer should help but any > repetition might be reinforced over time. > > If you guarantee that a noise source is flat all the way down past > frequencies we hear as pitches through the periodicities of tempo, > meter, and musical form, would it tend to reduce those patterns? I kind > of like the idea but I doubt it. Maybe it's a silly question, because > most noise generators are inherently flat in the subsonic range already? > > If anyone knows a psycho-physical answer or has run relevant > experiments, I'd love to know more. > > -Alex S. > > > > Joshua Scholar wrote: >> >> I think people can pull patterns out of noise if it's looped too >> quickly - >> actually that could be quite interesting in itself. I remember reading >> someone on this list talking about that. >> >> So you may need long buffers so that people don't start to notice >> repeats. >> I guess you could even break up the patterns a bit by crossfading at > random. >> >> Joshua Scholar >> >> -- >> dupswapdrop -- the music-dsp mailing list and website: >> subscription info, FAQ, source code archive, list archive, book reviews, > dsp links >> http://shoko.calarts.edu/musicdsp >> http://ceait.calarts.edu/mailman/listinfo/music-dsp > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, > dsp > links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, > dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From gogins at pipeline.com Wed Nov 17 20:45:32 2004 From: gogins at pipeline.com (Michael Gogins) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] circular buffers of filtered noise References: <8CC626DA-38BE-11D9-872E-000393AE45E2@outpost.org.uk> <08a701c4cccd$7d568280$f8e22641@antssoftware.com><419BA4C4.E7131FDE@pixar.com> <419BCD34.7060105@online.no> Message-ID: <00fe01c4cd10$4abd5770$6501a8c0@Generator> Check out http://www.boost.org/libs/random/random-generators.html#mersenne_twister Summarizes periodicity and performance of a number of generators in boost. ----- Original Message ----- From: "Risto" To: "a list for musical digital signal processing" Sent: Wednesday, November 17, 2004 5:14 PM Subject: Re: [music-dsp] circular buffers of filtered noise > > I just did some experiments with generating noise by IFFT with rectangular > windows and randomized phases for each new window. This indeed generates a > clearly perceived periodicity, but I think it could be improved simply by > calling srand() each time a new window is to be generated. I believe > pseudo random generators generally have a 2^n period, which the FFT of > course also has, so this would inherently be a bad combination. Anyway, > I'd be interrested in what amplitude distribution this synthesised noise > has, since it doesn't seem to be uniform. Does anyone know? > > And for you noise afficionados, why not collect thermal noise from the > machinery? > Another thought just strikes me: we usually just investigate the power > spectrum, and if it is flat, we say it's noise, but shouldn't we also look > at the phase spectrum (in consecutive windows) or the autocorrelation? > > Risto > > > Alex Stahl wrote: >> Yeah, many noise sources sound like they have a temporal pattern. >> Sometimes they even feel quite rhythmic, at a tempo far above their >> pseudo-random sequence length. I imagine these noise patterns could be >> the side effect of some kind of >> psychoacoustic autocorrelator running over echoic memory, eagerly >> looking for the sounds of approaching hooves or language patterns or >> something like that. If so, a longer buffer should help but any >> repetition might be reinforced over time. If you guarantee that a noise >> source is flat all the way down past >> frequencies we hear as pitches through the periodicities of tempo, >> meter, and musical form, would it tend to reduce those patterns? I kind >> of like the idea but I doubt it. Maybe it's a silly question, because >> most noise generators are inherently flat in the subsonic range already? >> If anyone knows a psycho-physical answer or has run relevant >> experiments, I'd love to know more. >> >> -Alex S. >> > -- > dupswapdrop -- the music-dsp mailing list and website: subscription info, > FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From joshscholar at yahoo.com Wed Nov 17 23:17:15 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] circular buffers of filtered noise References: <8CC626DA-38BE-11D9-872E-000393AE45E2@outpost.org.uk><08a701c4cccd$7d568280$f8e22641@antssoftware.com><419BA4C4.E7131FDE@pixar.com><08b101c4ccdd$758e5f40$f8e22641@antssoftware.com> <009001c4cd0f$3eb465f0$6501a8c0@Generator> Message-ID: <08ca01c4cd25$82aa2810$f8e22641@antssoftware.com> The problem was NOT the period of the generator as a whole. The problem was that for my purposes I needed a flat spectrum (or as possible) from the top bit or to be more precise from something like (in C code): (rand()>(int)(RAND_MAX*0.9)) ? sign(rand()) : 0 and a linear congruence generator didn't make a flat spectrum in that case. I was trying to generate flat spectrum noise below the quantisation noise floor. The result didn't even SOUND like good noise (the peaks were obvious). But with a good hash function that all went away. ----- Original Message ----- From: Michael Gogins To: a list for musical digital signal processing Sent: Wednesday, November 17, 2004 5:38 PM Subject: Re: [music-dsp] circular buffers of filtered noise There are plenty of PRNGs that have a period quite sufficient to this purpose. There are a number of efficient implementations of the Mersenne twister around. I use the one in boost. I wouldn't be surprised if there were better ones somewhere. Physicists really need these things to be fast and not to repeat for Monte Carlo simulations. From oberfeld at uni-mainz.de Thu Nov 18 03:54:57 2004 From: oberfeld at uni-mainz.de (oberfeld) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] circular buffers of filtered noise In-Reply-To: <08a701c4cccd$7d568280$f8e22641@antssoftware.com> References: <8CC626DA-38BE-11D9-872E-000393AE45E2@outpost.org.uk> <08a701c4cccd$7d568280$f8e22641@antssoftware.com> Message-ID: <419C6361.90506@uni-mainz.de> Joshua Scholar wrote: > I think people can pull patterns out of noise if it's looped too quickly - > actually that could be quite interesting in itself. I remember reading > someone on this list talking about that. The perception of a periodic structure in 'repeated noise' is in some respects the most impressing evidence for the existence of a storage system termed 'auditory sensory memory' or 'echoic store'. The first seminal experiment was done by Guttman & Julesz: Guttman, N., & Julesz, B. (1963). Lower limits of auditory periodicity analysis. Journal of the Acoustical Society of America, 35, 610 Auditory sensory memory is assumed to store auditory information in an 'analog' or 'sensory' form, just like maybe a short tape loop running inside your head. So it differs from short-term or working memory which stores information in abstract/symbolic/semantic form. Some listeners can detect a structure even if the repeated noise samples are as long as 10 seconds! Christian Kaernbach did a lot of work on this topic, on his web page you will find some demos: http://www.periodic-noise.de/ Daniel ------------------------------------ Daniel Oberfeld Universit?t Mainz Experimental Psychology Staudingerweg 9 55099 Mainz Germany http://www.psych.uni-mainz.de/abteil/aep/oberfeld/index.html From eddie at roughproductions.co.uk Thu Nov 18 05:58:41 2004 From: eddie at roughproductions.co.uk (Eddie) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] Why does my compressor sound so bad/distorted? References: <001301c4cb07$6203ead0$030200c0@australia><40983C7A-3713-11D9-B523-000A958903DE@yahoo.co.uk><000801c4cbfa$b23b26a0$030200c0@australia><002401c4cc95$934df650$030200c0@australia><003501c4cc97$19f919e0$030200c0@australia><3263FD83-3893-11D9-BDD1-000A9595B180@u-he.com><000e01c4cca3$514ccde0$030200c0@australia><57B2E000-389D-11D9-9292-000A958903DE@yahoo.co.uk><1CFA2036-38A6-11D9-BDD1-000A9595B180@u-he.com><000e01c4ccbd$72a50880$030200c0@australia><000e01c4ccca$69386460$030200c0@australia> <22356AA8-38BE-11D9-9292-000A958903DE@yahoo.co.uk> Message-ID: <000801c4cd5d$9405fed0$030200c0@australia> > your variable should be positive after the threshold stage > negative after the ratio stage > negative after the attack/release stage > less than 1 after the pow(10,var/20) stage. > it's funny, at home (or at least, where i'm currently staying - no net access) yesterday i wrote this down exactly. anyway the problem is the line: currentCorrection = ((float)(currentCorrection * (1 - attackCoefficient)) + (correction * attackCoefficient)); and the same for the release, obviously. this converts the negative value to positive. i could just do: gain = ((float)Math.pow(10, (-currentCorrection/20))); this gives 1 for under ratio (good), and less than 1 for 'compressed' values (good!). but is it a botch job? why is the other from looking at the waveform after compression, and comparing it to the Logic compressor (i know, i know) with the same settings (peak, hardknee, 2:1, -19.9db, autogain off, 2ms attack, 98ms release), the logic waveform is much more compressed. surely the basic algorithm for all compressors with the same settings should give the same 'kind' of results? but the important thing is that it's actually compressing! i am gonna try and 'fine tune' and understand it completely now. that 'minus' thing is still a bit confusing - but then i don't know much about parallel 1st order single pole filters! cheers Eddie From benny at scene.ro Thu Nov 18 06:57:44 2004 From: benny at scene.ro (acid::roscene crew) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] test Message-ID: <005201c4cd65$d12636b0$e903a8c0@acidrain> Please don't mind this test. I had problems writing to the list. From signalzerodb at yahoo.co.uk Thu Nov 18 07:01:05 2004 From: signalzerodb at yahoo.co.uk (Dave Gamble) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] circular buffers of filtered noise In-Reply-To: <08ca01c4cd25$82aa2810$f8e22641@antssoftware.com> References: <8CC626DA-38BE-11D9-872E-000393AE45E2@outpost.org.uk><08a701c4cccd$7d568280$f8e22641@antssoftware.com><419BA4C4.E7131FDE@pixar.com><08b101c4ccdd$758e5f40$f8e22641@antssoftware.com> <009001c4cd0f$3eb465f0$6501a8c0@Generator> <08ca01c4cd25$82aa2810$f8e22641@antssoftware.com> Message-ID: <8645CF42-3959-11D9-94B8-000A958903DE@yahoo.co.uk> sounds like you want gaussian distributed noise rather than uniform distributed; both are white in spectrum. If I may be rather populist, may I suggest the ziggurat technique? Or Box-Muller (my personal fave; not had the chance to check out ziggurat fully yet) Dave. On 18 Nov 2004, at 04:17, Joshua Scholar wrote: > The problem was NOT the period of the generator as a whole. The > problem was > that for my purposes I needed a flat spectrum (or as possible) from > the top > bit or to be more precise from something like (in C code): > > (rand()>(int)(RAND_MAX*0.9)) ? sign(rand()) : 0 > > and a linear congruence generator didn't make a flat spectrum in that > case. > > I was trying to generate flat spectrum noise below the quantisation > noise > floor. > > The result didn't even SOUND like good noise (the peaks were obvious). > But > with a good hash function that all went away. > > ----- Original Message ----- > From: Michael Gogins > To: a list for musical digital signal processing > Sent: Wednesday, November 17, 2004 5:38 PM > Subject: Re: [music-dsp] circular buffers of filtered noise > > > There are plenty of PRNGs that have a period quite sufficient to this > purpose. There are a number of efficient implementations of the > Mersenne > twister around. I use the one in boost. I wouldn't be surprised if > there > were better ones somewhere. Physicists really need these things to be > fast > and not to repeat for Monte Carlo simulations. > > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book > reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From steve.conner at optosci.com Thu Nov 18 07:02:29 2004 From: steve.conner at optosci.com (Steve Conner) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] Scotland? In-Reply-To: <20041118013720.69E5A1740DDC@music.calarts.edu> Message-ID: Hi all. Anybody here based in Scotland? I noticed that Stuart Yarrow mentioned Subcity Radio in his sig. I subscribe to the a-list (for Yamaha sampler users) and there was some talk on there about organising a jam in Scotland. I'm not sure how it would work but I guess it might be something like the Synth DIY meetings that happen in Cambridge. I'm based in Glasgow and I do hardware design and DSP programming for scientific instruments, and mess around with electronic music in my spare time. I hope this doesn't bounce, I can never remember which e-mail address I subscribed to the list... Steve Conner http://www.scopeboy.com/ From joshscholar at yahoo.com Thu Nov 18 07:27:51 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] circular buffers of filtered noise References: <8CC626DA-38BE-11D9-872E-000393AE45E2@outpost.org.uk><08a701c4cccd$7d568280$f8e22641@antssoftware.com><419BA4C4.E7131FDE@pixar.com><08b101c4ccdd$758e5f40$f8e22641@antssoftware.com><009001c4cd0f$3eb465f0$6501a8c0@Generator><08ca01c4cd25$82aa2810$f8e22641@antssoftware.com> <8645CF42-3959-11D9-94B8-000A958903DE@yahoo.co.uk> Message-ID: <094901c4cd6a$06a3c4c0$f8e22641@antssoftware.com> But it worked well enough after I put a hash function over the rng. I assume the output of the hash function was uniform. Unless there was some bug confusing me I think this means that linear congruence generators aren't really that white, and my use of it amplified the problem. By the way the generator I used was on of the ones out of Numerical Recipies in C. ----- Original Message ----- From: Dave Gamble To: a list for musical digital signal processing Sent: Thursday, November 18, 2004 4:01 AM Subject: Re: [music-dsp] circular buffers of filtered noise sounds like you want gaussian distributed noise rather than uniform distributed; both are white in spectrum. If I may be rather populist, may I suggest the ziggurat technique? Or Box-Muller (my personal fave; not had the chance to check out ziggurat fully yet) Dave. On 18 Nov 2004, at 04:17, Joshua Scholar wrote: > The problem was NOT the period of the generator as a whole. The > problem was > that for my purposes I needed a flat spectrum (or as possible) from > the top > bit or to be more precise from something like (in C code): > > (rand()>(int)(RAND_MAX*0.9)) ? sign(rand()) : 0 > > and a linear congruence generator didn't make a flat spectrum in that > case. > > I was trying to generate flat spectrum noise below the quantisation > noise > floor. > > The result didn't even SOUND like good noise (the peaks were obvious). > But > with a good hash function that all went away. > > ----- Original Message ----- > From: Michael Gogins > To: a list for musical digital signal processing > Sent: Wednesday, November 17, 2004 5:38 PM > Subject: Re: [music-dsp] circular buffers of filtered noise > > > There are plenty of PRNGs that have a period quite sufficient to this > purpose. There are a number of efficient implementations of the > Mersenne > twister around. I use the one in boost. I wouldn't be surprised if > there > were better ones somewhere. Physicists really need these things to be > fast > and not to repeat for Monte Carlo simulations. > > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book > reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From benny at scene.ro Thu Nov 18 08:35:55 2004 From: benny at scene.ro (Adrian Scripca) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] Pattern Editor Ctrl Message-ID: <00e101c4cd73$88601d70$e903a8c0@acidrain> Hi everybody, While writing a buzz alike tracker I have come to the part where a mfc pattern editor control was needed. After writing it I thought it'd share it in case anybody would ever need it for a quick small project. link : http://benny.kappa.ro/pattern_editor.zip Any reviews would be appreciated. --- Adrian Scripca aka benny / roscene crew Email : benny@incremental Web : http://benny.kappa.ro From joshscholar at yahoo.com Thu Nov 18 11:03:06 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] circular buffers of filtered noise References: <8CC626DA-38BE-11D9-872E-000393AE45E2@outpost.org.uk><08a701c4cccd$7d568280$f8e22641@antssoftware.com><419BA4C4.E7131FDE@pixar.com><08b101c4ccdd$758e5f40$f8e22641@antssoftware.com><009001c4cd0f$3eb465f0$6501a8c0@Generator><08ca01c4cd25$82aa2810$f8e22641@antssoftware.com> <8645CF42-3959-11D9-94B8-000A958903DE@yahoo.co.uk> Message-ID: <0aa301c4cd88$185beb20$f8e22641@antssoftware.com> Oh, I think my first reply misunderstood what you were trying to say... You were saying that it's possible to sub-bit noise with a gaussian distributed generator instead of using my "create single bit perturbation occasionally" algorithm. Did I understand this time? Joshua Scholar ----- Original Message ----- From: Dave Gamble To: a list for musical digital signal processing Sent: Thursday, November 18, 2004 4:01 AM Subject: Re: [music-dsp] circular buffers of filtered noise sounds like you want gaussian distributed noise rather than uniform distributed; both are white in spectrum. If I may be rather populist, may I suggest the ziggurat technique? Or Box-Muller (my personal fave; not had the chance to check out ziggurat fully yet) Dave. From signalzerodb at yahoo.co.uk Thu Nov 18 11:29:51 2004 From: signalzerodb at yahoo.co.uk (Dave Gamble) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] circular buffers of filtered noise In-Reply-To: <0aa301c4cd88$185beb20$f8e22641@antssoftware.com> References: <8CC626DA-38BE-11D9-872E-000393AE45E2@outpost.org.uk><08a701c4cccd$7d568280$f8e22641@antssoftware.com><419BA4C4.E7131FDE@pixar.com><08b101c4ccdd$758e5f40$f8e22641@antssoftware.com><009001c4cd0f$3eb465f0$6501a8c0@Generator><08ca01c4cd25$82aa2810$f8e22641@antssoftware.com> <8645CF42-3959-11D9-94B8-000A958903DE@yahoo.co.uk> <0aa301c4cd88$185beb20$f8e22641@antssoftware.com> Message-ID: <1213A16D-397F-11D9-94B8-000A958903DE@yahoo.co.uk> On 18 Nov 2004, at 16:03, Joshua Scholar wrote: > Oh, I think my first reply misunderstood what you were trying to say... > > You were saying that it's possible to sub-bit noise with a gaussian > distributed generator instead of using my "create single bit > perturbation > occasionally" algorithm. Did I understand this time? > Ah yes.... When you said you were generating noise, I assumed you meant a stream of uniform floating-point random numbers between -1 and 1... I seem to be doing that a lot recently... :-) ! Whiteness is an ergodic property (did I word that right?), for perfect whiteness, you'd be white all the way up to infHz! If you change one bit every few samples, it's going to sound less white, at any given time... But if you record the thing to tape, and play it back 100x as fast, it'll sound white. Dave. > Joshua Scholar > > ----- Original Message ----- > From: Dave Gamble > To: a list for musical digital signal processing > Sent: Thursday, November 18, 2004 4:01 AM > Subject: Re: [music-dsp] circular buffers of filtered noise > > > sounds like you want gaussian distributed noise rather than uniform > distributed; both are white in spectrum. > > If I may be rather populist, may I suggest the ziggurat technique? > Or Box-Muller (my personal fave; not had the chance to check out > ziggurat fully yet) > > Dave. > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book > reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From joshscholar at yahoo.com Thu Nov 18 11:42:43 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] circular buffers of filtered noise References: <8CC626DA-38BE-11D9-872E-000393AE45E2@outpost.org.uk><08a701c4cccd$7d568280$f8e22641@antssoftware.com><419BA4C4.E7131FDE@pixar.com><08b101c4ccdd$758e5f40$f8e22641@antssoftware.com><009001c4cd0f$3eb465f0$6501a8c0@Generator><08ca01c4cd25$82aa2810$f8e22641@antssoftware.com><8645CF42-3959-11D9-94B8-000A958903DE@yahoo.co.uk><0aa301c4cd88$185beb20$f8e22641@antssoftware.com> <1213A16D-397F-11D9-94B8-000A958903DE@yahoo.co.uk> Message-ID: <0ab901c4cd8d$a1216660$f8e22641@antssoftware.com> >----- Original Message ----- >From: Dave Gamble >To: a list for musical digital signal processing >Sent: Thursday, November 18, 2004 8:29 AM >Subject: Re: [music-dsp] circular buffers of filtered noise > >On 18 Nov 2004, at 16:03, Joshua Scholar wrote: > >> Oh, I think my first reply misunderstood what you were trying to say... >> >> You were saying that it's possible to sub-bit noise with a gaussian >> distributed generator instead of using my "create single bit >> perturbation >> occasionally" algorithm. Did I understand this time? >> >Ah yes.... When you said you were generating noise, I assumed you meant >a stream of uniform floating-point random numbers between -1 and 1... >I seem to be doing that a lot recently... :-) ! > No I was generating an occasional 1 and an occasional -1 surounded by zeros in a stream of 16 bit integers to trying to get noise below the quantized noise floor. You probably can't generate noise all the way up to the nyquest frequency that way, but you can get close. Joshua Scholar From signalzerodb at yahoo.co.uk Thu Nov 18 11:47:01 2004 From: signalzerodb at yahoo.co.uk (Dave Gamble) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] circular buffers of filtered noise In-Reply-To: <0ab901c4cd8d$a1216660$f8e22641@antssoftware.com> References: <8CC626DA-38BE-11D9-872E-000393AE45E2@outpost.org.uk><08a701c4cccd$7d568280$f8e22641@antssoftware.com><419BA4C4.E7131FDE@pixar.com><08b101c4ccdd$758e5f40$f8e22641@antssoftware.com><009001c4cd0f$3eb465f0$6501a8c0@Generator><08ca01c4cd25$82aa2810$f8e22641@antssoftware.com><8645CF42-3959-11D9-94B8-000A958903DE@yahoo.co.uk><0aa301c4cd88$185beb20$f8e22641@antssoftware.com> <1213A16D-397F-11D9-94B8-000A958903DE@yahoo.co.uk> <0ab901c4cd8d$a1216660$f8e22641@antssoftware.com> Message-ID: <78449850-3981-11D9-94B8-000A958903DE@yahoo.co.uk> > No I was generating an occasional 1 and an occasional -1 surounded by > zeros > in a stream of 16 bit integers to trying to get noise below the > quantized > noise floor. > I would be tempted to suggest that perhaps the thing to do would be to generate a gaussian distributed noise source, with an expectation of 0, and a variance of maybe 0.5. Then quantize! Gaussian sounds... how shall i put it... nicer? The difference is subtle though; they're both spectrally white, but gaussian is less 'spiky' than uniform. Of course, gaussian is not bounded..... :-) > You probably can't generate noise all the way up to the nyquest > frequency > that way, but you can get close. > You can generate noise up to the nyquist; just generate 32bits with something like a linear congruential rng, linear scale to your output range, and proceed. Generate a nice buffer full, and FFT it. There's noise all the way up. CDF it, and you'll see that it's uniform. Dave. From spafford at calarts.edu Fri Nov 19 00:29:22 2004 From: spafford at calarts.edu (spafford@calarts.edu) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] interpolating control values Message-ID: <49577.198.182.157.96.1100842162.squirrel@198.182.157.96> hello, I'm wondering if anyone knows any tricks for removing the zipper-noise that I'm getting from my GUI amplitude slider control. I initially arrived at this solution: [...] // callback function { // test for slider update if(data->previous_amp != data->updated_amp) // if slider is updated interpolate between values for( i=0; iscale_amp[i] = data-> previous_amp + ( ((data-> updated_amp - data->previous_amp) / (double)FRAMES_PER_BUFFER) * (double)i); *out++ = data->scale_amp[i] * data->sine[data->phase]; } } else { // loop through buffer with static amplitude value } } data->previous_amp = data->updated_amp [...] however, this only seems to work at very low sample rates. it chokes on anything above around 2000 samples per second. thanks for any suggestions, aaron From earlevel at earlevel.com Fri Nov 19 02:49:22 2004 From: earlevel at earlevel.com (Nigel Redmon) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] interpolating control values In-Reply-To: <49577.198.182.157.96.1100842162.squirrel@198.182.157.96> References: <49577.198.182.157.96.1100842162.squirrel@198.182.157.96> Message-ID: <870514AF-39FF-11D9-B53F-000A959AF1E4@earlevel.com> An easy solution to zipper noise is to put a one-pole lowpass filter (set sub-audio) between the incoming values from the control and the destination. On Nov 18, 2004, at 9:29 PM, spafford@calarts.edu wrote: > I'm wondering if anyone knows any tricks for removing the zipper-noise > that I'm getting from my GUI amplitude slider control. From rbj at surfglobal.net Fri Nov 19 12:07:56 2004 From: rbj at surfglobal.net (robert bristow-johnson) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] interpolating control values In-Reply-To: <870514AF-39FF-11D9-B53F-000A959AF1E4@earlevel.com> References: <49577.198.182.157.96.1100842162.squirrel@198.182.157.96> <870514AF-39FF-11D9-B53F-000A959AF1E4@earlevel.com> Message-ID: <1130.64.30.60.69.1100884076.squirrel@64.30.60.69> Nigel Redmon said: > An easy solution to zipper noise is to put a one-pole lowpass filter > (set sub-audio) between the incoming values from the control and the > destination. this is true (it's an easy solution), but you'll want to do that "fraction saving" (noise shaping with a zero on DC or z=1) that is used in that DC Blocking filter at DSPguru.com . if you don't, your LPF might get stuck at a value other than the final value (at least if it's fixed-point). -- r b-j From earlevel at earlevel.com Fri Nov 19 12:57:39 2004 From: earlevel at earlevel.com (Nigel Redmon) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] interpolating control values In-Reply-To: <1130.64.30.60.69.1100884076.squirrel@64.30.60.69> References: <49577.198.182.157.96.1100842162.squirrel@198.182.157.96> <870514AF-39FF-11D9-B53F-000A959AF1E4@earlevel.com> <1130.64.30.60.69.1100884076.squirrel@64.30.60.69> Message-ID: <80F6BF40-3A54-11D9-9862-000A959AF1E4@earlevel.com> I thought to mention that, but the OP showed C code, so I assume he's using floating point, where it's not a problem. Yes, I use that technique (first-order noise shaping) on the 56k in my PT plug-ins, though I don't think of it as "fraction saving" (but we've had that conversation before ;-) On Nov 19, 2004, at 9:07 AM, robert bristow-johnson wrote: > > Nigel Redmon said: >> An easy solution to zipper noise is to put a one-pole lowpass filter >> (set sub-audio) between the incoming values from the control and the >> destination. > > this is true (it's an easy solution), but you'll want to do that > "fraction > saving" (noise shaping with a zero on DC or z=1) that is used in that > DC > Blocking filter at DSPguru.com . if you don't, your LPF might get > stuck > at a value other than the final value (at least if it's fixed-point). From rbj at surfglobal.net Fri Nov 19 13:19:12 2004 From: rbj at surfglobal.net (robert bristow-johnson) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] interpolating control values In-Reply-To: <80F6BF40-3A54-11D9-9862-000A959AF1E4@earlevel.com> References: <49577.198.182.157.96.1100842162.squirrel@198.182.157.96> <870514AF-39FF-11D9-B53F-000A959AF1E4@earlevel.com> <1130.64.30.60.69.1100884076.squirrel@64.30.60.69> <80F6BF40-3A54-11D9-9862-000A959AF1E4@earlevel.com> Message-ID: <1231.64.30.62.153.1100888352.squirrel@64.30.62.153> Nigel Redmon said: > I thought to mention that, but the OP showed C code, so I assume he's > using floating point, where it's not a problem. Yes, I use that > technique (first-order noise shaping) on the 56k in my PT plug-ins, > though I don't think of it as "fraction saving" (but we've had that > conversation before ;-) i hadn't used the term before i heard it from Randy Yates on comp.dsp (who got it from someone else he credits). i had previously simply said "first order noise-shaping with a zero at DC around a round-toward-minus-infinity quantizer". somehow "fraction saving" seems to be a shorter term that is adequately descriptive of the operation if not sufficiently descriptive of the motivation. -- r b-j From earlevel at earlevel.com Fri Nov 19 13:30:58 2004 From: earlevel at earlevel.com (Nigel Redmon) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] interpolating control values In-Reply-To: <1231.64.30.62.153.1100888352.squirrel@64.30.62.153> References: <49577.198.182.157.96.1100842162.squirrel@198.182.157.96> <870514AF-39FF-11D9-B53F-000A959AF1E4@earlevel.com> <1130.64.30.60.69.1100884076.squirrel@64.30.60.69> <80F6BF40-3A54-11D9-9862-000A959AF1E4@earlevel.com> <1231.64.30.62.153.1100888352.squirrel@64.30.62.153> Message-ID: <283D3C1A-3A59-11D9-9862-000A959AF1E4@earlevel.com> Yeah, I don't find anything wrong with that description, just that it's a fraction of a fraction (which is still a fraction). I guess you could call it truncation saving, error feedback, or a lot of things. Works nicely though, and first-order is plenty good 'nuff, so it's cheap. I use it on my low audio biquads too. I'm sure that's something that slips by a lot of people who never look at what their output is doing... On Nov 19, 2004, at 10:19 AM, robert bristow-johnson wrote: > i hadn't used the term before i heard it from Randy Yates on comp.dsp > (who > got it from someone else he credits). i had previously simply said > "first > order noise-shaping with a zero at DC around a > round-toward-minus-infinity > quantizer". somehow "fraction saving" seems to be a shorter term that > is > adequately descriptive of the operation if not sufficiently > descriptive of > the motivation. From rbj at surfglobal.net Fri Nov 19 15:39:11 2004 From: rbj at surfglobal.net (robert bristow-johnson) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] interpolating control values In-Reply-To: <283D3C1A-3A59-11D9-9862-000A959AF1E4@earlevel.com> References: <49577.198.182.157.96.1100842162.squirrel@198.182.157.96> <870514AF-39FF-11D9-B53F-000A959AF1E4@earlevel.com> <1130.64.30.60.69.1100884076.squirrel@64.30.60.69> <80F6BF40-3A54-11D9-9862-000A959AF1E4@earlevel.com> <1231.64.30.62.153.1100888352.squirrel@64.30.62.153> <283D3C1A-3A59-11D9-9862-000A959AF1E4@earlevel.com> Message-ID: <49172.64.30.60.177.1100896751.squirrel@64.30.60.177> Nigel Redmon said: > Yeah, I don't find anything wrong with that description, just that it's > a fraction of a fraction (which is still a fraction). yeah, but not the whole fraction. the salient difference is one of scaling (in fact, in the fixed-point DC Blocker code the fraction saved is an integer), and usually when we (at least i) talk about uniform quantization, i like to assume a scaling so that it is rounding to an integer that is close by. > I guess you could > call it truncation saving, error feedback, or a lot of things. Works > nicely though, and first-order is plenty good 'nuff, so it's cheap. 2 extra 56K instructions per biquad section per sample. > I use it on my low audio biquads too. i would use it on *every* fixed-point IIR filter. when the input goes to silence (and the DC Blocker is there to insure that "silence" is the same as "zero"), you don't want your level display to go down to -60 or -70 dB and get stuck there. you want it to go down to -inf dB. > I'm sure that's something that > slips by a lot of people who never look at what their output is > doing... but their customers look. when i was at Eventide, we knew of the problem, conceptually (and i knew what to do about it), but it didn't get fixed until after a customer complained (which was actually after i departed). r b-j > On Nov 19, 2004, at 10:19 AM, robert bristow-johnson wrote: > >> i hadn't used the term before i heard it from Randy Yates on comp.dsp >> (who >> got it from someone else he credits). i had previously simply said >> "first >> order noise-shaping with a zero at DC around a >> round-toward-minus-infinity >> quantizer". somehow "fraction saving" seems to be a shorter term that >> is >> adequately descriptive of the operation if not sufficiently >> descriptive of >> the motivation. > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, > dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > -- r b-j From hosh at starlink.ru Fri Nov 19 18:18:04 2004 From: hosh at starlink.ru (hosh) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] Can anybody explain a simple thing? Message-ID: <003301c4ce8e$05e57c20$27050a0a@hoshstarlink> My question is about the basics of sound processing. I need to perform some processing in frequency domain. Well, then I multiply my sound by gliding window function, make FFT, perform on the image a needed transformation, make IFFT and finally assemble the resulting chunks. I faced some problems upon doing the above stated things and that's why ask about details. 1) From what kind of considerations should I choose a window function? Is it to be one of classic window functions (Hamming etc.) or I have a freedom to compose something other? 2) How profound the chunks overlapping should be to make the joints inaudible? Does it depend on whether the frequency domain manipulations are linear or not? 3) What is a final assembly: is it a mere summation or not? 4) How the first and the last chunks should be treated, like all others or not? Any explanations or links to materials containing such explanations will be gratefully appreciated. From guiseppi at mendozadil.freeserve.co.uk Fri Nov 19 18:16:09 2004 From: guiseppi at mendozadil.freeserve.co.uk (G!) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] Scotland? In-Reply-To: References: Message-ID: <419E7EB9.4000307@mendozadil.freeserve.co.uk> Steve Conner wrote: >Anybody here based in Scotland? I noticed that Stuart Yarrow mentioned >Subcity Radio in his sig. I subscribe to the a-list (for Yamaha sampler >users) and there was some talk on there about organising a jam in Scotland. >I'm not sure how it would work but I guess it might be something like the >Synth DIY meetings that happen in Cambridge. > Hello. Me is in Aberdeen. Had a peek at the website ;) Try posting this on music-bar at ampfea.org (I take it the a-list you are on about is on ampfea) If you sling in a few Tesla coils into the equation, I'm sure you'll get many musicians donning chainmail codpieces and tassles doing Electric 6 impressions ("It's my desire") No, really, mention the teslas !! :) From quintosardo at yahoo.it Fri Nov 19 20:16:31 2004 From: quintosardo at yahoo.it (Quinto Sardo) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] Can anybody explain a simple thing? In-Reply-To: <003301c4ce8e$05e57c20$27050a0a@hoshstarlink> Message-ID: <20041120011631.2561.qmail@web12502.mail.yahoo.com> This is a very basic question! :-) The only serious thing to do is to look for a good book on dsp. It is a standard problem and it is perfectly explained in every dsp text. Anyway, I do this: - Hanning window. Because it appears the best to me looking at graphs - I use approximately 3/4 overlap. before overlap, i window the chunk again. It is important if you plain to design a variable filter - The first and the last chunk are to be treated like the others - There are two ways for overlapping: overlap-add and extract-overlap. They are similar but not equal. It is not so simple to explain here. -> dsp book! - There is a very good project for this on www.musicdsp.com - section "projects" I hope it helps :-) Quinto P.s. If you want to see how it works in my synth, download it from www.sknote.it and look at the filter --- hosh ha scritto: > My question is about the basics of sound processing. > I need to perform some processing in frequency > domain. > Well, then I multiply my sound by gliding window > function, > make FFT, perform on the image a needed > transformation, > make IFFT and finally assemble the resulting chunks. > I faced some problems upon doing the above stated > things > and that's why ask about details. > > 1) From what kind of considerations should I choose > a > window function? Is it to be one of classic window > functions > (Hamming etc.) or I have a freedom to compose > something > other? > > 2) How profound the chunks overlapping should be to > make > the joints inaudible? Does it depend on whether the > frequency > domain manipulations are linear or not? > > 3) What is a final assembly: is it a mere summation > or not? > > 4) How the first and the last chunks should be > treated, > like all others or not? > > Any explanations or links to materials containing > such explanations > will be gratefully appreciated. > > -- > dupswapdrop -- the music-dsp mailing list and > website: > subscription info, FAQ, source code archive, list > archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From earlevel at earlevel.com Fri Nov 19 20:46:56 2004 From: earlevel at earlevel.com (Nigel Redmon) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] interpolating control values In-Reply-To: <49172.64.30.60.177.1100896751.squirrel@64.30.60.177> References: <49577.198.182.157.96.1100842162.squirrel@198.182.157.96> <870514AF-39FF-11D9-B53F-000A959AF1E4@earlevel.com> <1130.64.30.60.69.1100884076.squirrel@64.30.60.69> <80F6BF40-3A54-11D9-9862-000A959AF1E4@earlevel.com> <1231.64.30.62.153.1100888352.squirrel@64.30.62.153> <283D3C1A-3A59-11D9-9862-000A959AF1E4@earlevel.com> <49172.64.30.60.177.1100896751.squirrel@64.30.60.177> Message-ID: <0F620240-3A96-11D9-923A-000A959AF1E4@earlevel.com> Well, it not free, and sometimes it's not needed. I have 56k stuff where my second order filter dispense with one of the zeros just to squeeze in the cycle count. But when you talk about getting stuck at -60 or -70 dB, you're talking about 16-bit filters I'd imagine, not 56k biquads, unless you're talking about the low end of the audio as I was (a few hundred Hz and down). I always check my fixed-point filters with selectable precision (set the number of bits ) before coding on the 56k (I just checked quick, and if I didn't goof, 500 Hz gives you -90 dB at 23 significant bits--1 kHz gives you -104). On Nov 19, 2004, at 12:39 PM, robert bristow-johnson wrote: > Nigel Redmon said: >> I use it on my low audio biquads too. > > i would use it on *every* fixed-point IIR filter. when the input goes > to > silence (and the DC Blocker is there to insure that "silence" is the > same > as "zero"), you don't want your level display to go down to -60 or -70 > dB > and get stuck there. you want it to go down to -inf dB. From urs at u-he.com Fri Nov 19 21:03:08 2004 From: urs at u-he.com (Urs Heckmann) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] Can anybody explain a simple thing? In-Reply-To: <20041120011631.2561.qmail@web12502.mail.yahoo.com> References: <20041120011631.2561.qmail@web12502.mail.yahoo.com> Message-ID: <52BE77F4-3A98-11D9-A815-000A9595B180@u-he.com> schrieb Quinto Sardo: > - There is a very good project for this on > www.musicdsp.com - section "projects" Projects?!? Am I missing something?!? 8-)) however, I love the section about windowing and fft at www.dspguide.com for a begining Cheers, ;) Urs urs heckmann urs@u-he.com www.u-he.com From doug_houghton at sympatico.ca Fri Nov 19 22:19:58 2004 From: doug_houghton at sympatico.ca (Doug) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] interpolating control values References: <49577.198.182.157.96.1100842162.squirrel@198.182.157.96> Message-ID: <000701c4ceaf$d51183b0$0201a8c0@elric> I had to solve this. I update the target amplitude in db when the slider is moved. When the output buffer is being mixed I update the actual factor in db by a small amount every sample untill I'm "on target". I use 1000s of a db (or 10000s) and move to the db target by 5 every sample untill I'm there, updating the working float factor as required. ----- Original Message ----- From: To: Sent: Friday, November 19, 2004 12:29 AM Subject: [music-dsp] interpolating control values > hello, > > I'm wondering if anyone knows any tricks for removing the zipper-noise > that I'm getting from my GUI amplitude slider control. > > I initially arrived at this solution: > > [...] > // callback function > { > // test for slider update > if(data->previous_amp != data->updated_amp) > // if slider is updated interpolate between values > for( i=0; i { > // store interpolated values in array > data->scale_amp[i] = data-> previous_amp + > ( ((data-> updated_amp - data->previous_amp) / > (double)FRAMES_PER_BUFFER) * > (double)i); > *out++ = data->scale_amp[i] * data->sine[data->phase]; > } > } > else > { > // loop through buffer with static amplitude value > } > } > data->previous_amp = data->updated_amp > [...] > > however, this only seems to work at very low sample rates. it chokes on > anything above around 2000 samples per second. > > thanks for any suggestions, > aaron > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From earlevel at earlevel.com Sat Nov 20 01:09:50 2004 From: earlevel at earlevel.com (Nigel Redmon) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] interpolating control values In-Reply-To: <49172.64.30.60.177.1100896751.squirrel@64.30.60.177> References: <49577.198.182.157.96.1100842162.squirrel@198.182.157.96> <870514AF-39FF-11D9-B53F-000A959AF1E4@earlevel.com> <1130.64.30.60.69.1100884076.squirrel@64.30.60.69> <80F6BF40-3A54-11D9-9862-000A959AF1E4@earlevel.com> <1231.64.30.62.153.1100888352.squirrel@64.30.62.153> <283D3C1A-3A59-11D9-9862-000A959AF1E4@earlevel.com> <49172.64.30.60.177.1100896751.squirrel@64.30.60.177> Message-ID: BTW, in my last reply I neglected to mention that I was talking about a 48 kHz sample rate when I referenced those filter frequencies. On Nov 19, 2004, at 12:39 PM, robert bristow-johnson wrote: > Nigel Redmon said: >> Yeah, I don't find anything wrong with that description, just that >> it's >> a fraction of a fraction (which is still a fraction). > > yeah, but not the whole fraction. the salient difference is one of > scaling (in fact, in the fixed-point DC Blocker code the fraction > saved is > an integer), and usually when we (at least i) talk about uniform > quantization, i like to assume a scaling so that it is rounding to an > integer that is close by. You lost me there. If you assume a unity gain filter and the extension a2 is clear (00 or FF), your result is always between -1.0 and less than 1.0. You save that in your pole/denominator z^-1 and the fractional value is truncated. It's that difference that you save and feed back into the accumulator when you process the next sample. How do you get an integer? I mean, I'm sure we're talking about the same thing and it's a matter of semantics, but I'm not sure what point you are getting at. > 2 extra 56K instructions per biquad section per sample. That's better than me--maybe because my biquads don't have room for additional pipelining (gotta look at my code)? Or am I missing a neat trick? It's the error (the difference between the accumulator and the truncated accumulator--the value stored in the pole z^1), delayed by one sample, and added to the accumulator next time... OK, looking at my code quickly, I do see just two additional instructions for filters I used for low frequency unipolar control smoothing (just one-pole filters--I could have probably done slightly better skipping the error feedback and decimating, but in this case it wouldn't have save enough to be worth the additional testing). But on my audio filters (second order), I'm doing a little more work to account for sign extension of the error, since it's bipolar. That means, for instance, that I'm loading the saved error in an accumulator and shifting it to get the sign extension before adding it (I could saving in long memory, but that wouldn't get me to two instructions either). What am I overlooking? From quintosardo at yahoo.it Sat Nov 20 11:42:04 2004 From: quintosardo at yahoo.it (Quinto Sardo) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] Can anybody explain a simple thing? In-Reply-To: <52BE77F4-3A98-11D9-A815-000A9595B180@u-he.com> Message-ID: <20041120164204.83786.qmail@web12503.mail.yahoo.com> Ooops! I'm sorry... The right link for the example project is: http://www.u-he.com/vstsource/ Section "archives\projects" Bye Quinto --- Urs Heckmann ha scritto: > schrieb Quinto Sardo: > > > - There is a very good project for this on > > www.musicdsp.com - section "projects" > > Projects?!? Am I missing something?!? 8-)) > > however, I love the section about windowing and fft > at www.dspguide.com > for a begining > > Cheers, > > ;) Urs > > urs heckmann > urs@u-he.com > www.u-he.com > > -- > dupswapdrop -- the music-dsp mailing list and > website: > subscription info, FAQ, source code archive, list > archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From bobm.dsp at gmail.com Sat Nov 20 11:50:49 2004 From: bobm.dsp at gmail.com (Bob M) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] Can anybody explain a simple thing? In-Reply-To: <20041120011631.2561.qmail@web12502.mail.yahoo.com> References: <003301c4ce8e$05e57c20$27050a0a@hoshstarlink> <20041120011631.2561.qmail@web12502.mail.yahoo.com> Message-ID: Regarding overlap, I am confused about something. Can the overlap be any size (1/2, 3/4, 1/3, etc.) or is it restricted depending on the window function used? I ask this because I tried graphing various overlaps of various window functions, and the amplitude envelope didn't look to be consistent. In other words, if using too small or too large an overlap, the resulting envelope was not a constant. Instead it would be "wavy" looking. I've never tried implementing it, but it seems to me that this would cause some kind of volume fluctuation in the resulting audio. Thanks! Bob On Sat, 20 Nov 2004 02:16:31 +0100 (CET), Quinto Sardo wrote: > Anyway, I do this: > > - Hanning window. Because it appears the best to me > looking at graphs > - I use approximately 3/4 overlap. before overlap, i > window the chunk again. It is important if you plain > to design a variable filter From nature.boy at virgilio.it Sat Nov 20 12:00:39 2004 From: nature.boy at virgilio.it (nature.boy@virgilio.it) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] Matlab code Message-ID: <415381E700085DE8@ims5b.cp.tin.it> Do you have any matlab code about PSOLA, SASOLA algorithms? Do you know "Lim and Griffin algoritms", "rotating heads algorithm" and "periodicity detection algorithm"? Do you have any matlab code about these algorithms too? Thanks From quintosardo at yahoo.it Sat Nov 20 12:13:54 2004 From: quintosardo at yahoo.it (Quinto Sardo) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] Can anybody explain a simple thing? In-Reply-To: Message-ID: <20041120171354.88883.qmail@web12503.mail.yahoo.com> I don't window the input signal. I only window the filtered signal chunk before overlapping. New window starts after the old one has it maximum. 000123454321000 0000000012345432100000 000000000000012345432100000 (if window was triangular and 9 samples wide...) Check that example, I've posted the right link! http://www.u-he.com/vstsource/ Quinto --- Bob M ha scritto: > Regarding overlap, I am confused about something. > > Can the overlap be any size (1/2, 3/4, 1/3, etc.) or > is it restricted > depending on the window function used? I ask this > because I tried > graphing various overlaps of various window > functions, and the > amplitude envelope didn't look to be consistent. > > In other words, if using too small or too large an > overlap, the > resulting envelope was not a constant. Instead it > would be "wavy" > looking. I've never tried implementing it, but it > seems to me that > this would cause some kind of volume fluctuation in > the resulting > audio. > > Thanks! > Bob > > On Sat, 20 Nov 2004 02:16:31 +0100 (CET), Quinto > Sardo > wrote: > > Anyway, I do this: > > > > - Hanning window. Because it appears the best to > me > > looking at graphs > > - I use approximately 3/4 overlap. before overlap, > i > > window the chunk again. It is important if you > plain > > to design a variable filter > -- > dupswapdrop -- the music-dsp mailing list and > website: > subscription info, FAQ, source code archive, list > archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > ___________________________________ Nuovo Yahoo! Messenger: E' molto pi? divertente: Audibles, Avatar, Webcam, Giochi, Rubrica Scaricalo ora! http://it.messenger.yahoo.it From nature.boy at virgilio.it Sat Nov 20 12:26:27 2004 From: nature.boy at virgilio.it (nature.boy@virgilio.it) Date: Sun Jan 21 12:10:36 2007 Subject: [music-dsp] Matlab code Message-ID: <415381E700085E76@ims5b.cp.tin.it> Do you have any matlab code about PSOLA, SASOLA algorithms? I have to apply these algorithms to file wave. Do you know "Lim and Griffin algoritms", "rotating heads algorithm" and "periodicity detection algorithm"? Do you have any matlab code about these algorithms too? Thank you for your attention From rbj at surfglobal.net Sat Nov 20 12:50:28 2004 From: rbj at surfglobal.net (robert bristow-johnson) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] interpolating control values In-Reply-To: References: <49577.198.182.157.96.1100842162.squirrel@198.182.157.96> <870514AF-39FF-11D9-B53F-000A959AF1E4@earlevel.com> <1130.64.30.60.69.1100884076.squirrel@64.30.60.69> <80F6BF40-3A54-11D9-9862-000A959AF1E4@earlevel.com> <1231.64.30.62.153.1100888352.squirrel@64.30.62.153> <283D3C1A-3A59-11D9-9862-000A959AF1E4@earlevel.com> <49172.64.30.60.177.1100896751.squirrel@64.30.60.177> Message-ID: <1144.64.30.62.188.1100973028.squirrel@64.30.62.188> Nigel Redmon said: > BTW, in my last reply I neglected to mention that I was talking about a > 48 kHz sample rate when I referenced those filter frequencies. yeah, i guess the coefs become more of a problem for Fs = 96 kHz. > On Nov 19, 2004, at 12:39 PM, robert bristow-johnson wrote: >> Nigel Redmon said: >>> Yeah, I don't find anything wrong with that description, just that >>> it's >>> a fraction of a fraction (which is still a fraction). >> >> yeah, but not the whole fraction. the salient difference is one of >> scaling (in fact, in the fixed-point DC Blocker code the fraction >> saved is >> an integer), and usually when we (at least i) talk about uniform >> quantization, i like to assume a scaling so that it is rounding to an >> integer that is close by. > > You lost me there. If you assume a unity gain filter and the extension > a2 is clear (00 or FF), your result is always between -1.0 and less > than 1.0. sorry to confuse. it's just an convention of expression. when i talk about uniform quantization, almost invariably i mean either Q{x} = floor(x) for round to -inf or Q{x} = floor(x + 0.5) for round to nearest in both cases they round to an integer and "fraction saving" saves the fractional part in the first case, zero-extends it, and adds that zero-extended fractional part back in the next sample before quantization. of course for the 56K if you are looking at those 24 bit numbers as "fixed" instead of "int", then there is scaling (and unscaling) necessary to use the "floor()" function. for the 56K: Q56K{x} = 2^-23 * floor(2^23 * x) for round to -inf or Q56K{x} = 2^-23 * floor(2^23 * x + 2^22) for round to nearest > You save that in your pole/denominator z^-1 and the > fractional value is truncated. It's that difference that you save and > feed back into the accumulator when you process the next sample. How do > you get an integer? I mean, I'm sure we're talking about the same thing > and it's a matter of semantics, but I'm not sure what point you are > getting at. the semantic difference is that when i look at a quantizer, i always think of it as rounding to an integer and i surround that with scaling operations. >> 2 extra 56K instructions per biquad section per sample. > > That's better than me--maybe because my biquads don't have room for > additional pipelining (gotta look at my code)? Or am I missing a neat > trick? there is a trick. > It's the error (the difference between the accumulator and the > truncated accumulator--the value stored in the pole z^1), delayed by > one sample, and added to the accumulator next time... OK, looking at my > code quickly, I do see just two additional instructions for filters I > used for low frequency unipolar control smoothing (just one-pole > filters--I could have probably done slightly better skipping the error > feedback and decimating, but in this case it wouldn't have save enough > to be worth the additional testing). > > But on my audio filters (second order), I'm doing a little more work to > account for sign extension of the error, since it's bipolar. not if you always round *down*. then you zero-extend your error. > That > means, for instance, that I'm loading the saved error in an accumulator > and shifting it to get the sign extension before adding it (I could > saving in long memory, but that wouldn't get me to two instructions > either). > > What am I overlooking? not much. it's mostly semantics and maybe one little 56K trick. -- r b-j From earlevel at earlevel.com Sat Nov 20 14:36:57 2004 From: earlevel at earlevel.com (Nigel Redmon) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] interpolating control values In-Reply-To: <1144.64.30.62.188.1100973028.squirrel@64.30.62.188> References: <49577.198.182.157.96.1100842162.squirrel@198.182.157.96> <870514AF-39FF-11D9-B53F-000A959AF1E4@earlevel.com> <1130.64.30.60.69.1100884076.squirrel@64.30.60.69> <80F6BF40-3A54-11D9-9862-000A959AF1E4@earlevel.com> <1231.64.30.62.153.1100888352.squirrel@64.30.62.153> <283D3C1A-3A59-11D9-9862-000A959AF1E4@earlevel.com> <49172.64.30.60.177.1100896751.squirrel@64.30.60.177> <1144.64.30.62.188.1100973028.squirrel@64.30.62.188> Message-ID: <8A9DF63A-3B2B-11D9-B7E9-000A959AF1E4@earlevel.com> Thanks for the explanation Robert. I assume you mean you're rounding the last mac (macr) before the quantization. I suspected that after a little more thought--I hadn't considered that, when I coded this before, as a way to get rid of the pesky sign-extension problem. And yes, 96 kHz and 192 kHz are a different story--a lot more of this required for biquad. A lot of my code has conditional assembly for the noise shaping at the higher rates. (If it doesn't make sense why I'd skip it at all, it's because I'm supporting older DSPs--the ones that can do 96k/192k also have more horsepower). (And the state variable ends up being a nice bargain at the higher rates :-) On Nov 20, 2004, at 9:50 AM, robert bristow-johnson wrote: > > Nigel Redmon said: >> BTW, in my last reply I neglected to mention that I was talking about >> a >> 48 kHz sample rate when I referenced those filter frequencies. > > yeah, i guess the coefs become more of a problem for Fs = 96 kHz. > >> On Nov 19, 2004, at 12:39 PM, robert bristow-johnson wrote: >>> Nigel Redmon said: >>>> Yeah, I don't find anything wrong with that description, just that >>>> it's >>>> a fraction of a fraction (which is still a fraction). >>> >>> yeah, but not the whole fraction. the salient difference is one of >>> scaling (in fact, in the fixed-point DC Blocker code the fraction >>> saved is >>> an integer), and usually when we (at least i) talk about uniform >>> quantization, i like to assume a scaling so that it is rounding to an >>> integer that is close by. >> >> You lost me there. If you assume a unity gain filter and the extension >> a2 is clear (00 or FF), your result is always between -1.0 and less >> than 1.0. > > sorry to confuse. it's just an convention of expression. when i talk > about uniform quantization, almost invariably i mean either > > Q{x} = floor(x) for round to -inf > > or > > Q{x} = floor(x + 0.5) for round to nearest > > in both cases they round to an integer and "fraction saving" saves the > fractional part in the first case, zero-extends it, and adds that > zero-extended fractional part back in the next sample before > quantization. > of course for the 56K if you are looking at those 24 bit numbers as > "fixed" instead of "int", then there is scaling (and unscaling) > necessary > to use the "floor()" function. for the 56K: > > Q56K{x} = 2^-23 * floor(2^23 * x) for round to -inf > > or > > Q56K{x} = 2^-23 * floor(2^23 * x + 2^22) for round to nearest > >> You save that in your pole/denominator z^-1 and the >> fractional value is truncated. It's that difference that you save and >> feed back into the accumulator when you process the next sample. How >> do >> you get an integer? I mean, I'm sure we're talking about the same >> thing >> and it's a matter of semantics, but I'm not sure what point you are >> getting at. > > the semantic difference is that when i look at a quantizer, i always > think > of it as rounding to an integer and i surround that with scaling > operations. > >>> 2 extra 56K instructions per biquad section per sample. >> >> That's better than me--maybe because my biquads don't have room for >> additional pipelining (gotta look at my code)? Or am I missing a neat >> trick? > > there is a trick. > >> It's the error (the difference between the accumulator and the >> truncated accumulator--the value stored in the pole z^1), delayed by >> one sample, and added to the accumulator next time... OK, looking at >> my >> code quickly, I do see just two additional instructions for filters I >> used for low frequency unipolar control smoothing (just one-pole >> filters--I could have probably done slightly better skipping the error >> feedback and decimating, but in this case it wouldn't have save enough >> to be worth the additional testing). >> >> But on my audio filters (second order), I'm doing a little more work >> to >> account for sign extension of the error, since it's bipolar. > > not if you always round *down*. then you zero-extend your error. > >> That >> means, for instance, that I'm loading the saved error in an >> accumulator >> and shifting it to get the sign extension before adding it (I could >> saving in long memory, but that wouldn't get me to two instructions >> either). >> >> What am I overlooking? > > not much. it's mostly semantics and maybe one little 56K trick. > > -- > > r b-j From dfl at alum.mit.edu Sat Nov 20 15:35:02 2004 From: dfl at alum.mit.edu (David Lowenfels) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Can anybody explain a simple thing? In-Reply-To: <20041120170100.4F3FE1758097@music.calarts.edu> References: <20041120170100.4F3FE1758097@music.calarts.edu> Message-ID: You need to use a Constant OverLap Add window (COLA). The overlap can be any value that yields a flat summation envelope. Read explanation here by jeffyB: http://www.musicdsp.org/phpWiki/index.php/ filtering%20in%20the%20frequency%20domain -David On Nov 20, 2004, at 9:01 AM, music-dsp-request@shoko.calarts.edu wrote: > Message: 9 > Date: Sat, 20 Nov 2004 11:50:49 -0500 > From: Bob M > Subject: Re: [music-dsp] Can anybody explain a simple thing? > To: a list for musical digital signal processing > > Message-ID: > Content-Type: text/plain; charset=US-ASCII > > Regarding overlap, I am confused about something. > > Can the overlap be any size (1/2, 3/4, 1/3, etc.) or is it restricted > depending on the window function used? I ask this because I tried > graphing various overlaps of various window functions, and the > amplitude envelope didn't look to be consistent. > > In other words, if using too small or too large an overlap, the > resulting envelope was not a constant. Instead it would be "wavy" > looking. I've never tried implementing it, but it seems to me that > this would cause some kind of volume fluctuation in the resulting > audio. > > Thanks! > Bob From rbj at surfglobal.net Sat Nov 20 17:11:18 2004 From: rbj at surfglobal.net (robert bristow-johnson) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] interpolating control values In-Reply-To: <8A9DF63A-3B2B-11D9-B7E9-000A959AF1E4@earlevel.com> References: <49577.198.182.157.96.1100842162.squirrel@198.182.157.96> <870514AF-39FF-11D9-B53F-000A959AF1E4@earlevel.com> <1130.64.30.60.69.1100884076.squirrel@64.30.60.69> <80F6BF40-3A54-11D9-9862-000A959AF1E4@earlevel.com> <1231.64.30.62.153.1100888352.squirrel@64.30.62.153> <283D3C1A-3A59-11D9-9862-000A959AF1E4@earlevel.com> <49172.64.30.60.177.1100896751.squirrel@64.30.60.177> <1144.64.30.62.188.1100973028.squirrel@64.30.62.188> <8A9DF63A-3B2B-11D9-B7E9-000A959AF1E4@earlevel.com> Message-ID: <1186.64.30.60.51.1100988678.squirrel@64.30.60.51> Nigel Redmon said: > Thanks for the explanation Robert. I assume you mean you're rounding > the last mac (macr) before the quantization. NO! i round down, saving the truncated bits for the next sample. > I suspected that after a > little more thought--I hadn't considered that, when I coded this > before, as a way to get rid of the pesky sign-extension problem. it gets rid of the pesky sign-extension problem. no need to extend any sign bits. BTW, i made a typo (actually a brain hiccup) i should have said: >> for the 56K: >> >> Q56K{x} = 2^-23 * floor(2^23 * x) for round toward -inf >> >> or >> >> Q56K{x} = 2^-23 * floor(2^23 * x + 0.5) for round to nearest -- r b-j From earlevel at earlevel.com Sat Nov 20 18:03:44 2004 From: earlevel at earlevel.com (Nigel Redmon) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] interpolating control values In-Reply-To: <1186.64.30.60.51.1100988678.squirrel@64.30.60.51> References: <49577.198.182.157.96.1100842162.squirrel@198.182.157.96> <870514AF-39FF-11D9-B53F-000A959AF1E4@earlevel.com> <1130.64.30.60.69.1100884076.squirrel@64.30.60.69> <80F6BF40-3A54-11D9-9862-000A959AF1E4@earlevel.com> <1231.64.30.62.153.1100888352.squirrel@64.30.62.153> <283D3C1A-3A59-11D9-9862-000A959AF1E4@earlevel.com> <49172.64.30.60.177.1100896751.squirrel@64.30.60.177> <1144.64.30.62.188.1100973028.squirrel@64.30.62.188> <8A9DF63A-3B2B-11D9-B7E9-000A959AF1E4@earlevel.com> <1186.64.30.60.51.1100988678.squirrel@64.30.60.51> Message-ID: <6D430DA8-3B48-11D9-B7E9-000A959AF1E4@earlevel.com> Doh! It's been a while--I was doing that all along, just not taking advantage of the lack of sign extension like I should have been, doing unnecessary work. I made a mental goof when I was thinking about whether I'd have a signed error after truncation. Thanks! On Nov 20, 2004, at 2:11 PM, robert bristow-johnson wrote: > > Nigel Redmon said: >> Thanks for the explanation Robert. I assume you mean you're rounding >> the last mac (macr) before the quantization. > > NO! i round down, saving the truncated bits for the next sample. > >> I suspected that after a >> little more thought--I hadn't considered that, when I coded this >> before, as a way to get rid of the pesky sign-extension problem. > > it gets rid of the pesky sign-extension problem. no need to extend any > sign bits. > > BTW, i made a typo (actually a brain hiccup) i should have said: > >>> for the 56K: >>> >>> Q56K{x} = 2^-23 * floor(2^23 * x) for round toward -inf >>> >>> or >>> >>> Q56K{x} = 2^-23 * floor(2^23 * x + 0.5) for round to nearest > > > -- > > r b-j From klezmer41 at yahoo.com Sun Nov 21 06:12:21 2004 From: klezmer41 at yahoo.com (Scott Hildebrand) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Hey I'm a new member! Also looking for developers for a special project. Message-ID: <20041121111221.88494.qmail@web50606.mail.yahoo.com> My name is Scott and I used to do a lot more programming than I have been lately. I have a good background in spatial audio programming using Max/MSP and Pd. Since then things have changed and I do more management. I recently started a new company which is a digital music distribution model based in California. The software needed will resemble a Winamp or iTunes. I really have no clue about where to start with this, and I just found this list so maybe I can get some people involved to help this thing become a success. Some programming specialities that will be needed are playback support in pretty much every format, CD ripping and burning, music library design and organizing, cool GUI and skin support, network programming, internet radio via streamcast or icecast. I've done a little bit with something like FLTK but not a lot. Anyway please let me know who's here and if anybody is interested we'll talk. Scott __________________________________ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.yahoo.com From mark.sandler at elec.qmul.ac.uk Sun Nov 21 12:22:58 2004 From: mark.sandler at elec.qmul.ac.uk (mark sandler) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] post-doctoral researcher required for Centre for Digital Music, London Message-ID: Centre for Digital Music Queen Mary University of London Post-Doctoral Research Assistant for EPSRC SeMMA project Hierarchical Segmentation and Semantic Markup of Musical Audio This 3 year EPSRC project is concerned with using the latest developments in modelling, extraction, representing and exploitation of musically relevant semantic features direct from musical content, in order to produce salient and relevant segmentations of musical audio. The latter half of the project is concerned with applications of these segmentations to both Music Information Retrieval and Intelligent Audio Editing. SeMMA is a collaboration between the Centre for Digital Music at Queen Mary University of London and the Department of Computing at Goldsmiths? College, University of London. Each partner employs one post-doctoral researcher. It is expected that both researchers will spend time in the other?s laboratory, both being located in Central London. The post available is at the Centre for Digital Music, and is for a maximum of 29 months, taking over from Dr Samer Abdullah who is moving on to another EPSRC project. Candidates for the post will be expected to have experience in various aspects of DSP for Music & Audio and Music Information Retrieval. Fuller details of the project and person specification are available from mark.sandler@elec.qmul.ac.uk. The application form will be available from http://www.elec.qmul.ac.uk. Informal enquiries about any of these posts may be made to Professor Mark Sandler by telephone (+44 (0)20 7882 7680) or by email (mark.sandler@elec.qmul.ac.uk). Completed application forms including the names and addresses of three referees, a CV and publications list, should be returned to Ms Michele Kavanagh, SeMMA project, Department of Electronic Engineering, Queen Mary, University of London, Mile End Road, London E1 4NS by 30th November 2004. We hope that the appointed person will start in January or February 2005. From peter at sonicreef.com Sun Nov 21 18:28:08 2004 From: peter at sonicreef.com (Peter Thom) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] simple filter design app In-Reply-To: Message-ID: <1101079697.24948@mx250c.mysite4now.com> Does anybody know of a simple filter design app, that allows me to choose from some basic waveforms (saw, rectangle, triangle, sine), apply a self defined filter, and display input and output waveforms and their corresponding FFTs? I'm looking for something like that, that's easier to use than Matlab or its clones. Peter -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.289 / Virus Database: 265.4.1 - Release Date: 11/19/2004 From bobm.dsp at gmail.com Sun Nov 21 23:52:03 2004 From: bobm.dsp at gmail.com (Bob M) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Can anybody explain a simple thing? In-Reply-To: References: <20041120170100.4F3FE1758097@music.calarts.edu> Message-ID: David, Thanks for the explanation. I've seen that link before, and looked for "COLA" in various DSP texts, but I haven't been able to find it. Do you know of any texts that list the overlaps for various windows that give a constant result? Also, is it fair to say that the window chosen defines the restrictions on the overlap? It seems that, for example, many descriptions for phase vocoders imply that the overlap can be of any size. However, it seems that may not be the case. Thanks, Bob On Sat, 20 Nov 2004 12:35:02 -0800, David Lowenfels wrote: > You need to use a Constant OverLap Add window (COLA). The overlap can > be any value that yields a flat summation envelope. Read explanation > here by jeffyB: > http://www.musicdsp.org/phpWiki/index.php/ > filtering%20in%20the%20frequency%20domain > > -David From chalil.lists at gmail.com Mon Nov 22 00:17:57 2004 From: chalil.lists at gmail.com (md chalil) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] graphic equalizer Message-ID: hi, This is a query regarding graphic equalizer to play mp3 like streams. Is it possible to realize a graphic equalizer by scaling the filter bank output? thanks in advance for your reply. chalil From signalzerodb at yahoo.co.uk Mon Nov 22 05:27:08 2004 From: signalzerodb at yahoo.co.uk (Dave Gamble) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] graphic equalizer In-Reply-To: References: Message-ID: <104B4926-3C71-11D9-A598-000A958903DE@yahoo.co.uk> On 22 Nov 2004, at 05:17, md chalil wrote: > hi, > This is a query regarding graphic equalizer to play mp3 like streams. > Is it possible to realize a graphic equalizer by scaling the filter > bank output? > Technically it's possible. I'd always assumed that that was how they -all- did it! :) Dave. From jamie at postlude.co.uk Mon Nov 22 05:50:36 2004 From: jamie at postlude.co.uk (Jamie Bullock) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Sine wave generation Message-ID: <1101120636.3877.19.camel@localhost.localdomain> Dear list, I am trying to generate a sinusoidal waveform using the following method: ---------------- ip = initial phase = [0 < 2pi) w = phase increment = 2pi / 100 (I am filling a 100 point table) b1 = 2.0 * cos(w) y1 = sin(ip - w) y2 = sin(ip - 2.0 * w) y0 = b1 * y1 - y2 y2 = y1 y1 = y0 ----------------- The problem I am getting is that it only seems to work properly for phase values of (-)pi for a sine wave and (-)2pi or 0 for a cosine wave. Any other phase value seems to generate a massive amplitude change, but not the correct phase change. Am I missing something obvious? Any help appreciated. Regards, Jamie Bullock - Birmingham Conservatoire UK - From xue.wen at elec.qmul.ac.uk Mon Nov 22 06:00:45 2004 From: xue.wen at elec.qmul.ac.uk (Wen X) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Can anybody explain a simple thing? References: <20041120170100.4F3FE1758097@music.calarts.edu> Message-ID: <007001c4d082$96014cd0$4f21258a@wenpc> Indeed all frame based processing has the problem of maintaining shift-invariance property, i.e. every sample point being treated the same way. Failure to do so, even when you're using COLA, introduces artefacts. The ideal way is of course using a window shift step at 1, which is computationally expensive. Usually the shift step is made as small as acceptable (for computing reasons) to reduce the artefacts. In this case the COLA is preferred to give a more flat envelope. xue ----- Original Message ----- From: "Bob M" To: "a list for musical digital signal processing" Sent: Monday, November 22, 2004 4:52 AM Subject: Re: Re: [music-dsp] Can anybody explain a simple thing? > David, > > Thanks for the explanation. I've seen that link before, and looked for > "COLA" in various DSP texts, but I haven't been able to find it. Do > you know of any texts that list the overlaps for various windows that > give a constant result? > > Also, is it fair to say that the window chosen defines the > restrictions on the overlap? It seems that, for example, many > descriptions for phase vocoders imply that the overlap can be of any > size. However, it seems that may not be the case. > > Thanks, > Bob > > On Sat, 20 Nov 2004 12:35:02 -0800, David Lowenfels > wrote: >> You need to use a Constant OverLap Add window (COLA). The overlap can >> be any value that yields a flat summation envelope. Read explanation >> here by jeffyB: >> http://www.musicdsp.org/phpWiki/index.php/ >> filtering%20in%20the%20frequency%20domain >> >> -David > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, > dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From joshscholar at yahoo.com Mon Nov 22 13:32:29 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] graphic equalizer References: <104B4926-3C71-11D9-A598-000A958903DE@yahoo.co.uk> Message-ID: <000701c4d0c1$a0d22a50$61e22641@antssoftware.com> Winamp has a standard equalizer in a separate stage so that it's the same from one format to the next. ----- Original Message ----- From: Dave Gamble To: md chalil ; a list for musical digital signal processing Sent: Monday, November 22, 2004 2:27 AM Subject: Re: [music-dsp] graphic equalizer On 22 Nov 2004, at 05:17, md chalil wrote: > hi, > This is a query regarding graphic equalizer to play mp3 like streams. > Is it possible to realize a graphic equalizer by scaling the filter > bank output? > Technically it's possible. I'd always assumed that that was how they -all- did it! :) Dave. -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From koen at smartelectronix.com Mon Nov 22 15:50:33 2004 From: koen at smartelectronix.com (Koen Tanghe) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Can anybody explain a simple thing? References: <20041120170100.4F3FE1758097@music.calarts.edu> Message-ID: <006101c4d0d4$e96d6000$6402a8c0@kthome1> You might be interested in this paper: "Traditional implementations of a phase-vocoder: the tricks of the trade" by De G?tzen, Bernardini and Arfib Link: http://www.cs.princeton.edu/courses/archive/spring03/cs325/Bernardini.pdf Koen On Monday, November 22, 2004 5:52 AM [GMT+1=CET], Bob M wrote: > David, > > Thanks for the explanation. I've seen that link before, and looked for > "COLA" in various DSP texts, but I haven't been able to find it. Do > you know of any texts that list the overlaps for various windows that > give a constant result? > > Also, is it fair to say that the window chosen defines the > restrictions on the overlap? It seems that, for example, many > descriptions for phase vocoders imply that the overlap can be of any > size. However, it seems that may not be the case. > > Thanks, > Bob > > On Sat, 20 Nov 2004 12:35:02 -0800, David Lowenfels > wrote: >> You need to use a Constant OverLap Add window (COLA). The overlap can >> be any value that yields a flat summation envelope. Read explanation >> here by jeffyB: >> http://www.musicdsp.org/phpWiki/index.php/ >> filtering%20in%20the%20frequency%20domain >> >> -David From doug_houghton at sympatico.ca Mon Nov 22 21:59:29 2004 From: doug_houghton at sympatico.ca (Doug) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] arghhhh - resampling References: <20041120170100.4F3FE1758097@music.calarts.edu> <006101c4d0d4$e96d6000$6402a8c0@kthome1> Message-ID: <000301c4d108$732d7900$0201a8c0@elric> so when you're doing the zero stuffing thing you have to use a low pass filter that has more terms than your oversample rate..otherwise you're forcing zeros into the audio since at some point all n terms will be zero in your FIR filter. so anyone know a good tutorial for deriving quadratic cooeffecients (I think that's the right term) for arbitrary filter sizes? From xue.wen at elec.qmul.ac.uk Tue Nov 23 03:47:15 2004 From: xue.wen at elec.qmul.ac.uk (Wen X) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Sine wave generation References: <1101120636.3877.19.camel@localhost.localdomain> Message-ID: <001501c4d139$1a39e780$2e21258a@wenpc> the given code describes the correct procedure if there is anything wrong, it's outside the code i guess xue ----- Original Message ----- From: "Jamie Bullock" To: "a list for musical digital signal processing" Sent: Monday, November 22, 2004 10:50 AM Subject: [music-dsp] Sine wave generation > > Dear list, > > I am trying to generate a sinusoidal waveform using the following > method: > > ---------------- > > ip = initial phase = [0 < 2pi) > w = phase increment = 2pi / 100 (I am filling a 100 point table) > > b1 = 2.0 * cos(w) > y1 = sin(ip - w) > y2 = sin(ip - 2.0 * w) > > y0 = b1 * y1 - y2 > y2 = y1 > y1 = y0 > > ----------------- > > > The problem I am getting is that it only seems to work properly for > phase values of (-)pi for a sine wave and (-)2pi or 0 for a cosine > wave. Any other phase value seems to generate a massive amplitude > change, but not the correct phase change. > > Am I missing something obvious? > > Any help appreciated. > > Regards, > > Jamie Bullock > > - > Birmingham Conservatoire > UK > - > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, > dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From signalzerodb at yahoo.co.uk Tue Nov 23 05:08:25 2004 From: signalzerodb at yahoo.co.uk (Dave Gamble) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Sine wave generation In-Reply-To: <001501c4d139$1a39e780$2e21258a@wenpc> References: <1101120636.3877.19.camel@localhost.localdomain> <001501c4d139$1a39e780$2e21258a@wenpc> Message-ID: <9D6C76E8-3D37-11D9-8BCC-000A958903DE@yahoo.co.uk> On 23 Nov 2004, at 08:47, Wen X wrote: > the given code describes the correct procedure > if there is anything wrong, > it's outside the code i guess > I second this. All the variables are floats or doubles, right? Dave. > xue > > ----- Original Message ----- From: "Jamie Bullock" > > To: "a list for musical digital signal processing" > > Sent: Monday, November 22, 2004 10:50 AM > Subject: [music-dsp] Sine wave generation > > >> >> Dear list, >> >> I am trying to generate a sinusoidal waveform using the following >> method: >> >> ---------------- >> >> ip = initial phase = [0 < 2pi) >> w = phase increment = 2pi / 100 (I am filling a 100 point table) >> >> b1 = 2.0 * cos(w) >> y1 = sin(ip - w) >> y2 = sin(ip - 2.0 * w) >> >> y0 = b1 * y1 - y2 >> y2 = y1 >> y1 = y0 >> >> ----------------- >> >> >> The problem I am getting is that it only seems to work properly for >> phase values of (-)pi for a sine wave and (-)2pi or 0 for a cosine >> wave. Any other phase value seems to generate a massive amplitude >> change, but not the correct phase change. >> >> Am I missing something obvious? >> >> Any help appreciated. >> >> Regards, >> >> Jamie Bullock >> >> - >> Birmingham Conservatoire >> UK >> - >> >> -- >> dupswapdrop -- the music-dsp mailing list and website: >> subscription info, FAQ, source code archive, list archive, book >> reviews, dsp links >> http://shoko.calarts.edu/musicdsp >> http://ceait.calarts.edu/mailman/listinfo/music-dsp > > -- > dupswapdrop -- the music-dsp mailing list and website: subscription > info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From warder at dlc.fi Tue Nov 23 14:38:00 2004 From: warder at dlc.fi (Vesa Norilo) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Sine wave generation In-Reply-To: <1101120636.3877.19.camel@localhost.localdomain> References: <1101120636.3877.19.camel@localhost.localdomain> Message-ID: <41A39198.7090303@dlc.fi> >I am trying to generate a sinusoidal waveform using the following >method: > >---------------- > >ip = initial phase = [0 < 2pi) >w = phase increment = 2pi / 100 (I am filling a 100 point table) > >b1 = 2.0 * cos(w) >y1 = sin(ip - w) >y2 = sin(ip - 2.0 * w) > >y0 = b1 * y1 - y2 >y2 = y1 >y1 = y0 > >----------------- > > > I hope I don't seem to underestimate you, apologies if this is obvious. Are you sure that you've noticed that the first part with the trigonometric functions is the initialization code? Only run that once and keep going with y0=... part. Set starting phase and frequency and let the algorithm stream the sine wave for you... Vesa From davis.sos at gmail.com Wed Nov 24 00:30:50 2004 From: davis.sos at gmail.com (davis) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] graphic equalizer Message-ID: <8f35c29d04112321303b2bb0b@mail.gmail.com> hi challil, i don't know much but there is an article on this line "A generic framework for filtering in subband-domain" by Abdellatif Benjelloun Touimi. try google if not i'll send to your id. davis From koen at smartelectronix.com Thu Nov 25 08:04:01 2004 From: koen at smartelectronix.com (Koen Tanghe) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Matrix calculations library for use with DSP? Message-ID: <000701c4d2ef$3bc799d0$6402a8c0@kthome1> Hi, I'm looking for a good and efficient matrix calculations library (preferably C++, but C is also fine, including matrix transposition and inversion) that works fine with MSVC++ 6 and is easy to install/use. And (as if that wasn't enough yet) preferably with a non-intrusive license (something LGPL would be great). Surely some of you have experience with that :-D ? Koen From d.sbragion at infotecna.it Thu Nov 25 08:31:10 2004 From: d.sbragion at infotecna.it (Denis Sbragion) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Matrix calculations library for use with DSP? In-Reply-To: <000701c4d2ef$3bc799d0$6402a8c0@kthome1> Message-ID: <5.1.0.14.1.20041125142827.029ad6b8@pop3.infotecna.lcl> Hello, At 14.04 25/11/2004 +0100, you wrote: >I'm looking for a good and efficient matrix calculations library (preferably >C++, but C is also fine, including matrix transposition and inversion) that >works fine with MSVC++ 6 and is easy to install/use. And (as if that wasn't >enough yet) preferably with a non-intrusive license (something LGPL would be >great). >Surely some of you have experience with that :-D ? Gnu Scientific Library? http://sources.redhat.com/gsl/ It is of course more Unix oriented but never found any big problem using it with VC. Bye, -- Denis Sbragion InfoTecna Tel: +39 0362 805396, Fax: +39 0362 805404 URL: http://www.infotecna.it From gogins at pipeline.com Thu Nov 25 09:59:52 2004 From: gogins at pipeline.com (Michael Gogins) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Matrix calculations library for use with DSP? References: <000701c4d2ef$3bc799d0$6402a8c0@kthome1> Message-ID: <002001c4d2ff$6dae9d30$0901000a@Generator> For this purpose I use boost::numeric::ublas (micro-BLAS). It is all C++ header files, seems to work fine, and compiles with gcc and MSVC++ 7 or 7.1. The Web page says it works with 6 too. The license is permissive. Great stuff -- used it for years for matrix arithmetic and random number generation. I've tried other packages (TNT, my own, and stuff from CERN) but this seems best so far for C/C++. However, if you need serious firepower, and you have a good FORTRAN compiler, you should probably be using ATLAS. ublas is somewhat slower than ATLAS though ublas is fastest of the C++ packagesI've tried. If you needs are simple and speed not so important, TNT might be a better choice (smaller, easier to manage). ----- Original Message ----- From: "Koen Tanghe" To: "a list for musical digital signal processing" Sent: Thursday, November 25, 2004 8:04 AM Subject: [music-dsp] Matrix calculations library for use with DSP? > Hi, > I'm looking for a good and efficient matrix calculations library > (preferably > C++, but C is also fine, including matrix transposition and inversion) > that > works fine with MSVC++ 6 and is easy to install/use. And (as if that > wasn't > enough yet) preferably with a non-intrusive license (something LGPL would > be > great). > Surely some of you have experience with that :-D ? > Koen > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, > dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From pmcleod at cs.otago.ac.nz Fri Nov 26 02:36:27 2004 From: pmcleod at cs.otago.ac.nz (Philip Mcleod) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Sine wave generation In-Reply-To: <41A39198.7090303@dlc.fi> Message-ID: If you are just filling an array with a sin wave then here is some c/c++ code that will do it reasonbly fast. /* Fills array with a sine wave of angular velocity w */ void fastSinFill(double *array, int length, double w, double initPhase) { double b1 = 2.0 * cos(w); array[0] = sin(initPhase); array[1] = sin(initPhase + w); for(int j=2; j < length; j++) array[j] = b1 * array[j-1] - array[j-2]; } An example call would be: double x[1000]; fastSinFill(x, 1000, 2.0 * M_PI / 100.0, 0.0); This would populate x with the first 1000 terms of the sine wave. However if you want to generate the terms on the fly then here is an example of a nice c++ class to do it. class SinGenerator { double y1, y2, w, b1; public: SinGenerator(double w_, double initPhase_=0) { w = w_; b1 = 2.0 * cos(w); y1 = sin(initPhase_ - w); y2 = sin(initPhase_ - 2.0 * w); } double next() { double y0 = b1 * y1 - y2; y2 = y1; y1 = y0; return y0; } }; Then to use it you just create a SinGenerator with the parameters you want. Then call repeatly call next() to get the sin wave. eg. SinGenerator sinGen(2.0 * M_PI / 100.0); for(int j=0; j<100; j++) printf("%lf\n", sinGen.next()); Enjoy :) Philip McLeod From jchandjr at bellsouth.net Fri Nov 26 02:51:37 2004 From: jchandjr at bellsouth.net (James Chandler Jr) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Fletcher-Munson Compressor References: <20041120170100.4F3FE1758097@music.calarts.edu> <006101c4d0d4$e96d6000$6402a8c0@kthome1> Message-ID: <029901c4d38c$c2ad0e60$6401a8c0@JamesCompaq3080> Are there any compressors that dynamically adjust the signal's frequency balance according to the instantaneous gain? If so, are such gadgets common? Any brand names? Thanks JCJR From S.Liddle at ioe.ac.uk Fri Nov 26 03:52:55 2004 From: S.Liddle at ioe.ac.uk (Steven Liddle) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Fletcher-Munson Compressor Message-ID: <2913853E9A63BE44A22651AAF9BCB2240CC6FC@mail03.ioead> >Are there any compressors that dynamically adjust the signal's frequency balance >according to the instantaneous gain? If so, are such gadgets common? Any brand >names? I've heard of radio stations using this type of compressor to program a 'station sound'. Will investigate brands later. From jchandjr at bellsouth.net Fri Nov 26 04:04:43 2004 From: jchandjr at bellsouth.net (James Chandler Jr) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Fletcher-Munson Compressor References: <2913853E9A63BE44A22651AAF9BCB2240CC6FC@mail03.ioead> Message-ID: <02a601c4d396$f90d9ab0$6401a8c0@JamesCompaq3080> Thanks, Steven Have heard of some famous 'radio station' compressors that were just early specimens of multi-band compressors. The psycho-acoustic complaint sometimes heard about flat-freq-response single-band compressors, that in high compression the devices give the psycho-acoustic impression of 'dull sound' or 'loss of highs'. A simple multi-band compressor MIGHT avoid that, if the main compression gets done in the bass/mids, leaving the highs relatively unaffected. But a single-band compressor which would dynamically boost highs/lows under heavy compression, might be a slightly different animal. Perhaps a useless animal too, dunno (GRIN). JCJR ----- Original Message ----- From: "Steven Liddle" To: "a list for musical digital signal processing" Sent: Friday, November 26, 2004 3:52 AM Subject: RE: [music-dsp] Fletcher-Munson Compressor >Are there any compressors that dynamically adjust the signal's frequency >balance >according to the instantaneous gain? If so, are such gadgets common? Any brand >names? I've heard of radio stations using this type of compressor to program a 'station sound'. Will investigate brands later. -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From holger.strauss at vcs.de Fri Nov 26 04:05:36 2004 From: holger.strauss at vcs.de (Holger Strauss) Date: Sun Jan 21 12:10:37 2007 Subject: AW: [music-dsp] Fletcher-Munson Compressor Message-ID: <1A1D665B61AB3A4DBADE132ABFF9FB7702CBE711@exchange.vcs.de> Most radio stations use the Optimod devices from Orban. The manuals downloadable from www.orban.com contain a lot of technical details. Holger > >Are there any compressors that dynamically adjust the signal's frequency > balance > >according to the instantaneous gain? If so, are such gadgets common? Any > brand > >names? > > I've heard of radio stations using this type of compressor to program a > 'station sound'. > Will investigate brands later. > From S.Liddle at ioe.ac.uk Fri Nov 26 04:40:30 2004 From: S.Liddle at ioe.ac.uk (Steven Liddle) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Fletcher-Munson Compressor Message-ID: <2913853E9A63BE44A22651AAF9BCB2240CC4E7@mail03.ioead> So are you trying to achieve a system where the frequency range of the multiband compression is dynamic? Or are we talking of wave shaping? >But a single-band compressor which would dynamically boost highs/lows under >heavy compression, might be a slightly different animal. Perhaps a useless >animal too, dunno (GRIN). Would this be the equivalent of a compressor followed by a loudness filter/amp? Steve -----Original Message----- From: music-dsp-bounces@shoko.calarts.edu [mailto:music-dsp-bounces@shoko.calarts.edu]On Behalf Of James Chandler Jr Sent: 26 November 2004 9:05 AM To: a list for musical digital signal processing Subject: Re: [music-dsp] Fletcher-Munson Compressor Thanks, Steven Have heard of some famous 'radio station' compressors that were just early specimens of multi-band compressors. The psycho-acoustic complaint sometimes heard about flat-freq-response single-band compressors, that in high compression the devices give the psycho-acoustic impression of 'dull sound' or 'loss of highs'. A simple multi-band compressor MIGHT avoid that, if the main compression gets done in the bass/mids, leaving the highs relatively unaffected. JCJR ----- Original Message ----- From: "Steven Liddle" To: "a list for musical digital signal processing" Sent: Friday, November 26, 2004 3:52 AM Subject: RE: [music-dsp] Fletcher-Munson Compressor >Are there any compressors that dynamically adjust the signal's frequency >balance >according to the instantaneous gain? If so, are such gadgets common? Any brand >names? I've heard of radio stations using this type of compressor to program a 'station sound'. Will investigate brands later. -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From paul.kellett at mda-vst.com Fri Nov 26 05:00:54 2004 From: paul.kellett at mda-vst.com (Paul Kellett) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Re: Fletcher-Munson Compressor References: <20041126090558.C14C51780E1A@music.calarts.edu> Message-ID: <005f01c4d39e$d181e160$c300a8c0@Paul> "James Chandler Jr" wrote: > > The psycho-acoustic complaint sometimes heard about flat-freq-response > single-band compressors, that in high compression the devices give the > psycho-acoustic impression of 'dull sound' or 'loss of highs'. > > A simple multi-band compressor MIGHT avoid that, if the main compression > gets done in the bass/mids, leaving the highs relatively unaffected. A "passive" version of this already exists: some single-band compressors let some HF bleed through so it's not compressed as much. Here's an example which might be doing that or maybe it's doing something more: http://www.drawmer.com/dl251.htm But I think the dulling effect is more to do with loud low frequencies ducking the high frequencies, rather than Fletcher-Munson... To me, fading a signal out makes it sound "tinny" to me rather than dull, and compensating for the Fletcher-Munson curves during the fade fixes this. Paul. From lists at wildgooses.com Fri Nov 26 07:55:15 2004 From: lists at wildgooses.com (Ed Wildgoose) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Fast AQT calculation Message-ID: <41A727B3.3080301@wildgooses.com> I liked the idea of the AQT2 measure for estimating frequency response as perceived by the ear. I wanted to include this kind of analysis in a little app I am writing. Basically, is there a quicker way to calculate a fairly high resolution freq curve than the obvious method of lots and lots of pulses, all convolved with the IR? I just wondered if I was missing some clever DSP trick here? (Angelo is this how you calculate it in your software?) Thanks Ed W From joshscholar at yahoo.com Fri Nov 26 11:07:42 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] The arbitrary resampling 1-step Message-ID: <00d801c4d3d2$105cda10$b7e22641@antssoftware.com> Sorry if this post is stream of consciousness. So for people who don't want to read ramblings, I've decided to start this post with an "executive summary": I've realized that it's pretty easy to design splines to approximate an arbitrary impulse response. And of course one useful spline would be one designed to approximate a windowed sinc impulse response for filtering and resampling. It's even possible to generate these splines on the fly without having to solve complex equation, at least for a approximations to a limited order. That means that you can do arbitrary resampling - even resampling where you change the rate on a sample by sample basis without prefiltering the data to roll off what would alias and without the preemphasis filters that Ollie Niemitalo's optimal (but non-flat response) splines require. Another upshot is that, if you don't require audiophile quality, you can do arbitrary resampling in one step without oversampling first with somewhat minimized aliasing. I haven't written any code yet. Anyway it's may be a while before I have time to test all of this out. End of "executive summary" I've been playing with a system that people on this list will probably find pretty uninteresting since it's not well suited for DSP at least out of the box, a free, open-sourced, cross-platform Smaltalk implementation called Squeak. But one feature it has implemented, badly, is arbitrary resampling. The underlying driver (written in C, or to be more precise, a limited Smalltalk sublanguage that compiles into C) simply does nearest-neighbor filtering. The goal of that subsystem is to be the basis for a cross-platform real-time sampling synthesizer. So it does have to be fast enough to do lot of voices at once. So that got me thinking, what would be the best way to fix Squeak. I took another look at Ollie Niemitalo's paper on "Polynomial Interpolators for High-Quality Resampling of Audio Data" but I was disappointed to notice that his splines have non-flat responses and require significant pre-emphasis filtering before use. But it was cool that he plotted the impulse response of his splines. I tried plotting the impulse response for that 5th order spline of mine that got posted into the Music DSP library a while back I noticed that its impulse response looks like a very short windowed sinc function. No wonder it works. I got lucky there, since I didn't directly design it's impulse response. The second thing I noticed is that the optimal splines Niemitalo came up with have non-flat responses - you have to put effort into premphasis filters before you resample if you use his splines. That dampened my enthusiasm for writing a library that used these. I also noticed that he didn't try coming up with optimum splines for resampling without oversampling first. Anyway, when I was working on how to plot the impulse response of a spline I realized that the impulse response at a given offset is very simple to calculate because you assume that all of the points you're interpolating between are zeros except for a single point which is a one, so most of the terms disappear. And that you can turn this simplicity around and use it as a way to specify a spline. Anyway it turns out to be absolutely trivial to design a spline who's impulse response has an arbitrary position and any number of arbitrary derivatives at each knot. Say you're define a spline with a neighborhood of 5 points (p0-p4). If one form of the spline is: p0(a0+x*b0+x^2*c0+x^3*d0)+ p1(a1+x*b1+x^2*c1+x^3*d1)+ ... Then to specify the response from 1 sample after the impulse up to the impulse, you assume that p1 is 1 and the rest of the points are 0 and you a1-d1 have the right characteristics. So at 1 sample after the impulse, x=0 so the position is a1, and the first derivative is b1 etc. right on the impulse x=1 so the position is (a1+b1+c1+d1) and the first derivative is (b1+2*c1+3*d1) etc. You calculate the other points similarly again with x=0 and x=1 (this makes sense if you remember that a spline is a piecewise function). Joshua Scholar From joshscholar at yahoo.com Fri Nov 26 11:11:52 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] The arbitrary resampling 1-step References: <00d801c4d3d2$105cda10$b7e22641@antssoftware.com> Message-ID: <00e601c4d3d2$a55b3f30$b7e22641@antssoftware.com> By the way you may noticed that my "exective summary" is wrong. It's trivial to specify a spline to any order this way, as long as you're specifying position and (up to nth) derivatives exactly on the knots. If you want to specify at points between the knots then you'll have to solve an equation. Joshua Scholar From earlevel at earlevel.com Fri Nov 26 13:33:58 2004 From: earlevel at earlevel.com (Nigel Redmon) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] The arbitrary resampling 1-step In-Reply-To: <00d801c4d3d2$105cda10$b7e22641@antssoftware.com> References: <00d801c4d3d2$105cda10$b7e22641@antssoftware.com> Message-ID: Don't overlook that you can do a combination of techniques. The problem with the usual windowed sinc method, of course, is that it's typically done from a pre-computed table to avoid computation on the fly, and that seems to kill it for an arbitrary rate on the fly. However, consider building an oversampled windowed sinc table (or half of one, to save memory). From there, you can interpolated between the table points to get arbitrary resolution on the fly. The sinc function is smooth, so with a reasonable amount of oversampling, you can even use linear interpolation for audiophile quality. Or, you can trade off table size with higher-order interpolation. On Nov 26, 2004, at 8:07 AM, Joshua Scholar wrote: > That means that you can do arbitrary resampling - even resampling > where you > change the rate on a sample by sample basis without prefiltering the > data to > roll off what would alias and without the preemphasis filters that > Ollie > Niemitalo's optimal (but non-flat response) splines require. > > Another upshot is that, if you don't require audiophile quality, you > can do > arbitrary resampling in one step without oversampling first with > somewhat > minimized aliasing. From joshscholar at yahoo.com Fri Nov 26 13:51:39 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] The arbitrary resampling 1-step References: <00d801c4d3d2$105cda10$b7e22641@antssoftware.com> Message-ID: <011a01c4d3e8$f76b1500$b7e22641@antssoftware.com> Usually splines are used for interpolation only. Did you understand my point that splines can be designed that do filtering as well? ----- Original Message ----- From: Nigel Redmon To: a list for musical digital signal processing Sent: Friday, November 26, 2004 10:33 AM Subject: Re: [music-dsp] The arbitrary resampling 1-step Don't overlook that you can do a combination of techniques. The problem with the usual windowed sinc method, of course, is that it's typically done from a pre-computed table to avoid computation on the fly, and that seems to kill it for an arbitrary rate on the fly. However, consider building an oversampled windowed sinc table (or half of one, to save memory). From there, you can interpolated between the table points to get arbitrary resolution on the fly. The sinc function is smooth, so with a reasonable amount of oversampling, you can even use linear interpolation for audiophile quality. Or, you can trade off table size with higher-order interpolation. On Nov 26, 2004, at 8:07 AM, Joshua Scholar wrote: > That means that you can do arbitrary resampling - even resampling > where you > change the rate on a sample by sample basis without prefiltering the > data to > roll off what would alias and without the preemphasis filters that > Ollie > Niemitalo's optimal (but non-flat response) splines require. > > Another upshot is that, if you don't require audiophile quality, you > can do > arbitrary resampling in one step without oversampling first with > somewhat > minimized aliasing. -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From joshscholar at yahoo.com Fri Nov 26 14:27:19 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] The arbitrary resampling 1-step References: <00d801c4d3d2$105cda10$b7e22641@antssoftware.com> Message-ID: <014301c4d3ed$f3027170$b7e22641@antssoftware.com> Oh wait. Yes I see, I can explicitely hold the desired impulse response in memory to a high time resolution and explicitely use it on each of the nearby samples to interpolate and filter. I wonder how much noise a little jitter is worth? The operation count goes way down if you don't do any interpolation of the filter table. I'll bet the noise of being off by 1/100 of a sample is low. Joshua Scholar ----- Original Message ----- From: Nigel Redmon To: a list for musical digital signal processing Sent: Friday, November 26, 2004 10:33 AM Subject: Re: [music-dsp] The arbitrary resampling 1-step Don't overlook that you can do a combination of techniques. The problem with the usual windowed sinc method, of course, is that it's typically done from a pre-computed table to avoid computation on the fly, and that seems to kill it for an arbitrary rate on the fly. However, consider building an oversampled windowed sinc table (or half of one, to save memory). From there, you can interpolated between the table points to get arbitrary resolution on the fly. The sinc function is smooth, so with a reasonable amount of oversampling, you can even use linear interpolation for audiophile quality. Or, you can trade off table size with higher-order interpolation. On Nov 26, 2004, at 8:07 AM, Joshua Scholar wrote: > That means that you can do arbitrary resampling - even resampling > where you > change the rate on a sample by sample basis without prefiltering the > data to > roll off what would alias and without the preemphasis filters that > Ollie > Niemitalo's optimal (but non-flat response) splines require. > > Another upshot is that, if you don't require audiophile quality, you > can do > arbitrary resampling in one step without oversampling first with > somewhat > minimized aliasing. -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From xue.wen at elec.qmul.ac.uk Fri Nov 26 14:39:44 2004 From: xue.wen at elec.qmul.ac.uk (Wen X) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] The arbitrary resampling 1-step References: <00d801c4d3d2$105cda10$b7e22641@antssoftware.com> <014301c4d3ed$f3027170$b7e22641@antssoftware.com> Message-ID: <000d01c4d3ef$c01ff1e0$3c21258a@wenpc> On J. Smith III's web page there is a detailed analysis on how accurate the sinc table shall be using linear(?) interpolation. I remember there the interpolation error is supposed to be adequate if the noise in below the quantization noise, say, typically -16bit. http://ccrma.stanford.edu/~jos/resample/resample.html xue ----- Original Message ----- From: "Joshua Scholar" To: "a list for musical digital signal processing" Sent: Friday, November 26, 2004 7:27 PM Subject: Re: [music-dsp] The arbitrary resampling 1-step > Oh wait. Yes I see, I can explicitely hold the desired impulse response > in > memory to a high time resolution and explicitely use it on each of the > nearby samples to interpolate and filter. > > I wonder how much noise a little jitter is worth? The operation count > goes > way down if you don't do any interpolation of the filter table. I'll bet > the noise of being off by 1/100 of a sample is low. > > Joshua Scholar > > ----- Original Message ----- > From: Nigel Redmon > To: a list for musical digital signal processing > Sent: Friday, November 26, 2004 10:33 AM > Subject: Re: [music-dsp] The arbitrary resampling 1-step > > > Don't overlook that you can do a combination of techniques. The problem > with the usual windowed sinc method, of course, is that it's typically > done from a pre-computed table to avoid computation on the fly, and > that seems to kill it for an arbitrary rate on the fly. > > However, consider building an oversampled windowed sinc table (or half > of one, to save memory). From there, you can interpolated between the > table points to get arbitrary resolution on the fly. The sinc function > is smooth, so with a reasonable amount of oversampling, you can even > use linear interpolation for audiophile quality. Or, you can trade off > table size with higher-order interpolation. > > > > On Nov 26, 2004, at 8:07 AM, Joshua Scholar wrote: > >> That means that you can do arbitrary resampling - even resampling >> where you >> change the rate on a sample by sample basis without prefiltering the >> data to >> roll off what would alias and without the preemphasis filters that >> Ollie >> Niemitalo's optimal (but non-flat response) splines require. >> >> Another upshot is that, if you don't require audiophile quality, you >> can do >> arbitrary resampling in one step without oversampling first with >> somewhat >> minimized aliasing. > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, > dsp > links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, > dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From joshscholar at yahoo.com Fri Nov 26 15:27:50 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] The arbitrary resampling 1-step References: <00d801c4d3d2$105cda10$b7e22641@antssoftware.com><014301c4d3ed$f3027170$b7e22641@antssoftware.com> <000d01c4d3ef$c01ff1e0$3c21258a@wenpc> Message-ID: <016801c4d3f6$671c9b00$b7e22641@antssoftware.com> Hmm, that site got me thinking that a cosine-windowed (hann windowed) sinc function can be sampled periodically using nothing but complex multiplications some additions (and a divide, darn it). Arbitrary resampling can be done exactly with no spline or lookup table approximations. ----- Original Message ----- From: Wen X To: a list for musical digital signal processing Sent: Friday, November 26, 2004 11:39 AM Subject: Re: [music-dsp] The arbitrary resampling 1-step On J. Smith III's web page there is a detailed analysis on how accurate the sinc table shall be using linear(?) interpolation. I remember there the interpolation error is supposed to be adequate if the noise in below the quantization noise, say, typically -16bit. http://ccrma.stanford.edu/~jos/resample/resample.html xue From koen at smartelectronix.com Fri Nov 26 15:34:07 2004 From: koen at smartelectronix.com (Koen Tanghe) Date: Sun Jan 21 12:10:37 2007 Subject: [music-dsp] Matrix calculations library for use with DSP? References: <000701c4d2ef$3bc799d0$6402a8c0@kthome1> Message-ID: <006e01c4d3f7$49f2d390$6402a8c0@kthome1> Thanks for the hints Michael and Denis! I'll check it out. Koen On Thursday, November 25, 2004 2:04 PM [GMT+1=CET], Koen Tanghe wrote: > Hi, > I'm looking for a good and efficient matrix calculations library > (preferably C++, but C is also fine, including matrix transposition and > inversion) that works fine with MSVC++ 6 and is easy to install/use. And > (as if that wasn't enough yet) preferably with a non-intrusive license > (something LGPL would be great). > Surely some of you have experience with that :-D ? > Koen From rbj at surfglobal.net Fri Nov 26 15:37:23 2004 From: rbj at surfglobal.net (robert bristow-johnson) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] The arbitrary resampling 1-step In-Reply-To: <016801c4d3f6$671c9b00$b7e22641@antssoftware.com> Message-ID: i'm gonna have to talk to Julius. i think that the method that Duane Wise and I did in "Performance of Low-Order Polynomial Interpolators in the Presence of Oversampled Input" (i can send anyone a pdf if i can find it) that Olli picked up on ( http://www.biochem.oulu.fi/~oniemita/dsp/deip.pdf ) is a better way to look at the size of sinc() table (even if it ain't a sinc() function but is an LPF impulse response derived differently). essentially, you get 6 dB per octave S/N if you are using "drop-sample" interpolation (what Julius calls "Absence of Interpolation") and 12 dB per octave if you linearly interpolate. there are some small dB constant terms in there. by "octave", i mean each time you double the table size. r b-j on 11/26/2004 15:27, Joshua Scholar at joshscholar@yahoo.com wrote: > Hmm, that site got me thinking that a cosine-windowed (hann windowed) sinc > function can be sampled periodically using nothing but complex > multiplications some additions (and a divide, darn it). > > Arbitrary resampling can be done exactly with no spline or lookup table > approximations. > > ----- Original Message ----- > From: Wen X > To: a list for musical digital signal processing > Sent: Friday, November 26, 2004 11:39 AM > Subject: Re: [music-dsp] The arbitrary resampling 1-step > > > On J. Smith III's web page there is a detailed analysis on how accurate > the sinc table shall be using linear(?) interpolation. I remember there the > interpolation error is supposed to be adequate if the noise in below the > quantization noise, say, typically -16bit. > > http://ccrma.stanford.edu/~jos/resample/resample.html > xue > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp > links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From erikd-music-dsp at mega-nerd.com Fri Nov 26 16:13:42 2004 From: erikd-music-dsp at mega-nerd.com (Erik de Castro Lopo) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] The arbitrary resampling 1-step In-Reply-To: <00d801c4d3d2$105cda10$b7e22641@antssoftware.com> References: <00d801c4d3d2$105cda10$b7e22641@antssoftware.com> Message-ID: <20041127081342.1c8fb9b1.erikd-music-dsp@mega-nerd.com> On Fri, 26 Nov 2004 08:07:42 -0800 "Joshua Scholar" wrote: > That means that you can do arbitrary resampling - even resampling where you > change the rate on a sample by sample Secret Rabbit Code can do this: http://www.mega-nerd.com/SRC/ Erik -- +-----------------------------------------------------------+ Erik de Castro Lopo nospam@mega-nerd.com (Yes it's valid) +-----------------------------------------------------------+ "The power of accurate observation is commonly called cynicism by those who don't have it." -- George Bernard Shaw From jamie at postlude.co.uk Fri Nov 26 21:02:20 2004 From: jamie at postlude.co.uk (Jamie Bullock) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Sine wave generation In-Reply-To: References: Message-ID: <1101520939.7948.21.camel@localhost.localdomain> Dear Philip, Thanks for this, and thanks to all who have replied on this thread. I was trying to implement the algorithm in PD, because I thought it would be a quick and easy way to test how it worked... However, after people on the list confirmed that my understanding of the code was correct, I wrote an implementation in C as a PD external and it worked first time (and much quicker than writing a PD patch)! I'm only using the code to generate a window function for granular synthesis. However, if I find it is not fast enough, I might try as below. Regards, Jamie Bullock On Fri, 2004-11-26 at 07:36, Philip Mcleod wrote: > If you are just filling an array with a sin wave then here is some c/c++ > code that will do it reasonbly fast. > > /* Fills array with a sine wave of angular velocity w */ > void fastSinFill(double *array, int length, double w, double initPhase) > { > double b1 = 2.0 * cos(w); > array[0] = sin(initPhase); > array[1] = sin(initPhase + w); > > for(int j=2; j < length; j++) > array[j] = b1 * array[j-1] - array[j-2]; > } > > > An example call would be: > > double x[1000]; > fastSinFill(x, 1000, 2.0 * M_PI / 100.0, 0.0); > > This would populate x with the first 1000 terms of the sine wave. > > However if you want to generate the terms on the fly then here is an > example of a nice c++ class to do it. > > class SinGenerator > { > double y1, y2, w, b1; > public: > SinGenerator(double w_, double initPhase_=0) { > w = w_; > b1 = 2.0 * cos(w); > y1 = sin(initPhase_ - w); > y2 = sin(initPhase_ - 2.0 * w); > } > double next() { > double y0 = b1 * y1 - y2; > y2 = y1; > y1 = y0; > return y0; > } > }; > > Then to use it you just create a SinGenerator with the parameters you > want. Then call repeatly call next() to get the sin wave. eg. > > SinGenerator sinGen(2.0 * M_PI / 100.0); > for(int j=0; j<100; j++) > printf("%lf\n", sinGen.next()); > > > Enjoy :) > > Philip McLeod > > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From jamie at postlude.co.uk Fri Nov 26 21:02:20 2004 From: jamie at postlude.co.uk (Jamie Bullock) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Sine wave generation In-Reply-To: References: Message-ID: <1101520939.7948.21.camel@localhost.localdomain> Dear Philip, Thanks for this, and thanks to all who have replied on this thread. I was trying to implement the algorithm in PD, because I thought it would be a quick and easy way to test how it worked... However, after people on the list confirmed that my understanding of the code was correct, I wrote an implementation in C as a PD external and it worked first time (and much quicker than writing a PD patch)! I'm only using the code to generate a window function for granular synthesis. However, if I find it is not fast enough, I might try as below. Regards, Jamie Bullock On Fri, 2004-11-26 at 07:36, Philip Mcleod wrote: > If you are just filling an array with a sin wave then here is some c/c++ > code that will do it reasonbly fast. > > /* Fills array with a sine wave of angular velocity w */ > void fastSinFill(double *array, int length, double w, double initPhase) > { > double b1 = 2.0 * cos(w); > array[0] = sin(initPhase); > array[1] = sin(initPhase + w); > > for(int j=2; j < length; j++) > array[j] = b1 * array[j-1] - array[j-2]; > } > > > An example call would be: > > double x[1000]; > fastSinFill(x, 1000, 2.0 * M_PI / 100.0, 0.0); > > This would populate x with the first 1000 terms of the sine wave. > > However if you want to generate the terms on the fly then here is an > example of a nice c++ class to do it. > > class SinGenerator > { > double y1, y2, w, b1; > public: > SinGenerator(double w_, double initPhase_=0) { > w = w_; > b1 = 2.0 * cos(w); > y1 = sin(initPhase_ - w); > y2 = sin(initPhase_ - 2.0 * w); > } > double next() { > double y0 = b1 * y1 - y2; > y2 = y1; > y1 = y0; > return y0; > } > }; > > Then to use it you just create a SinGenerator with the parameters you > want. Then call repeatly call next() to get the sin wave. eg. > > SinGenerator sinGen(2.0 * M_PI / 100.0); > for(int j=0; j<100; j++) > printf("%lf\n", sinGen.next()); > > > Enjoy :) > > Philip McLeod > > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From didid at skynet.be Sat Nov 27 10:29:03 2004 From: didid at skynet.be (Didier Dambrin) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] The arbitrary resampling 1-step References: <00d801c4d3d2$105cda10$b7e22641@antssoftware.com> Message-ID: <000601c4d495$d38a7a60$5531fea9@GOLAMD64> To me a good resampling method for a sampler would have some kind of fast 4 or 6 points interpolator, with a 2 or 4x oversampling. This because: -modern soundbanks have at least 1 sample per octave, meaning that a 2x oversampling would be enough (and still much faster than a sinc) -samplers usually provide filters, and (correct me if I'm wrong) they usually give problems near nyquist, so here the 2x oversampling wouldn't hurt neither. Same thing for equalizing and distortion. Such a sampler would do everything with its 2x oversampling, while its sends (to reverb, chorus, etc) could still be done after a second final downsampling (although the oversampling wouldn't hurt for the chorus neither). > Don't overlook that you can do a combination of techniques. The problem > with the usual windowed sinc method, of course, is that it's typically > done from a pre-computed table to avoid computation on the fly, and that > seems to kill it for an arbitrary rate on the fly. > > However, consider building an oversampled windowed sinc table (or half of > one, to save memory). From there, you can interpolated between the table > points to get arbitrary resolution on the fly. The sinc function is > smooth, so with a reasonable amount of oversampling, you can even use > linear interpolation for audiophile quality. Or, you can trade off table > size with higher-order interpolation. > > > > On Nov 26, 2004, at 8:07 AM, Joshua Scholar wrote: > >> That means that you can do arbitrary resampling - even resampling where >> you >> change the rate on a sample by sample basis without prefiltering the data >> to >> roll off what would alias and without the preemphasis filters that Ollie >> Niemitalo's optimal (but non-flat response) splines require. >> >> Another upshot is that, if you don't require audiophile quality, you can >> do >> arbitrary resampling in one step without oversampling first with somewhat >> minimized aliasing. > > -- > dupswapdrop -- the music-dsp mailing list and website: subscription info, > FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From ansum at online.de Sat Nov 27 14:35:34 2004 From: ansum at online.de (Andreas Sumerauer) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Sine wave generation In-Reply-To: <1101520939.7948.21.camel@localhost.localdomain> References: <1101520939.7948.21.camel@localhost.localdomain> Message-ID: <41A8D706.5050407@online.de> Hi Jamie, The algorithm could well be implemented as a PD abstraction. Please note however that since it is recursive You would have to set the blocksize to 1 (That's only inside the macro) PD is not very efficient with small block sizes. So better use Your external. As a learning example it may be still worthwhile to create an abstraction. regards Andreas Jamie Bullock wrote: > Dear Philip, > > Thanks for this, and thanks to all who have replied on this thread. I > was trying to implement the algorithm in PD, because I thought it would > be a quick and easy way to test how it worked... However, after people > on the list confirmed that my understanding of the code was correct, I > wrote an implementation in C as a PD external and it worked first time > (and much quicker than writing a PD patch)! > > I'm only using the code to generate a window function for granular > synthesis. However, if I find it is not fast enough, I might try as > below. > > Regards, > > Jamie Bullock > > > On Fri, 2004-11-26 at 07:36, Philip Mcleod wrote: > >>If you are just filling an array with a sin wave then here is some c/c++ >>code that will do it reasonbly fast. >> >>/* Fills array with a sine wave of angular velocity w */ >>void fastSinFill(double *array, int length, double w, double initPhase) >>{ >> double b1 = 2.0 * cos(w); >> array[0] = sin(initPhase); >> array[1] = sin(initPhase + w); >> >> for(int j=2; j < length; j++) >> array[j] = b1 * array[j-1] - array[j-2]; >>} >> >> >>An example call would be: >> >> double x[1000]; >> fastSinFill(x, 1000, 2.0 * M_PI / 100.0, 0.0); >> >>This would populate x with the first 1000 terms of the sine wave. >> >>However if you want to generate the terms on the fly then here is an >>example of a nice c++ class to do it. >> >>class SinGenerator >>{ >> double y1, y2, w, b1; >>public: >> SinGenerator(double w_, double initPhase_=0) { >> w = w_; >> b1 = 2.0 * cos(w); >> y1 = sin(initPhase_ - w); >> y2 = sin(initPhase_ - 2.0 * w); >> } >> double next() { >> double y0 = b1 * y1 - y2; >> y2 = y1; >> y1 = y0; >> return y0; >> } >>}; >> >>Then to use it you just create a SinGenerator with the parameters you >>want. Then call repeatly call next() to get the sin wave. eg. >> >> SinGenerator sinGen(2.0 * M_PI / 100.0); >> for(int j=0; j<100; j++) >> printf("%lf\n", sinGen.next()); >> >> >>Enjoy :) >> >>Philip McLeod >> >> >>-- >>dupswapdrop -- the music-dsp mailing list and website: >>subscription info, FAQ, source code archive, list archive, book reviews, dsp links >>http://shoko.calarts.edu/musicdsp >>http://ceait.calarts.edu/mailman/listinfo/music-dsp > > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From starbugs at gmx.net Sun Nov 28 10:01:51 2004 From: starbugs at gmx.net (starbugs@gmx.net) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Phase shaper & aliasing? References: <41A8D706.5050407@online.de> Message-ID: <5271.1101654111@www19.gmx.net> Hi all, I want to generate a waveform as follows: for each sample: phase = phase + increment phase2 = polynomial_function(phase) output = sine_function(phase2) So the output will be a sine, but its phase does not advance linearly. It works like a waveshaper, just we're shaping the phase. The question is: how much aliasing does that introduce and what can I do against it? I somehow guess that it has to do with the greatest exponent in the polynomial function, but that's where my math skills end :) Any hint? Thanks, Dennis -- NEU +++ DSL Komplett von GMX +++ http://www.gmx.net/de/go/dsl GMX DSL-Netzanschluss + Tarif zum supergünstigen Komplett-Preis! From warder at dlc.fi Sun Nov 28 10:29:03 2004 From: warder at dlc.fi (Vesa Norilo) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Phase shaper & aliasing? In-Reply-To: <5271.1101654111@www19.gmx.net> References: <41A8D706.5050407@online.de> <5271.1101654111@www19.gmx.net> Message-ID: <41A9EEBF.9040004@dlc.fi> Hi, I think you essentially have a frequency modulated sine wave here. The instantaneous frequency will be related to the derivative of your polynomial function phase2 at the point phase. Do you plan on making 'phase' periodic or just increasing over time? For the latter case, you will simply have a sine wave whose frequency changes (sometimes rapidly) and I don't really have an idea how to bandlimit that case in a foolproof way. You might just want to oversample to the degree you can afford? If your 'phase' is periodic, it will have discontinuities. From this follows that 'phase2' and 'output' will have them too. This means instant, heavy alias. In this case you would first have to bandlimit 'phase2'. You could go at it by bandlimiting 'phase' first with some of the (well) known sawtooth methods and then oversampling enough to keep polynomial_function from aliasing. This is, as you know, dependant on the order of the function. Once 'phase2' is in control, you could look up the theory on frequency modulation, more precisely the realtionship between modulation index and the modulator amplitude and frequency content. I'm pretty sure this math is already done by someone, somewhere. :) Vesa starbugs@gmx.net wrote: >Hi all, > >I want to generate a waveform as follows: > >for each sample: > phase = phase + increment > phase2 = polynomial_function(phase) > output = sine_function(phase2) > >So the output will be a sine, but its phase does not advance linearly. It >works like a waveshaper, just we're shaping the phase. The question is: how >much aliasing does that introduce and what can I do against it? > >I somehow guess that it has to do with the greatest exponent in the >polynomial function, but that's where my math skills end :) Any hint? > >Thanks, >Dennis > > > From starbugs at gmx.net Sun Nov 28 11:33:58 2004 From: starbugs at gmx.net (starbugs@gmx.net) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Phase shaper & aliasing? References: <41A9EEBF.9040004@dlc.fi> Message-ID: <15590.1101659638@www38.gmx.net> Many thanks for the advice! It seems I forgot to say a couple of important things (sorry!) Yes, the phase is gonna be periodic. At 2pi it wraps back to 0. > If your 'phase' is periodic, it will have discontinuities. From this > follows that 'phase2' and 'output' will have them too. This means > instant, heavy alias. Okay, the idea was to design the polynomial function (phase2) in a way so that the right end fits nicely to the left beginning, in other words: first_derivate_of_phase2(0) = first_derivate_of_phase2(2pi) Furthermore, phase2 should begin and end at the same levels as phase: phase2(0) = phase(0) = 0 AND phase2(2pi) = phase(2pi) = 2pi This should ensure that there is no discontinuity at the wrapping point. Yes, phase2 DOES drop from 2pi down to 0, but since phase2 is used as the phase of a sine function and sine(0) = sine(2pi), I guess output will not have a discontinuity as well. Is that correct, or am I missing something? My fear was that aliasing occurs not only from an obvious discontinuity, but also from the fact that I'm modulating the phase rapidly. Can I deal with this by oversampling? And if so, how much oversampling is required, judging from the highest exponent of the polynomial function? In case you wonder what all this is for: I'm trying to build an oscillator that can produce waves coming close to the classic saw/rect/tri but also other waveforms and can morph between them. And I want to avoid aliasing. Thanks for your help, Dennis -- Geschenkt: 3 Monate GMX ProMail + 3 Top-Spielfilme auf DVD ++ Jetzt kostenlos testen http://www.gmx.net/de/go/mail ++ From joost at greenskin.net Sun Nov 28 13:15:54 2004 From: joost at greenskin.net (Joost Schuttelaar) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Phase shaper & aliasing? In-Reply-To: <5271.1101654111@www19.gmx.net> References: <41A8D706.5050407@online.de> <5271.1101654111@www19.gmx.net> Message-ID: <41AA15DA.1070309@greenskin.net> starbugs@gmx.net wrote: > for each sample: > phase = phase + increment > phase2 = polynomial_function(phase) > output = sine_function(phase2) > > So the output will be a sine, but its phase does not advance linearly. It > works like a waveshaper, just we're shaping the phase. The question is: how > much aliasing does that introduce and what can I do against it? This sounds very much like phase distortion, as I did in my faze-1 phase distortion synth for the Chameleon. We (me and my partner) just limited the amount of distortion depending on the base frequency. Not entirely a correct solution, but it's easy and works pretty well. -- Joost Schuttelaar From warder at dlc.fi Sun Nov 28 13:49:26 2004 From: warder at dlc.fi (Vesa Norilo) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Phase shaper & aliasing? In-Reply-To: <15590.1101659638@www38.gmx.net> References: <41A9EEBF.9040004@dlc.fi> <15590.1101659638@www38.gmx.net> Message-ID: <41AA1DB6.5060001@dlc.fi> >This should ensure that there is no discontinuity at the wrapping point. >Yes, phase2 DOES drop from 2pi down to 0, but since phase2 is used as the >phase of a sine function and sine(0) = sine(2pi), I guess output will not >have a discontinuity as well. Is that correct, or am I missing something? > > I think you've got the discontinuity problem under control. :) >My fear was that aliasing occurs not only from an obvious discontinuity, but >also from the fact that I'm modulating the phase rapidly. Can I deal with >this by oversampling? And if so, how much oversampling is required, judging >from the highest exponent of the polynomial function? > > Somebody on this list proposed a faux bandlimited saw oscillator pretty similiar to what you are doing. He basically just created a phase transfer function that gives a sawtooth like wave from a sine oscillator and then morphed that function back into normal as the frequency approached nyquist. It worked pretty well. I couldn't find it in a quick search on musicdsp.org, but maybe someone remembers? Since your output will approach sine as your phase distortion function approach a first order polynomial, you might create a "harmonic control" that reduces the polynomial order (or rather the magnitude of higher order terms) somehow as your fundamental frequency gets higher. This way you could control aliasing, but will probably lose some high frequency energy. You might opt for some aliasing and get rid of that with fairly low oversampling. I guess you could do calculations but then again, you might just whip it up and experiment. Let us know :) Vesa From nature.boy at virgilio.it Mon Nov 29 07:32:11 2004 From: nature.boy at virgilio.it (nature.boy@virgilio.it) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] (no subject) Message-ID: <415381E700099B4D@ims5b.cp.tin.it> Does anybody knows a technique for time stretching / pitch shifting using wavelet processing? Thanks From nature.boy at virgilio.it Mon Nov 29 07:33:55 2004 From: nature.boy at virgilio.it (nature.boy@virgilio.it) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Wavelet processing Message-ID: <415381E700099B63@ims5b.cp.tin.it> Does anybody knows a technique for time stretching / pitch shifting using wavelet processing? Thanks From joshscholar at yahoo.com Mon Nov 29 09:37:47 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Wavelet processing References: <415381E700099B63@ims5b.cp.tin.it> Message-ID: <004c01c4d621$002731d0$15e22641@antssoftware.com> I tried using a critically sampling filter-bank to do it. That's exactly the same as using wavelets with compact frequency descriptions... Anyway it didn't work very well. Splitting bands that have lots of energy and resampling them ruins the phase information between them - the result gargles. Perhaps if you found a way to break the bands only at troughs or relatively low energy points in the spectrum and find a way of resampling that shifts the center of these dynamically created bands to exactly their desired target - even if the edges of these coherent bands end up else where. I think that would work, but it's also asking much more than current wavelet techniques allow, at least easily. Filterbank/wavelet processing worked better on noisy, percussive sounds than time domain ones that don't find any self-similarity in the signal during percussive sounds and so basically fail. Also, when the spectrum is flat, then no peaks are being split and no gargling is heard. Joshua Scholar ----- Original Message ----- From: To: Sent: Monday, November 29, 2004 4:33 AM Subject: [music-dsp] Wavelet processing Does anybody knows a technique for time stretching / pitch shifting using wavelet processing? Thanks -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From nature.boy at virgilio.it Mon Nov 29 12:44:01 2004 From: nature.boy at virgilio.it (nature.boy@virgilio.it) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Wavelet processing In-Reply-To: <004c01c4d621$002731d0$15e22641@antssoftware.com> Message-ID: <415381E70009AF8B@ims5b.cp.tin.it> Thank you so much! Do you have any domumentation about this technique? >-- Messaggio originale -- >From: "Joshua Scholar" >To: "a list for musical digital signal processing" >Subject: Re: [music-dsp] Wavelet processing >Date: Mon, 29 Nov 2004 06:37:47 -0800 >Reply-To: a list for musical digital signal processing > > >I tried using a critically sampling filter-bank to do it. That's exactly >the >same as using wavelets with compact frequency descriptions... > >Anyway it didn't work very well. Splitting bands that have lots of energy >and resampling them ruins the phase information between them - the result >gargles. Perhaps if you found a way to break the bands only at troughs or >relatively low energy points in the spectrum and find a way of resampling >that shifts the center of these dynamically created bands to exactly their >desired target - even if the edges of these coherent bands end up else >where. I think that would work, but it's also asking much more than current >wavelet techniques allow, at least easily. > >Filterbank/wavelet processing worked better on noisy, percussive sounds than >time domain ones that don't find any self-similarity in the signal during >percussive sounds and so basically fail. Also, when the spectrum is flat, >then no peaks are being split and no gargling is heard. > >Joshua Scholar > >----- Original Message ----- >From: >To: >Sent: Monday, November 29, 2004 4:33 AM >Subject: [music-dsp] Wavelet processing > > > > >Does anybody knows a technique for time stretching / pitch shifting using >wavelet processing? >Thanks > > >-- >dupswapdrop -- the music-dsp mailing list and website: >subscription info, FAQ, source code archive, list archive, book reviews, >dsp >links >http://shoko.calarts.edu/musicdsp >http://ceait.calarts.edu/mailman/listinfo/music-dsp > >-- >dupswapdrop -- the music-dsp mailing list and website: >subscription info, FAQ, source code archive, list archive, book reviews, >dsp links >http://shoko.calarts.edu/musicdsp >http://ceait.calarts.edu/mailman/listinfo/music-dsp From joshscholar at yahoo.com Mon Nov 29 13:13:57 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Wavelet processing References: <415381E70009AF8B@ims5b.cp.tin.it> Message-ID: <00ac01c4d63f$32537330$15e22641@antssoftware.com> No just code that works badly. ----- Original Message ----- From: To: "a list for musical digital signal processing" Sent: Monday, November 29, 2004 9:44 AM Subject: Re: [music-dsp] Wavelet processing Thank you so much! Do you have any domumentation about this technique? From paranoiaspoisondoor at gmail.com Mon Nov 29 13:57:58 2004 From: paranoiaspoisondoor at gmail.com (Keith Handy) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Not exactly speech recognition Message-ID: <79a2ad41041129105762f6abaa@mail.gmail.com> I'm looking for resources on something similar to, but not quite, speech recognition. Basically I don't want to get into all the complexities involved in actually *interpreting* speech; I just want to learn a little more about the physics of the voice, a very simple, dumbed-down relationship between mouth shapes and formant intensities ... my end goal is to make a simple set of rules for translating a short sample of audio into a frame of animation. The parameters would be heavily simplified, since I'm not aiming for absolute realism: just some things like "wideness of mouth" (lowest for "ooh" and highest for "ee"), openness of lips, openness of teeth and openness of tongue. It would have to be independent of fundamental pitch. Again, I see a lot of speech recognition tools out there, but they're overkill for what I need to do. I want to make something that's standalone. Looking for a starting point. TIA. -Keith From rholop at online.no Mon Nov 29 16:02:17 2004 From: rholop at online.no (Risto) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Not exactly speech recognition In-Reply-To: <79a2ad41041129105762f6abaa@mail.gmail.com> References: <79a2ad41041129105762f6abaa@mail.gmail.com> Message-ID: <41AB8E59.5090902@online.no> Have a look at Praat. It is quite an advanced program too, but it is possible to generate articulatory movements which are translated both into sound and animation of the vocal tract! http://www.fon.hum.uva.nl/praat/ Risto Holopainen Keith Handy wrote: > > Basically I don't want to get into all the complexities involved in > actually *interpreting* speech; I just want to learn a little more > about the physics of the voice, a very simple, dumbed-down > relationship between mouth shapes and formant intensities ... my end > goal is to make a simple set of rules for translating a short sample > of audio into a frame of animation. > > From rholop at online.no Mon Nov 29 16:29:59 2004 From: rholop at online.no (Risto) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Phase shaper & aliasing? In-Reply-To: <41AA15DA.1070309@greenskin.net> References: <41A8D706.5050407@online.de> <5271.1101654111@www19.gmx.net> <41AA15DA.1070309@greenskin.net> Message-ID: <41AB94D7.40905@online.no> I just had to try this out myself, as it seems to be a very fruitful starting point for experimentation. I inserted a 2nd order allpass filter like this: phase = phase + increment phase2 = polynomial_function(phase) alp = allpass(phase2) output = sine_function(alp) This makes it possible to introduce resonances without worrying about clipping. Is this common practice? risto h. Joost Schuttelaar wrote: > starbugs@gmx.net wrote: > >> for each sample: >> phase = phase + increment >> phase2 = polynomial_function(phase) >> output = sine_function(phase2) >> > > > This sounds very much like phase distortion, as I did in my faze-1 phase > distortion synth for the Chameleon. We (me and my partner) just limited > the amount of distortion depending on the base frequency. Not entirely a > correct solution, but it's easy and works pretty well. > From starbugs at gmx.net Mon Nov 29 22:01:45 2004 From: starbugs at gmx.net (starbugs@gmx.net) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Phase shaper & aliasing? References: <41AB94D7.40905@online.no> Message-ID: <14165.1101783705@www26.gmx.net> I never tried the allpass, but I experimented a bit with different functions and I found suitable polynomials to generate a sawtooth-like and a rectangle-like waveform. I have two parameters. One parameter controls a 3rd-degree polynomial and allows me to morph between sine and saw. The second parameter controls a 2nd-degree polynomial which is then multiplied with the other one (so the total degree is 5). The second parameter boosts the "edges" (high frequencies) and is meant to be tied to the note number (so that less high order harmonics are generated as the base frequency approaches nyquist). My conclusion so far is: this is a neat technique and gives nice sounding results. However, it's much more expensive to compute, compared to a simple anti-aliased phase accumulator oscillator. That's why I probably won't be using it, unless I discover something spectacular. risto wrote: > I inserted a 2nd order allpass filter. This makes it possible to > introduce resonances without worrying about clipping. So what's your experience with that? What kind of resonance (what frequencies) did you generate? And did it do anything you couldn't achieve already with the polynomial (without a filter)? And what's with the point where that phase wraps from 2pi back to 0? Dennis -- NEU +++ DSL Komplett von GMX +++ http://www.gmx.net/de/go/dsl GMX DSL-Netzanschluss + Tarif zum supergünstigen Komplett-Preis! From wbaldwin at austin.rr.com Mon Nov 29 22:15:48 2004 From: wbaldwin at austin.rr.com (Bill Baldwin) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Not exactly speech recognition In-Reply-To: <79a2ad41041129105762f6abaa@mail.gmail.com> Message-ID: <200411300317.iAU3HpYm025238@ms-smtp-01-eri0.texas.rr.com> Not what you're asking for, but if you're interested in looking at an existing solution to this problem, check out http://www.oc3ent.com/home.htm. They sell an audio-to-animation tool. It's based on technology from LIPSinc (now defunct) that I have first-hand experience with. While not perfect, the LIPSinc stuff tended to generate pretty useful and believable animation curves from audio files. -bb -----Original Message----- From: music-dsp-bounces@ceait.calarts.edu [mailto:music-dsp-bounces@ceait.calarts.edu] On Behalf Of Keith Handy Sent: Monday, November 29, 2004 12:58 PM To: a list for musical digital signal processing Subject: [music-dsp] Not exactly speech recognition I'm looking for resources on something similar to, but not quite, speech recognition. Basically I don't want to get into all the complexities involved in actually *interpreting* speech; I just want to learn a little more about the physics of the voice, a very simple, dumbed-down relationship between mouth shapes and formant intensities ... my end goal is to make a simple set of rules for translating a short sample of audio into a frame of animation. The parameters would be heavily simplified, since I'm not aiming for absolute realism: just some things like "wideness of mouth" (lowest for "ooh" and highest for "ee"), openness of lips, openness of teeth and openness of tongue. It would have to be independent of fundamental pitch. Again, I see a lot of speech recognition tools out there, but they're overkill for what I need to do. I want to make something that's standalone. Looking for a starting point. TIA. -Keith -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From gewang at CS.Princeton.EDU Mon Nov 29 23:01:50 2004 From: gewang at CS.Princeton.EDU (Ge Wang) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Not exactly speech recognition In-Reply-To: <79a2ad41041129105762f6abaa@mail.gmail.com> References: <79a2ad41041129105762f6abaa@mail.gmail.com> Message-ID: <900FD42C-4284-11D9-96F6-000393AD6B4A@cs.princeton.edu> Our little real-time lpc visualization uses transforms LPC coefficients into a rough vocal tract shape via Durbin recursion. it is quite standalone, and the code is GPL: http://soundlab.cs.princeton.edu/software/rt_lpc/ the red pair of lines left/center is the real-time vocal tract visualization. The right side is towards the mouth. The resolution of the tract increases with LPC order. It's pretty rough, but it might be of help. Ge! On Nov 29, 2004, at 1:57 PM, Keith Handy wrote: > I'm looking for resources on something similar to, but not quite, > speech recognition. > > Basically I don't want to get into all the complexities involved in > actually *interpreting* speech; I just want to learn a little more > about the physics of the voice, a very simple, dumbed-down > relationship between mouth shapes and formant intensities ... my end > goal is to make a simple set of rules for translating a short sample > of audio into a frame of animation. > > The parameters would be heavily simplified, since I'm not aiming for > absolute realism: just some things like "wideness of mouth" (lowest > for "ooh" and highest for "ee"), openness of lips, openness of teeth > and openness of tongue. It would have to be independent of > fundamental pitch. > > Again, I see a lot of speech recognition tools out there, but they're > overkill for what I need to do. I want to make something that's > standalone. Looking for a starting point. TIA. > > -Keith > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book > reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From niels.pontoppidan at neurodrive.dk Tue Nov 30 02:12:39 2004 From: niels.pontoppidan at neurodrive.dk (Niels Henrik Pontoppidan) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] RE: Not exactly speech recognition In-Reply-To: <20041129210211.D46CC1795745@music.calarts.edu> Message-ID: <200411300712.iAU7Cie25734@mail.imm.dtu.dk> Hi, You might take a look at what my officemate Tue is doing at www.imm.dtu.dk/~tls. Look for the demo. /Niels From jamie at postlude.co.uk Tue Nov 30 05:21:59 2004 From: jamie at postlude.co.uk (Jamie Bullock) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Not exactly speech recognition In-Reply-To: <79a2ad41041129105762f6abaa@mail.gmail.com> References: <79a2ad41041129105762f6abaa@mail.gmail.com> Message-ID: <1101807086.2866.17.camel@localhost.localdomain> Keith, Sounds like the job for a Neural Net. There is loads of stuff on the web about this, just Google 'speech recognition neural network' if you have not already done so. For a ready made tool, you may want to look at Comparser . It does generic audio recognition. -j On Mon, 2004-11-29 at 18:57, Keith Handy wrote: > I'm looking for resources on something similar to, but not quite, > speech recognition. > > Basically I don't want to get into all the complexities involved in > actually *interpreting* speech; I just want to learn a little more > about the physics of the voice, a very simple, dumbed-down > relationship between mouth shapes and formant intensities ... my end > goal is to make a simple set of rules for translating a short sample > of audio into a frame of animation. > > The parameters would be heavily simplified, since I'm not aiming for > absolute realism: just some things like "wideness of mouth" (lowest > for "ooh" and highest for "ee"), openness of lips, openness of teeth > and openness of tongue. It would have to be independent of > fundamental pitch. > > Again, I see a lot of speech recognition tools out there, but they're > overkill for what I need to do. I want to make something that's > standalone. Looking for a starting point. TIA. > > -Keith > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From ariel.salomon at gmail.com Tue Nov 30 10:51:37 2004 From: ariel.salomon at gmail.com (Ariel Salomon) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Not exactly speech recognition In-Reply-To: <79a2ad41041129105762f6abaa@mail.gmail.com> References: <79a2ad41041129105762f6abaa@mail.gmail.com> Message-ID: Not quite simple and dumbed down, but I'd recommend Acoustic Phonetics by Kenneth N. Stevens (MIT Press, 2000 or so) as a great reference on vocal tract acoustics. The "face shape" part is of course the front of your vocal tract, primarily a function of lip closure, lip rounding and tongue(/jaw) height. Would be best if you have any background in Acoustics or EE, but it's a reasonable starting point and you should be able to find it in your local university engineering library. - Ariel On Mon, 29 Nov 2004 13:57:58 -0500, Keith Handy wrote: > I'm looking for resources on something similar to, but not quite, > speech recognition. > > Basically I don't want to get into all the complexities involved in > actually *interpreting* speech; I just want to learn a little more > about the physics of the voice, a very simple, dumbed-down > relationship between mouth shapes and formant intensities ... my end > goal is to make a simple set of rules for translating a short sample > of audio into a frame of animation. > > The parameters would be heavily simplified, since I'm not aiming for > absolute realism: just some things like "wideness of mouth" (lowest > for "ooh" and highest for "ee"), openness of lips, openness of teeth > and openness of tongue. It would have to be independent of > fundamental pitch. > > Again, I see a lot of speech recognition tools out there, but they're > overkill for what I need to do. I want to make something that's > standalone. Looking for a starting point. TIA. > > -Keith > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From rholop at online.no Tue Nov 30 11:18:59 2004 From: rholop at online.no (Risto) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Phase shaper & aliasing? In-Reply-To: <14165.1101783705@www26.gmx.net> References: <41AB94D7.40905@online.no> <14165.1101783705@www26.gmx.net> Message-ID: <41AC9D73.6010102@online.no> Would you mind posting the polynomials you are using for the sawtooth and square waveforms? starbugs@gmx.net wrote: > I never tried the allpass, but I experimented a bit with different functions > and I found suitable polynomials to generate a sawtooth-like and a > rectangle-like waveform. > > I have two parameters. One parameter controls a 3rd-degree polynomial and > allows me to morph between sine and saw. The second parameter controls a > 2nd-degree polynomial which is then multiplied with the other one (so the > total degree is 5). The second parameter boosts the "edges" (high > frequencies) and is meant to be tied to the note number (so that less high > order harmonics are generated as the base frequency approaches nyquist). > > My conclusion so far is: this is a neat technique and gives nice sounding > results. However, it's much more expensive to compute, compared to a simple > anti-aliased phase accumulator oscillator. That's why I probably won't be > using it, unless I discover something spectacular. > If you have to adjust the polynomials for each sample or so, it may be an expensive thing to compute, but you could also use two (or more) lookup tables for the polynomials and interpolate between them. Am I right to suspect that you would need one table more than there are control parameters? > risto wrote: > >>I inserted a 2nd order allpass filter. This makes it possible to >>introduce resonances without worrying about clipping. > > > So what's your experience with that? What kind of resonance (what > frequencies) did you generate? And did it do anything you couldn't achieve > already with the polynomial (without a filter)? And what's with the point > where that phase wraps from 2pi back to 0? > > Dennis > My first idea was to use a bandpass filter here. However, a BP introduces a DC offset in the final waveform, whereas the allpass doesn't. I'm not a filter expert, so I can't give a theoretical explanation of this, but surely someone else can. I just came across this by accident, by designing the BP-filter from the allpass thus: y(n) = 0.5*(x(n) - allpass(x(n))) This BP-filter is tunable by adjusting parameters of the allpass, so just use those settings to control resonance frequency and bandwith. It is probably exactly because of the discontinuity when the phase wraps around that this works. It may be possible to do similar things with specially designed polynomials, but probably much more difficult. Risto From bulent_biyikoglu at yahoo.com Tue Nov 30 12:59:48 2004 From: bulent_biyikoglu at yahoo.com (Bulent Biyikoglu) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] SynthMaster: a new (RTAS) softsynth, looking for an investor... Message-ID: <20041130175948.59950.qmail@web54507.mail.yahoo.com> Hello, For the past 10 months I have been developing a new softsynth engine, and an RTAS ProTools plugin that uses this engine. The plugin is almost feature complete and it runs crossplatform. I would like to develop this plugin in other formats as well such as DirectX, AU, VST, standalone (WinXP/OSX), but for that to happen I need to be backed by an investor, preferebly an established worldwide known plugin company. Let me briefly mention about the features of the synth, so that the members of this list will have a better understanding of it: 1) Synthesis engine that combines additive, subtractive, AM, FM/PM and waveshaping synthesis, and uses bandlimited waveforms + sinc interpolation. 2) High performance synthesis engine, optimized for SIMD on pentium, and most parts written in x86 assembly language. 3) 3 Additive oscillators, 4 sub oscillators/modulators 4) 3 multimode resonant filters than can be connected in 3 different combinations: parallel, series, split. Each filter can have a nonlinear waveshaper connected to its output. 5) Rich FX: 8 band parametric EQ, Reverb, Chorus, Tremolo, Vibrato, Echo, and 2 LFOs that can generate MIDI Control change messages to modulate parameters. 6) More than 600 parameter to control, all of the are realtime controllable. The installer for the Windows version of the synth is available at: http://www.kv331audio.com/synthmaster/betas/synthmasterrtasinstaller.msi Screenshots are also available at: http://www.kv331audio.com/synthmaster/screenshots/oscscreen.jpg http://www.kv331audio.com/synthmaster/screenshots/modscreen.jpg http://www.kv331audio.com/synthmaster/screenshots/filterscreen.jpg http://www.kv331audio.com/synthmaster/screenshots/fxscreen.jpg Best regards, Bulent Biyikoglu, President, KV331 Audio, LLC. __________________________________ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com From dan at octapod.org Tue Nov 30 19:24:55 2004 From: dan at octapod.org (dan mackinlay ()) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Not exactly speech recognition In-Reply-To: <20041130180010.3A947179C07A@music.calarts.edu> References: <20041130180010.3A947179C07A@music.calarts.edu> Message-ID: <6CF51BC2-432F-11D9-BC32-000D9336332C@octapod.org> And this is entirely underkill, but it an interesting historical note. the 'Thunderbirds' puppets had their mouths animated by a small solenoid controlling their jaws, which was triggered by running the voice-track of that character through the solenoid, which meant that their mouths would open according to the intensity of the sound being pumped though, and more for vowels than consonants... which is a pretty elegant solution in my book. (apologies if some other trivia nut has already posted this - the one of the list digests didn't arrive in my inbox, so I'm missing a bit of the dialogue) ---dan() > -----Original Message----- > Subject: [music-dsp] Not exactly speech recognition > > I'm looking for resources on something similar to, but not quite, > speech recognition. > ... > The parameters would be heavily simplified, since I'm not aiming for > absolute realism: just some things like "wideness of mouth" (lowest > for "ooh" and highest for "ee"), openness of lips, openness of teeth > and openness of tongue. It would have to be independent of > fundamental pitch. --- danformation: http://www.octapod.org/dan Body Works Industries: http://www.octapod.org/htbw From paranoiaspoisondoor at gmail.com Tue Nov 30 19:39:48 2004 From: paranoiaspoisondoor at gmail.com (Keith Handy) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Not exactly speech recognition In-Reply-To: <6CF51BC2-432F-11D9-BC32-000D9336332C@octapod.org> References: <20041130180010.3A947179C07A@music.calarts.edu> <6CF51BC2-432F-11D9-BC32-000D9336332C@octapod.org> Message-ID: <79a2ad4104113016395e7890e@mail.gmail.com> The animation software that I'm playing with, Moho (http://www.lostmarble.com), has a similar implementation of that same idea. You can set up a "switch layer" with a collection of mouths drawn at varying degrees of openness, and the software will automatically pick which sublayer to display based on the amplitude at that frame. Good for a quick and lazy solution. I'm just trying to one-up that by dividing it up into lips/teeth/tongue. :) On Wed, 1 Dec 2004 11:24:55 +1100, dan mackinlay wrote: > And this is entirely underkill, but it an interesting historical note. > the 'Thunderbirds' puppets had their mouths animated by a small > solenoid controlling their jaws, which was triggered by running the > voice-track of that character through the solenoid, which meant that > their mouths would open according to the intensity of the sound being > pumped though, and more for vowels than consonants... which is a pretty > elegant solution in my book. > > (apologies if some other trivia nut has already posted this - the one > of the list digests didn't arrive in my inbox, so I'm missing a bit of > the dialogue) > > ---dan() From djrouz at gmail.com Tue Nov 30 22:07:09 2004 From: djrouz at gmail.com (dj rouz) Date: Sun Jan 21 12:10:38 2007 Subject: [music-dsp] Graduate Schools: Media Electronics and the like Message-ID: <83ccb719041130190753a728d5@mail.gmail.com> Hey everybody - just joined the list this week. I was wondering if anybody can direct me to some graduate schools that have programs like MIT's media lab and NYU's interactive telecomm program. about me : I'm a senior at the University of Maryland finishing my BS in EE - focused on signal processing, fourier analysis and complex analysis. i have a strong interest in the electronic arts (especially music - go figure). I'm mainly interested in synthesizers and speech processing (eventually I want to apply this to some sort of bio-modeling, but that's a long shot from now) - I spend my free time in Reason and on my turntables (i think i'm a dj). anyway - if are still reading, maybe you can help; thanks. rouz From douglas at roar.music.columbia.edu Mon Nov 1 00:00:01 2004 From: douglas at roar.music.columbia.edu (douglas repetto) Date: Wed Jun 27 19:17:47 2007 Subject: [music-dsp] [admin] music-dsp FAQ Message-ID: <200411010500.iA1501Hw012398@roar.music.columbia.edu> hi, just a reminder that if you are new to the list you should read the music-dsp FAQ. it contains answers to both technical _and_ adminstrative questions that often come up on the list. if your question appears in the FAQ it is safe to assume that it has been discussed on the list many times in the past, and you should probably have a look through the list archives before posting your question to the list. http://shoko.calarts.edu/musicdsp/musicdspFAQ.html also of interest to new and not-so-new list members: the music-dsp list archives http://shoko.calarts.edu/musicdsp/musicdsparchives.html the music-dsp source code archive http://www.musicdsp.org music-dsp books and reviews http://shoko.calarts.edu/musicdsp/dspbooks.html all this and more at: http://shoko.calarts.edu/musicdsp hotdawg! douglas (this is an automated message sent out on the 1st and 15th of each month) From woldhek at xs4all.nl Mon Nov 1 03:24:42 2004 From: woldhek at xs4all.nl (Anton Woldhek) Date: Wed Jun 27 19:17:47 2007 Subject: [music-dsp] PySuperCollider In-Reply-To: <41856F7C.2020509@calarts.edu> Message-ID: <021d01c4bfec$3d327300$2101a8c0@VAIO> That still doesn't matter, the sc client for windows is written in python, the original client for sc (for mac) isnt, so you'll have to go the windows version of sc to get python code, perhaps this is not what you are looking for, but this is what I have to offer. Cheers Anton -----Original Message----- On Behalf Of Dan Richert I'm on OSX. Keith Handy wrote: >Actually, disregard that, I needed to go to the sf link ... > > >On Sun, 31 Oct 2004 13:53:42 -0500, Keith Handy > wrote: > > >>I followed the link out of curiosity and didn't see anything for >>windows. >> >> >> >> >>On Sun, 31 Oct 2004 18:19:25 +0100, Anton Woldhek >>wrote: >> >> >>>http://supercollider.sourceforge.net check out the win32 compile. >>> >>>Anton >>> >>> >>> >>>-----Original Message----- >>>From: music-dsp-bounces@shoko.calarts.edu >>>[mailto:music-dsp-bounces@shoko.calarts.edu] On Behalf Of Richard >>>Dobson >>>Sent: zondag 31 oktober 2004 17:00 >>>To: a list for musical digital signal processing >>>Subject: Re: [music-dsp] PySuperCollider >>> >>>Love to, but we need a web link! Doesn't show up in Google, yet... >>> >>>Richard Dobson >>> >>>Anton Woldhek wrote: >>> >>> >>> >>>>Have a look at PsyCollider, the sc client for windows. Its entirely >>>>python! >>>> >>>>Cheers >>>>Anton >>>> >>>>-- >>>>dupswapdrop -- the music-dsp mailing list and website: subscription >>>>info, FAQ, source code archive, list archive, book >>>> >>>> >>>reviews, dsp links >>> >>> >>>>http://shoko.calarts.edu/musicdsp >>>>http://ceait.calarts.edu/mailman/listinfo/music-dsp >>>> >>>> >>>> >>>> >>>> >>>-- >>>dupswapdrop -- the music-dsp mailing list and website: subscription >>>info, FAQ, source code archive, list archive, book reviews, dsp links >>>http://shoko.calarts.edu/musicdsp >>>http://ceait.calarts.edu/mailman/listinfo/music-dsp >>> >>>-- >>>dupswapdrop -- the music-dsp mailing list and website: subscription >>>info, FAQ, source code archive, list archive, book reviews, dsp links >>>http://shoko.calarts.edu/musicdsp >>>http://ceait.calarts.edu/mailman/listinfo/music-dsp >>> >>> >>> >>-- >>I've seen all good people trim their hedge each day >> >> >> > > > > -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From signalzerodb at yahoo.co.uk Mon Nov 1 04:52:12 2004 From: signalzerodb at yahoo.co.uk (Dave Gamble) Date: Wed Jun 27 19:17:47 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect In-Reply-To: <007a01c4bd9a$88f30e20$030200c0@australia> References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead> <004901c4bd08$2b14d4b0$030200c0@australia> <007a01c4bd9a$88f30e20$030200c0@australia> Message-ID: It seems appropriate at this point to explain how a compressor actually works. Things will be a lot easier to understand when you know what's going on... and not a lot of people understand this, it seems. Here's how a compressor works: You have a man wearing a pair of headphones, with his hand on a volume fader. The man hears the sidechain signal (either the uncompressed input or something else) in his headphones. He can see a meterbridge of what he's listening to. When the meterbridge level gets too high (it exceeds 'threshold'), he pulls the volume fader down, from 0dB to -something, depending on the 'ratio' (which is a hideously defined thing, btw). The speed with which he can pull the fader down is the attack. The speed with which he can pull the fader back up is the release. Attack and release are invariably defined as exponential curves (first order filters) where the quoted 'attack time' is some multiple of the 'time constant' of the filter. These vary all over the place. And that's how a compressor works. Dave. On 29 Oct 2004, at 10:34, Eddie Al-Shakarchi wrote: > Hi guys > > I'm having real trouble working out how to convert/go from the decibel > value > the user enters on the GUI slider to a value in shorts/16bit data, as > represented in the array. i want to be able to say > > if (currentSamplesAmplitude > 10,000) then compress > > but currently all i'm doing is gving the use a chance to enter a > decibel > level, and then i convert it to a linear value.... then what? > > eg if the user enters a value of -5db as the threshold, how do i know > what > that REALLY means, in sample amplitude values? I'm really stuck > > Thanks guys > > Eddie > > ----- Original Message ----- > From: "Eddie Al-Shakarchi" > To: "a list for musical digital signal processing" > > Sent: Thursday, October 28, 2004 5:07 PM > Subject: Re: [music-dsp] Coding attack and delay times for a compressor > effect > > >> Hi Steve >> >> Thanks for you email - it makes perfect sense, i just don't know how >> to > code >> it! >> >> furthermore i'm not too sure what to do with the threshold value, it >> is >> originally given in db's, then i convert them into linear values, but >> that >> can't be right. i use uthe forumla: >> >> linear = pow (10.0, (0.05 * dBvalue); >> >> and this gives me a linear value, but this is of course not >> comparable to >> the amplitude value in the array. so what do i do with it? :-/ >> >> Not too sure what the next step is, any more help appreciated! >> >> Thanks again! >> >> Eddie >> >> ----- Original Message ----- >> From: "Steven Liddle" >> To: "a list for musical digital signal processing" >> >> Sent: Thursday, October 28, 2004 3:59 PM >> Subject: RE: [music-dsp] Coding attack and delay times for a >> compressor >> effect >> >> >>> Eddie, >>> >>> I think your code could possibly be a bit too simplistic in the way >>> it >> deals with whether the compression is applied or not. (I'm sure there >> are >> much better qualified people out there than me but this is how I >> understand). >>> >>> You need to get your head round the idea that the signal should only >>> be >> compressed when it is above the threshold. If the gain is above the >> threshold and rising from sample to sample then apply the compression >> according to the attack increment - if the gain is above the >> threshold > and >> attenuating (i.e. going down) sample by sample then the compression > release >> ratio ratio should be applied. If the signal is at or below the >> threshold >> then no action should be taken. >>> >>> Hope this makes sense. >>> >>> Steve >>> >>> >>> >>> -----Original Message----- >>> From: music-dsp-bounces@shoko.calarts.edu >> [mailto:music-dsp-bounces@shoko.calarts.edu]On Behalf Of Eddie > Al-Shakarchi >>> Sent: 28 October 2004 3:46 PM >>> To: a list for musical digital signal processing >>> Subject: Re: [music-dsp] Coding attack and delay times for a >>> compressor >> effect >>> >>> eeek, i made a mistake in that code i just posted - i think the line >>> to >>> check if the sample is over the threshold or not should have the > equality >>> operator reversed, giving: >>> >>> if (Math.abs(input[n]) > thresholdLevel) //switch on >>> >>> Which gives the results i described earlier >>> >>> If people don't wanna read the whole code please let me know i'll >>> stick > it >>> in pseudo code >>> >>> Thanks guys >>> >>> Eddie >>> >>> ----- Original Message ----- >>> From: "Eddie Al-Shakarchi" >>> To: "a list for musical digital signal processing" >>> >>> Sent: Thursday, October 28, 2004 3:22 PM >>> Subject: Re: [music-dsp] Coding attack and delay times for a >>> compressor >>> effect >>> >>> >>>> Hi >>>> >>>> Ah i see. Thanks for that. I've attempted to code a method in java >>>> (no >> one >>>> here uses java, i bet, but i have to) using the principles doug >>>> gave, >> but >>> i >>>> am getting really confused, as you'll probably be able to see. At >>>> the >>> moment >>>> all it does it seems to do (from looking at the waveforms produced) >>>> is >>>> divide the entire wave form by whatever ratio you set. Adjusting the >>>> threshol dmakes no real difference. >>>> >>>> Anyway here is the code, >>>> >>>> public short[] process(short input[]){ >>>> >>>> short[] output = new short [input.length]; >>>> int outputSample = 0; >>>> attackIncrement = (double)compressionRatio / > (double)attackTime; >>>> releaseIncrement = (double)compressionRatio / >> (double)releaseTime; >>>> >>>> System.out.println("Threshold = " + thresholdLevel); >>>> >>>> for (int n=0; n < output.length; n++){ >>>> >>>> if (Math.abs(input[n]) < thresholdLevel) //switch on >>>> currentCompressionRatio = currentCompressionRatio + >>>> attackIncrement; >>>> else >>>> currentCompressionRatio = currentCompressionRatio - >>>> releaseIncrement; >>>> >>>> if (currentCompressionRatio > compressionRatio) { >>>> currentCompressionRatio = compressionRatio; >>>> } >>>> if (currentCompressionRatio < 1.0){ >>>> currentCompressionRatio = 1.0; >>>> } >>>> >>>> outputSample = (int)(input[n] / >>>> currentCompressionRatio); >>>> // System.out.println("outputSample: " + outputSample); >>>> >>>> // Limits outputSample to max 16bit (short) value >>>> int limit = outputSample; >>>> if (limit > 32767){ >>>> limit = 32767; >>>> } >>>> >>>> else if (limit < -32767){ >>>> limit = -32767; >>>> } >>>> >>>> // Turns int back into short value in output array after > manipulation >>> and >>>> limiting >>>> output[n] = (short)limit; >>>> >>>> }// End of for loop >>>> >>>> return output; >>>> } >>>> >>>> I apoligise if you guys don't want me pasting code on this list. If >> anyone >>>> can let me know what i'm doing wrong i'd appreciate that, as i've >>>> been >>>> staring at this for so long that it doesn't make any sense at all >>>> now! >>>> >>>> Many thanks >>>> >>>> Eddie >>>> >>>> >>>> >>>> ----- Original Message ----- >>>> From: "Steven Liddle" >>>> To: "a list for musical digital signal processing" >>>> >>>> Sent: Thursday, October 28, 2004 3:13 PM >>>> Subject: RE: [music-dsp] Coding attack and delay times for a > compressor >>>> effect >>>> >>>> >>>>> Probably from an attack time of 50ms >>>>> >>>>> 2000 * (1/44100) is approx 50 ms - >>>>> >>>>> Steve >>>>> >>>>> >>>>> -----Original Message----- >>>>> From: music-dsp-bounces@shoko.calarts.edu >>>>> [mailto:music-dsp-bounces@shoko.calarts.edu]On Behalf Of Eddie >>>>> Al-Shakarchi >>>>> Sent: 28 October 2004 2:58 PM >>>>> To: a list for musical digital signal processing >>>>> Subject: Re: [music-dsp] Coding attack and delay times for a >> compressor >>>>> effect >>>>> >>>>> Hi there, i'm coding something now that i will post later >>>>> >>>>> Just out of interest, why did you say divide by 2000 samples? >>>>> >>>>> where did the 2000 come from? >>>>> >>>>> thanks! >>>>> >>>>> Eddie >>>>> >>>>> ----- Original Message ----- >>>>> From: "Doug" >>>>> To: "a list for musical digital signal processing" >>>>> >>>>> Sent: Thursday, October 28, 2004 4:33 AM >>>>> Subject: Re: [music-dsp] Coding attack and delay times for a >> compressor >>>>> effect >>>>> >>>>> >>>>>> >>>>>> ----- Original Message ----- >>>>>> From: "Eddie Al-Shakarchi" >>>>>> To: "a list for musical digital signal processing" >>>>>> >>>>>> Sent: Wednesday, October 27, 2004 11:08 AM >>>>>> Subject: [music-dsp] Coding attack and delay times for a >>>>>> compressor >>>>>> effect >>>>>> >>>>>> >>>>>>> Hi guys - sorry had a bit of problem with the mailing list >>>>>>> >>>>>>> I'm creating a simple hard knee (peak) compressor tool for a > piece >> of >>>>>>> software. It has the following parameters: >>>>>>> >>>>>>> - threshold >>>>>>> - compression ratio >>>>>>> - attack time >>>>>>> - release time >>>>>>> - a few misc. other things >>>>>>> >>>>>>> I understand the concepts involved in using a compressor (i use > one >>>>>> everday >>>>>>> when i make music!) but what i am finding hard to code is the >> attack >>>>>>> and >>>>>>> release times. The actual compression algorithm is: >>>>>>> >>>>>>> for (each value in the array){ >>>>>>> if value > threshold, then divide by ratio value >>>>>>> } >>>>>>> >>>>>>> however how do i take into account the attack and release times? > if >> i >>>>> have >>>>>>> an attack time of 1000 samples, do i just add 1000 to the for > loop? >>>>>>> what >>>>>>> about release? >>>>>>> >>>>>>> any info on this would be really helpful. I plan to make it work > on >>>>>>> peak >>>>>>> averaging too, and also make it work as a soft knee compressor - >> but >>>>>>> one >>>>>>> step at a time! >>>>>>> >>>>>>> Many thanks >>>>>>> >>>>>>> Eddie >>>>>>> >>>>>> >>>>>> As a simple case, calculate the atenuation in db. If it's 24, > devide >>>>>> that >>>>>> by 2000 samples and then cut the gain by .0012db ( I think) every >>> sample >>>>>> until you reach the target gain reduction. Do the opposite when >>>>> releasing. >>>>>> >>>>>> Your example suggests going hard at the wave amplitude which won't >>> work, >>>>>> you'll need to track the volume envelope of the wave and base your >>>>>> calculations on that, and, if I'm not mistaken, calculate the gain >>> factor >>>>> by >>>>>> cutting only the volume above the threshhold by the ratio. >>>>>> >>>>>> -- >>>>>> dupswapdrop -- the music-dsp mailing list and website: >>>>>> subscription info, FAQ, source code archive, list archive, book >>> reviews, >>>>> dsp links >>>>>> http://shoko.calarts.edu/musicdsp >>>>>> http://ceait.calarts.edu/mailman/listinfo/music-dsp >>>>> >>>>> -- >>>>> dupswapdrop -- the music-dsp mailing list and website: >>>>> subscription info, FAQ, source code archive, list archive, book >> reviews, >>>>> dsp links >>>>> http://shoko.calarts.edu/musicdsp >>>>> http://ceait.calarts.edu/mailman/listinfo/music-dsp >>>>> -- >>>>> dupswapdrop -- the music-dsp mailing list and website: >>>>> subscription info, FAQ, source code archive, list archive, book >> reviews, >>>>> dsp links >>>>> http://shoko.calarts.edu/musicdsp >>>>> http://ceait.calarts.edu/mailman/listinfo/music-dsp >>>> >>>> -- >>>> dupswapdrop -- the music-dsp mailing list and website: >>>> subscription info, FAQ, source code archive, list archive, book > reviews, >>> dsp links >>>> http://shoko.calarts.edu/musicdsp >>>> http://ceait.calarts.edu/mailman/listinfo/music-dsp >>> >>> -- >>> dupswapdrop -- the music-dsp mailing list and website: >>> subscription info, FAQ, source code archive, list archive, book >>> reviews, >> dsp links >>> http://shoko.calarts.edu/musicdsp >>> http://ceait.calarts.edu/mailman/listinfo/music-dsp >>> -- >>> dupswapdrop -- the music-dsp mailing list and website: >>> subscription info, FAQ, source code archive, list archive, book >>> reviews, >> dsp links >>> http://shoko.calarts.edu/musicdsp >>> http://ceait.calarts.edu/mailman/listinfo/music-dsp >> >> -- >> dupswapdrop -- the music-dsp mailing list and website: >> subscription info, FAQ, source code archive, list archive, book >> reviews, > dsp links >> http://shoko.calarts.edu/musicdsp >> http://ceait.calarts.edu/mailman/listinfo/music-dsp > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book > reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From xue.wen at elec.qmul.ac.uk Mon Nov 1 08:52:29 2004 From: xue.wen at elec.qmul.ac.uk (Wen X) Date: Wed Jun 27 19:17:47 2007 Subject: [music-dsp] resampling question (about libsamplerate, aka secretrabbit) References: <41809E41.4050706@wildgooses.com> <20041028074725.GC3591@login.ecs.soton.ac.uk> <4180A822.7040404@wildgooses.com> <18CCE882-28F7-11D9-AA2F-000A959AF1E4@earlevel.com> <4181F173.1020505@wildgooses.com><4182F00C.9090209@arcanemethods.com> <4183BAB4.8070007@wildgooses.com> Message-ID: <002901c4c01a$196e53c0$6a21258a@wenpc> I guess the art here is the use of sinc interpolation. When downsampling, I construct the sinc funtion using the DESTINATION sampling rate, which performs the low-pass filtering and downsampling in a single operation. When upsampling, I construct the sinc function using the SOURCE sampling rate, which band-limits the resulted signal to what it should be. There's no explicit filtering step at all. Xue ----- Original Message ----- From: "Ed Wildgoose" To: ; "a list for musical digital signal processing" Sent: Saturday, October 30, 2004 4:00 PM Subject: Re: [music-dsp] resampling question (about libsamplerate, aka secretrabbit) > >> >> If you want to resample to fewer samples, then logically you must band >> limit the signal to 1/2 the new sample rate before calculating the new >> points in order to avoid aliasing. > > > Aha, yes, good point! > > What about upsampling though? The text book says always bandlimit after > the upsample stage and before the downsample, but do we actually generate > out of band noise on upsampling? (if using the technique described before) > > Thanks > > Ed W > -- > dupswapdrop -- the music-dsp mailing list and website: subscription info, > FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From postmaster at emotu.it Mon Nov 1 10:38:15 2004 From: postmaster at emotu.it (Carlo Chiari) Date: Wed Jun 27 19:17:47 2007 Subject: [music-dsp] Maybe OT: sharing member between VST Effect class and VST Editor class Message-ID: <41865867.7010109@emotu.it> Hi, this seems to be more a C++ programming question than a sound processing question. I must share a member of the VST Effect class with the VST Editor class. This member is my customized WAV_File object. It contains wav file pointer, the wav info header and some routines. Since I open the wav file in the GUI Editor class, and process it in the Effect class, how could I access to it? thanx Carlo From rossb at audiomulch.com Mon Nov 1 13:32:26 2004 From: rossb at audiomulch.com (Ross Bencina) Date: Wed Jun 27 19:17:47 2007 Subject: [music-dsp] Maybe OT: sharing member between VST Effect class and VST Editor class References: <41865867.7010109@emotu.it> Message-ID: <00c401c4c041$c2be86d0$2401a8c0@Psilocybin> Hi Carlo I think you need to be extremely careful about sharing such objects between GUI and audio processing. I would suggest setting up a lock free queue structure, instantiating the soundfile object in the gui thread and then sending it to the audio thread via the queue. Don't try to access the object from both threads simultaneously unless you have designed it to be safe. Don't use locks if you want good performance. Ross. ----- Original Message ----- From: "Carlo Chiari" To: "a list for musical digital signal processing" Sent: Monday, November 01, 2004 4:38 PM Subject: [music-dsp] Maybe OT: sharing member between VST Effect class and VST Editor class > Hi, this seems to be more a C++ programming question than a sound > processing question. > > I must share a member of the VST Effect class with the VST Editor class. > This member is my customized WAV_File object. It contains wav file > pointer, the wav info header and some routines. > > Since I open the wav file in the GUI Editor class, and process it in the > Effect class, how could I access to it? > > thanx > > Carlo > -- > dupswapdrop -- the music-dsp mailing list and website: subscription info, > FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From doug_houghton at sympatico.ca Mon Nov 1 20:08:32 2004 From: doug_houghton at sympatico.ca (Doug) Date: Wed Jun 27 19:17:47 2007 Subject: [music-dsp] typical figital reverb References: <41865867.7010109@emotu.it> <00c401c4c041$c2be86d0$2401a8c0@Psilocybin> Message-ID: <000301c4c078$7aa97170$0201a8c0@elric> to anyone struggling along (like me) trying to get a decent sounding comb filter/allpass filter based reverb I just thought I'd share a discovery I made sifting through various internet pages. Until recently I never adjusted the gain setting on the various filters to match their respective delay laneghts. This is probably mentioned in every tutorial, but I somehow missed it, either that or I"m dead wrong, but anyhow... For example, if you've got 8 comb filters, all with varying lengths, say shorter to longer, setting the individual gain of each subsequent filter to be a little higher than the last seems to lush things up. It makes perfect sense. You don't want half your filters tapering out when the other half are jsut getting going. Ideally, all your filters should decay at the same rate volume wise. Right now I've got gain *= 1.1 in a loop that scrolls through all parralell comb filters just as a hack. This could properly be set calculating each filters gain based on it's length and it's target decay. That's it From paranoiaspoisondoor at gmail.com Mon Nov 1 20:13:55 2004 From: paranoiaspoisondoor at gmail.com (Keith Handy) Date: Wed Jun 27 19:17:47 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect In-Reply-To: References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead> <004901c4bd08$2b14d4b0$030200c0@australia> <007a01c4bd9a$88f30e20$030200c0@australia> Message-ID: <79a2ad4104110117132b36b0a3@mail.gmail.com> All I know is every time I glance at the contents of my inbox I spend about half a second thinking "What's a 'coding attack'???" ... -Keith -- I've seen all good people trim their hedge each day From signalzerodb at yahoo.co.uk Tue Nov 2 04:46:07 2004 From: signalzerodb at yahoo.co.uk (Dave Gamble) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect In-Reply-To: <79a2ad4104110117132b36b0a3@mail.gmail.com> References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead> <004901c4bd08$2b14d4b0$030200c0@australia> <007a01c4bd9a$88f30e20$030200c0@australia> <79a2ad4104110117132b36b0a3@mail.gmail.com> Message-ID: <05230867-2CB4-11D9-B3EA-000A958903DE@yahoo.co.uk> On 2 Nov 2004, at 01:13, Keith Handy wrote: > All I know is every time I glance at the contents of my inbox I spend > about half a second thinking "What's a 'coding attack'???" ... > If you've ever been to a demo party, it's the bit 25 minutes before the demos are due to go on the projector, where some genius invents a new gfx technique, codes it up into his demo, wins the competition, and then presents a paper on it at siggraph a month or two later. > I've seen all good people trim their hedge each day Huh? Dave. From warder at dlc.fi Tue Nov 2 04:58:19 2004 From: warder at dlc.fi (Vesa Norilo) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] typical figital reverb In-Reply-To: <000301c4c078$7aa97170$0201a8c0@elric> References: <41865867.7010109@emotu.it> <00c401c4c041$c2be86d0$2401a8c0@Psilocybin> <000301c4c078$7aa97170$0201a8c0@elric> Message-ID: <41875A3B.1010707@dlc.fi> > >It makes perfect sense. You don't want half your filters tapering out when >the other half are jsut getting going. Ideally, all your filters should >decay at the same rate volume wise. > > Yes, I always did the RT60 calculation per comb filter. Another thing you might want to do is to adjust the gain (not feedback gain) of the comb filter so that the spectrum peaks are equal. You see, the comb filter has a frequency response that's sharper for higher feedback coefs. It peaks at gain/(1-feedback) Set feedback per delay line lenght, normalize gain to equalize spectrum peaks and you should have the smoothest comb filter reverb possible... but I still prefer FDNs :) Vesa From postmaster at emotu.it Tue Nov 2 10:54:55 2004 From: postmaster at emotu.it (Carlo Chiari) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] Playing a WAV PCM in a VSTi Message-ID: <4187ADCF.50605@emotu.it> Hi to all, I've to playback a multichannel wav in a VSTi, it will look like a surround sampler when I'll implement the MIDI support. I'm using LIBSNDFILE library to manage audio data. In processReplacing function I fill up a floating point buffer (*data) with sampleFrames samples (using the sf_readf_float API). This functions return frames * channels samples so my call is: data = new float[sampleFrames]; ... ... if(wav.pWAV != NULL && wav.opened) { items = wav.readPCMSamples(wav.pWAV, data, sampleFrames / channels); } else { return ; } Then I de-inteleave the buffer and feed the **outputs with the result. My simple routine does the following: for(j = 0; j < channels; j ++) for(i = j; i < sampleFrames; i += channels) outputs[j][i] = data[i] * fGain; The listening result is that the music is slowed down very much, maybe an half. I tried to divide the items by a power of two so I read more often the data but the result became worst. My question is : have I to use the Microsoft waveOutOpen APIs to play a wav file also in a VSTi? But, isn't the host that does this stuff? thanx regards Carlo From doug_houghton at sympatico.ca Tue Nov 2 23:28:42 2004 From: doug_houghton at sympatico.ca (Doug) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] typical figital reverb References: <41865867.7010109@emotu.it> <00c401c4c041$c2be86d0$2401a8c0@Psilocybin><000301c4c078$7aa97170$0201a8c0@elric> <41875A3B.1010707@dlc.fi> Message-ID: <000a01c4c15d$99a6a0d0$0201a8c0@elric> thanks for the tips, now to google RT60 lol... ----- Original Message ----- From: "Vesa Norilo" To: "a list for musical digital signal processing" Sent: Tuesday, November 02, 2004 4:58 AM Subject: Re: [music-dsp] typical figital reverb > > > > >It makes perfect sense. You don't want half your filters tapering out when > >the other half are jsut getting going. Ideally, all your filters should > >decay at the same rate volume wise. > > > > > Yes, I always did the RT60 calculation per comb filter. Another thing > you might want to do is to adjust the gain (not feedback gain) of the > comb filter so that the spectrum peaks are equal. You see, the comb > filter has a frequency response that's sharper for higher feedback > coefs. It peaks at gain/(1-feedback) > > Set feedback per delay line lenght, normalize gain to equalize spectrum > peaks and you should have the smoothest comb filter reverb possible... > but I still prefer FDNs :) > > Vesa > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From eddie at roughproductions.co.uk Wed Nov 3 07:29:55 2004 From: eddie at roughproductions.co.uk (Eddie Al-Shakarchi) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead><004901c4bd08$2b14d4b0$030200c0@australia><007a01c4bd9a$88f30e20$030200c0@australia><79a2ad4104110117132b36b0a3@mail.gmail.com> <05230867-2CB4-11D9-B3EA-000A958903DE@yahoo.co.uk> Message-ID: <004101c4c1a0$d38f79a0$020200c0@australia> lol okay guys, the situation is that i have a working compressor now. i got around the threshold-in-db's issue by making the threshold a % of the original signal. i'm going to try steve liddles suggestions later about converting to db's (thanks for that). i'm now trying to give the user the option of using either peak, rms, or averaged detection. i was going to have another variable, called thresholdWidth which the user can set which will be used in both RMS and averaging mode. so this is a threshold in millisecs, and is used as a 'window' to get an average from. i think the c code in the dsp code archive does something similar but i noticed that on the compressor in logic (pro) that there is the option of RMS averaging but there's no threshold width. so what do they use to work out this mysterious rms average? cheers Eddie From eddie at roughproductions.co.uk Wed Nov 3 07:31:58 2004 From: eddie at roughproductions.co.uk (Eddie Al-Shakarchi) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead><004901c4bd08$2b14d4b0$030200c0@australia><007a01c4bd9a$88f30e20$030200c0@australia> <79a2ad4104110117132b36b0a3@mail.gmail.com> Message-ID: <005101c4c1a1$1c5d79c0$020200c0@australia> heh wierd thing is, i do the exact same thing ----- Original Message ----- From: "Keith Handy" To: "a list for musical digital signal processing" Sent: Tuesday, November 02, 2004 1:13 AM Subject: Re: [music-dsp] Coding attack and delay times for a compressor effect > All I know is every time I glance at the contents of my inbox I spend > about half a second thinking "What's a 'coding attack'???" ... > > -Keith > > -- > I've seen all good people trim their hedge each day > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp From joshscholar at yahoo.com Wed Nov 3 07:57:39 2004 From: joshscholar at yahoo.com (Joshua Scholar) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead><004901c4bd08$2b14d4b0$030200c0@australia><007a01c4bd9a$88f30e20$030200c0@australia><79a2ad4104110117132b36b0a3@mail.gmail.com> <05230867-2CB4-11D9-B3EA-000A958903DE@yahoo.co.uk> Message-ID: <001901c4c1a4$b4487020$1ae22641@antssoftware.com> >> I've seen all good people trim their hedge each day >Huh? I've given Keith long enough to answer. Here's your hint: "I've seen all good people turn their heads each day so satisfied I'm on my way." >Dave. Joshua "roundabout" Scholar From S.Liddle at ioe.ac.uk Wed Nov 3 08:42:44 2004 From: S.Liddle at ioe.ac.uk (Steven Liddle) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect Message-ID: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC69@mail02.ioead> >i'm now trying to give the user the option of using either peak, rms, or averaged detection. Ok > but i noticed that on the compressor in logic (pro) that there is the option of RMS averaging but there's no threshold width. so what do they use to work out this mysterious rms average? Keep it simple - find an optimum window time to get a reliable average and weigh it up with the amount of processing time required - that 's why you don't get a choice in logic. Steve From aclark at danvillesignal.com Wed Nov 3 10:20:08 2004 From: aclark at danvillesignal.com (Al Clark) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] ADSP-2100 circuit diagrams (delurking) In-Reply-To: References: Message-ID: <6.1.0.6.0.20041103091734.026ea600@localhost> I have been out of town, so if this has already been answered, ignore it..... The book in question is available on the ADI web site. I believe there is a link on our website in our developer section. The source code from the book is also available. Al Clark Danville Signal Processing, Inc. -------------------------------------------------------------------- Purveyors of Fine DSP Hardware and other Cool Stuff Available at http://www.danvillesignal.com At 06:01 AM 10/28/2004, David J. Hughes wrote: >Hello, > >I was given a book about ten years ago "Digital Signal Processing >Applications using the ADSP-2100 Family" and it came with a couple of 5 1/2 >inch discs. These are a little too big to fit into my PC's floppy though I >suppose I could try cutting them down a bit... (only joking). > >Does anyone have this book and, if so, have they copied the contents to >another medium? I would bevery grateful if anyone provide me with a copy of >the contents which should be, if memory serves, a couple of ADSP circuit >diagrams in Orcad format. > >Regards > David > >-- >Infection Music Limited. http://www.infectionmusic.co.uk > >This e-mail and any files transmitted with it are confidential and intended >for the addressee only. If you are not the addressee you may not copy, >forward, disclose or otherwise use it, or any part of it, in any form >whatsoever. If you have received this e-mail in error please notify the >sender and ensure that all copies of this e-mail and any files transmitted >with it are deleted. Any views or opinions represented in this e-mail are >solely those of the author and do not necessarily represent those of >Infection Music. Although this e-mail and its attachments have been scanned >for the presence of computer viruses, Infection Music will not be liable for >any losses as a result of any viruses being passed on. > > >-- >dupswapdrop -- the music-dsp mailing list and website: >subscription info, FAQ, source code archive, list archive, book reviews, >dsp links >http://shoko.calarts.edu/musicdsp >http://ceait.calarts.edu/mailman/listinfo/music-dsp From doug_houghton at sympatico.ca Wed Nov 3 19:28:04 2004 From: doug_houghton at sympatico.ca (Doug) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead><004901c4bd08$2b14d4b0$030200c0@australia><007a01c4bd9a$88f30e20$030200c0@australia><79a2ad4104110117132b36b0a3@mail.gmail.com><05230867-2CB4-11D9-B3EA-000A958903DE@yahoo.co.uk> <004101c4c1a0$d38f79a0$020200c0@australia> Message-ID: <000b01c4c205$26874200$0201a8c0@elric> > > i was going to have another variable, called thresholdWidth which the user > can set which will be used in both RMS and averaging mode. so this is a > threshold in millisecs, and is used as a 'window' to get an average from. i > think the c code in the dsp code archive does something similar > I went down the road of doing this and then ended up not bothering to. From citizenchunk at gmail.com Thu Nov 4 11:07:57 2004 From: citizenchunk at gmail.com (Citizen Chunk) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] Coding attack and delay times for a compressor effect In-Reply-To: <001901c4c1a4$b4487020$1ae22641@antssoftware.com> References: <1656B0BF279F48479D8FA02D9C0D5FE9023EDC61@mail02.ioead> <004901c4bd08$2b14d4b0$030200c0@australia> <007a01c4bd9a$88f30e20$030200c0@australia> <79a2ad4104110117132b36b0a3@mail.gmail.com> <05230867-2CB4-11D9-B3EA-000A958903DE@yahoo.co.uk> <001901c4c1a4$b4487020$1ae22641@antssoftware.com> Message-ID: YESS! dude! that song is rocks! what ever happened to prog-rock? == chunk On Wed, 3 Nov 2004 04:57:39 -0800, Joshua Scholar wrote: > > > >> I've seen all good people trim their hedge each day > >Huh? > > I've given Keith long enough to answer. Here's your hint: > "I've seen all good people turn their heads each day so satisfied I'm on my > way." > > >Dave. > > Joshua "roundabout" Scholar > > > > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From the8bitdeity at thegsp.com Thu Nov 4 17:55:21 2004 From: the8bitdeity at thegsp.com (Robert Kukuchka) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] Feedback Frequency Detection? Message-ID: <9B0F63C2-2EB4-11D9-9B57-000A95D5F9FC@thegsp.com> Hello, I'm curious if anyone could direct me to information regarding feedback frequency detection algorithms. I'm curious about how one would approach this, or specifically have gone about it. Any help would be appreciated. Cheers ~Rob From dgm at baykitty.com Thu Nov 4 18:23:22 2004 From: dgm at baykitty.com (don) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] spectrum analyzer Message-ID: <004201c4c2c5$4a475070$0402a8c0@liuxing> I am currently working on an audio spectrum analyzer in which we would like to replace a 1/3 digital filter network with an FFT. There are a number of reasons for this related to other aspects of the product. I realize that an FFT is not ?real time?, nor does it have the constant resolution we want from band to band, but much of this looks as though many of the problems could be ameliorated with the STFT and overlap. ? Has anyone done this? And what thoughts, references and caveats do you have? ? Thanks, Don ? From arcane at arcanemethods.com Thu Nov 4 21:31:56 2004 From: arcane at arcanemethods.com (Bob Cain) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] spectrum analyzer In-Reply-To: <004201c4c2c5$4a475070$0402a8c0@liuxing> References: <004201c4c2c5$4a475070$0402a8c0@liuxing> Message-ID: <418AE61C.2070500@arcanemethods.com> don wrote: > I am currently working on an audio spectrum analyzer in which we would like > to replace a 1/3 digital filter network with an FFT. There are a number of > reasons for this related to other aspects of the product. > I realize that an FFT is not ?real time?, nor does it have the constant > resolution we want from band to band, but much of this looks as though many > of the problems could be ameliorated with the STFT and overlap. What I'd do is a single FFT which implements the user specified magnitude function with either a minimum phase or linear phase implementation at the user's choice. What problems do you see that require something like a STFT? Latency of response to controls? I've not heard of using the STFT as a processing function, but rather an analysis tool. Have I missed something important? Bob -- "Things should be described as simply as possible, but no simpler." A. Einstein From dgm at baykitty.com Thu Nov 4 22:03:23 2004 From: dgm at baykitty.com (don) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] spectrum analyzer In-Reply-To: <418AE61C.2070500@arcanemethods.com> Message-ID: <006801c4c2e4$0629c7f0$0402a8c0@liuxing> No, very likely it is me and my understanding. I have not used it. The idea is to keep the resolution in each band the same. For Zoom functions. Perhaps, this is not the best technique. When I read about the STFT, it appeared to be an excellent analytic function and might allow a 'real time' response. I will look at what you suggest. Thank you. Don Don -----Original Message----- From: music-dsp-bounces@ceait.calarts.edu [mailto:music-dsp-bounces@ceait.calarts.edu] On Behalf Of Bob Cain Sent: Thursday, November 04, 2004 6:32 PM To: a list for musical digital signal processing Subject: Re: [music-dsp] spectrum analyzer don wrote: > I am currently working on an audio spectrum analyzer in which we would like > to replace a 1/3 digital filter network with an FFT. There are a number of > reasons for this related to other aspects of the product. > I realize that an FFT is not 'real time', nor does it have the constant > resolution we want from band to band, but much of this looks as though many > of the problems could be ameliorated with the STFT and overlap. What I'd do is a single FFT which implements the user specified magnitude function with either a minimum phase or linear phase implementation at the user's choice. What problems do you see that require something like a STFT? Latency of response to controls? I've not heard of using the STFT as a processing function, but rather an analysis tool. Have I missed something important? Bob -- "Things should be described as simply as possible, but no simpler." A. Einstein -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From S.W.Harris at ecs.soton.ac.uk Fri Nov 5 00:04:10 2004 From: S.W.Harris at ecs.soton.ac.uk (Steve Harris) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] spectrum analyzer In-Reply-To: <004201c4c2c5$4a475070$0402a8c0@liuxing> References: <004201c4c2c5$4a475070$0402a8c0@liuxing> Message-ID: <20041105050410.GD10954@login.ecs.soton.ac.uk> On Thu, Nov 04, 2004 at 03:23:22 -0800, don wrote: > I am currently working on an audio spectrum analyzer in which we would like > to replace a 1/3 digital filter network with an FFT. There are a number of > reasons for this related to other aspects of the product. > I realize that an FFT is not ?real time?, nor does it have the constant > resolution we want from band to band, but much of this looks as though many > of the problems could be ameliorated with the STFT and overlap. I have used FFTs for EQ purposes and it works fine. You need a substantial overlap if you want to lower the latency and avoid distortion, and the choice of window is important. FWIW I use Hanning windows with 16x overlap at 2048 pts. The low frequency resolution is not very good with this number of bands, but the CPU consumption quickly becommes excessive otherwise. I have considered downsampling and procxessing the low frequencies seperatly, but it would be hard to do without introducing unevenness in the freq and phase response, which is very important for my application. - Steve From martin at bioroid.com Fri Nov 5 01:10:06 2004 From: martin at bioroid.com (Martin Robaszewski) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] Playing a WAV PCM in a VSTi In-Reply-To: <4187ADCF.50605@emotu.it> Message-ID: <009301c4c2fe$19d57dc0$c801a8c0@traxx> Just look at my TurntablistPro VSTi source available on www.bioroid.com It uses libsndfile > -----Original Message----- > From: music-dsp-bounces@shoko.calarts.edu > [mailto:music-dsp-bounces@shoko.calarts.edu] On Behalf Of Carlo Chiari > Sent: Tuesday, November 02, 2004 7:55 AM > To: a list for musical digital signal processing > Subject: [music-dsp] Playing a WAV PCM in a VSTi > > > Hi to all, > I've to playback a multichannel wav in a VSTi, it will > look like a > surround sampler when I'll implement the MIDI support. > > I'm using LIBSNDFILE library to manage audio data. In > processReplacing > function I fill up a floating point buffer (*data) with sampleFrames > samples (using the sf_readf_float API). > This functions return frames * channels samples so my call is: > > data = new float[sampleFrames]; > ... > ... > if(wav.pWAV != NULL && wav.opened) > { > items = wav.readPCMSamples(wav.pWAV, data, > sampleFrames > / channels); > } > else > { > return ; > } > > Then I de-inteleave the buffer and feed the **outputs with > the result. > My simple routine does the following: > > for(j = 0; j < channels; j ++) > for(i = j; i < sampleFrames; i += channels) > outputs[j][i] = data[i] * fGain; > > The listening result is that the music is slowed down very > much, maybe > an half. > I tried to divide the items by a power of two so I read more > often the > data but the result became worst. > > My question is : have I to use the Microsoft waveOutOpen > APIs to play a > wav file also in a VSTi? But, isn't the host that does this stuff? > > thanx > > regards > > Carlo > -- > dupswapdrop -- the music-dsp mailing list and website: > subscription info, FAQ, source code archive, list archive, > book reviews, dsp links > http://shoko.calarts.edu/musicdsp > http://ceait.calarts.edu/mailman/listinfo/music-dsp > From y.shi at gpe-hkg.com Fri Nov 5 01:54:46 2004 From: y.shi at gpe-hkg.com (y.shi@gpe-hkg.com) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] Feedback Frequency Detection? In-Reply-To: <9B0F63C2-2EB4-11D9-9B57-000A95D5F9FC@thegsp.com> Message-ID: You may check the us patent 5245665. There is much more information than what you want. Good luck! Shi Yong Robert Kukuchka > cc: Sent by: Subject: [music-dsp] Feedback Frequency Detection? music-dsp-bounces@ceait. calarts.edu 04-11-05 06:55 Please respond to a list for musical digital signal processing Hello, I'm curious if anyone could direct me to information regarding feedback frequency detection algorithms. I'm curious about how one would approach this, or specifically have gone about it. Any help would be appreciated. Cheers ~Rob -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From y.shi at gpe-hkg.com Fri Nov 5 02:03:42 2004 From: y.shi at gpe-hkg.com (y.shi@gpe-hkg.com) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] In-Reply-To: <009301c4c2fe$19d57dc0$c801a8c0@traxx> Message-ID: I'm working with a hamonic generator which emploies a discrete-time integrator. I searched the matlab's help file and find some introduction about it to some extent,which mainly includes three methods: Forward Euler,Backward Euler and Trapezoidal. However, I failed to find any futher more information about any of these three methods. Any suggestions? Are there some useful articles online? Thanks advance. Shi Yong From dgm at baykitty.com Fri Nov 5 09:14:21 2004 From: dgm at baykitty.com (don) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] spectrum analyzer In-Reply-To: <20041105050410.GD10954@login.ecs.soton.ac.uk> Message-ID: <000901c4c341$c2538300$0402a8c0@liuxing> Thank you Steve, this sounds interesting. One of the considerations is the response of the system to white or pink noise must be consistent with a 1/3 octave filter bank. This is part of my concern - but if you have been able to use it for EQ, then it must handle that correctly, right? And another concern is the low frequency response. Somehow it must be consistent. Thank you again, Don -----Original Message----- From: music-dsp-bounces@ceait.calarts.edu [mailto:music-dsp-bounces@ceait.calarts.edu] On Behalf Of Steve Harris Sent: Thursday, November 04, 2004 9:04 PM To: music-dsp@shoko.calarts.edu Subject: Re: [music-dsp] spectrum analyzer On Thu, Nov 04, 2004 at 03:23:22 -0800, don wrote: > I am currently working on an audio spectrum analyzer in which we would like > to replace a 1/3 digital filter network with an FFT. There are a number of > reasons for this related to other aspects of the product. > I realize that an FFT is not 'real time', nor does it have the constant > resolution we want from band to band, but much of this looks as though many > of the problems could be ameliorated with the STFT and overlap. I have used FFTs for EQ purposes and it works fine. You need a substantial overlap if you want to lower the latency and avoid distortion, and the choice of window is important. FWIW I use Hanning windows with 16x overlap at 2048 pts. The low frequency resolution is not very good with this number of bands, but the CPU consumption quickly becommes excessive otherwise. I have considered downsampling and procxessing the low frequencies seperatly, but it would be hard to do without introducing unevenness in the freq and phase response, which is very important for my application. - Steve -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://shoko.calarts.edu/musicdsp http://ceait.calarts.edu/mailman/listinfo/music-dsp From aclark at danvillesignal.com Thu Nov 4 20:49:18 2004 From: aclark at danvillesignal.com (Al Clark) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] spectrum analyzer In-Reply-To: <004201c4c2c5$4a475070$0402a8c0@liuxing> References: <004201c4c2c5$4a475070$0402a8c0@liuxing> Message-ID: <6.1.0.6.0.20041104194012.02734498@localhost> At 05:23 PM 11/4/2004, you wrote: >I am currently working on an audio spectrum analyzer in which we would like >to replace a 1/3 digital filter network with an FFT. There are a number of >reasons for this related to other aspects of the product. >I realize that an FFT is not 'real time', nor does it have the constant >resolution we want from band to band, but much of this looks as though many >of the problems could be ameliorated with the STFT and overlap. > >Has anyone done this? And what thoughts, references and caveats do you have? > >Thanks, >Don > > > >-- >dupswapdrop -- the music-dsp mailing list and website: >subscription info, FAQ, source code archive, list archive, book reviews, >dsp links >http://shoko.calarts.edu/musicdsp >http://ceait.calarts.edu/mailman/listinfo/music-dsp 1/3 Octave networks have been synthesized from FFTs for many years. Generally, you will want to use multiple FFTs with different sampling rates. For example, you might use three 1024 point FFTs with sample rates of 48k, 4800 and 480. This insures that there is enough resolution for the lower frequency bands since you are mapping constant bandwidth filters into constant percentage bandwidth filters. You could also use longer FFTs for the same result. Assuming you have adequate signal processing capability, you could calculate the third octaves directly for better results. Al Clark Danville Signal Processing, Inc. -------------------------------------------------------------------- Purveyors of Fine DSP Hardware and other Cool Stuff Available at http://www.danvillesignal.com From ansum at online.de Fri Nov 5 12:04:06 2004 From: ansum at online.de (Andreas Sumerauer) Date: Wed Jun 27 19:17:48 2007 Subject: [music-dsp] Pitch Perception - with an inharmonic overtone spectrum Message-ID: <418BB286.8050402@online.de> Hi everybody, I am currently experimenting with modal synthesis and found that the perceived pitch is very much dependent on the overtones. If the spectrum is spread just a little bit the perceived pitch of the sound will not be equal to the fundamental anymore. I am just wondering wether it is possible to predict the perceiced pitch when the (inharmonic) spectrum is known. are there any rules that allow to precisely estimate the pitch? This would help me to implement an automatic retuning when the spectrum changes. I would be greatful for any hints or literature on the topic. thanks Andreas Sumerauer From martin.eisenberg at udo.edu Fri Nov 5 12:36:43 2004 From: martin.eisenberg at udo.edu (Martin Eisenberg) Date: Wed Jun 27 19:17:49 2007 Subject: [music-dsp] References: Message-ID: <002401c4c35e$076c59a0$1e0d060a@mooncode> From: > I'm working with a hamonic generator which emploies a > discrete-time integrator. > I searched the matlab's help file and find some introduction > about it to some extent,which mainly includes three methods: > Forward Euler,Backward Euler and Trapezoidal. > However, I failed to find any futher more information about > any of these three methods. Such numerical integration schemes are also called quadrature rules, maybe that helps. The rules you mention are described in sections 4 and 16 of the Numerical Recipes book. Martin From t.hogers at home.nl Fri Nov 5 13:26:34 2004 From: t.hogers at home.nl (Theo) Date: Wed Jun 27 19:17:49 2007 Subject: [music-dsp] Pitch Perception - with an inharmonic overtone spectrum References: <418BB286.8050402@online.de> Message-ID: <00dd01c4c364$faf01340$93b37ad9@ensch1.ov.home.nl> Hi Andreas Interesting, and kind off odd. I did a additive synth some time ago that had a "spread" parameter for the over tones, but didn't run into what you describe. The range of the parameter was set from 1/4 harmonic distance to 2 harmonic distance (probably not the right way to put it but hope you understand) When sweeping there where sweetspots where things sounded "almost harmonic" and bad spots where there was hardly a perceived pitch. However no pitch change like you describe. Also any FM (DX) synth let you do "spread" spectrums quite easily. Never felt there was a prob there either. It may be a matter of who is listening, maybe you have a better sense for pitch than I have. There is however one other thing I can think of. How is your spread parameter implemented? Is there a fixed frequency offset to all partials or is the offset for each partial based on the "distance" to the next harmonic. I did the latter and also does a DX (by nature). Cheers Theo ----- Original Message ----- From: Andreas Sumerauer To: a list for musical digital signal processing Sent: Friday, November 05, 2004 6:04 PM Subje