electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
Live streaming at radio.electro-music.com

  host / artist show at your time
<on air> mosc Back on the air tonight - Twyndyllyngs
Please visit the chat
 Forum index » DIY Hardware and Software » ChucK programming language
High Pass Filter cutoff freq changes cause clicks??
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [1 Post]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
enigma_0Z



Joined: Jun 06, 2011
Posts: 1
Location: Jupiter

PostPosted: Mon Jun 13, 2011 8:39 am    Post subject: High Pass Filter cutoff freq changes cause clicks??
Subject description: Changing my HPF freq makes the sound click, even if output is cut while the freq is changed...
Reply with quote  Mark this post and the followings unread

(If you follow the ChucK mailing list, you'll notice this looks familiar. I prefer message boards to mailing lists, but whatever you like doesn't really matter to me. I figured a solution would be advantageous to more than a few.)

First, a bit of context. I'm working on a subtractive synth program for ChucK, in ChucK, and have run across some (annoying and anomalous) clicks in my patch. If I play a low note, and then a high note, the patch produced a click just prior to the sound, similar to if you patch into the DAC while a sound is already being produced. I tracked it down to my high pass filter, which I was changing dynamically based on the key I was playing, to produce something that resembles MIDI key tracking - the higher you go, the higher the cutoff freq on the filter, the lower, the opposite. I do the same with an LPF without any issue, but for whatever reason, the high pass filter, whenever it changes drastically, whether or not the program is actually issuing sound at the time, there's a pop.

I've written a small program that illustrates the example by itself, with a little bit of additional code for experimentation. The program just jumps back and forth between two midi note numbers, changing the HPF value akin to how I was changing it in my original patch. If you make the HPF static, there is no issue any more. If you set the sound to fade in and out, there isn't an issue, but I think this is more just masking the problem than anything.

Anyway, the example code is here: http://pastebin.com/vc2W0UNW ... There's only 41 lines of code, but with my comments explaining it, it's more like 80 lines. The offending line is #54 - comment that out and no more pop. The attack/decay stuff has no effect on whether or not it clicks, except that a slow attack (fade in) masks it. You can take out the Attack/Decay code and replace that with a chuck to now (like noteLen => now) if you want to just peel that bit out. If you want to experiment with a static HPF, lines 37 or 38 can be used to set that up when you comment out #54, and that conclusively gets rid of the click.

There is still a small pop if the filter is set real high, but considering it's a "high pass" filter, I'm ready to write that bit off as the nature of the beast. That pop is nothing like the one I get from changing the filter around... FWIW this doesn't happen with an LPF IME.

It also seems that it's not actually affected by how the HPF is related to the output freq, if you change the *4 to *1 on line 54, it actually gets louder, at least to my ears.

Does anyone have a suggestion or idea as to what to do?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [1 Post]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use