my bytebeat filter needs halp!
BotB Academy Bulletins
 
 
109677
Level 29 Mixist
post #109677 :: 2019.04.13 7:40am :: edit 2019.04.13 7:41am
 
 
109679
Level 29 Mixist
post #109679 :: 2019.04.13 9:37am
  
  DCT Master liēkd this
;-; what's wrong with this function?
am i stranded in conjunction junction?!?!

filter=function(curr,prev){
return (curr>prev)
// waveform up
?((curr-prev>f_cut)?prev+f_cut:curr)
// waveform down
:((prev-curr>f_cut)?prev-f_cut:curr)
}

is it f_cut? am i an idriot?!?! :D/
 
 
109681
Level 25 Chipist
post #109681 :: 2019.04.13 11:19am :: edit 2019.04.13 11:37am
  
  Baron Knoxburry liēkd this
looking at the output, i don't think there are bugs with your code

but i think the linear step size is restricting the sort of sounds you can make. what about trying something like

curr = prev + (curr - prev)*cutoff/100

where cutoff is a number between 1 and 100?

a more appropriate option is to properly implement a state variable filter of some sort, which would probably require more than one previous sample variable. otherwise there's no way to "round out" the peaks of the sawtooth wave. maybe something like

curr = prev + (curr-prev)*c1 + (prev - prev_prev)*c2

where c1 > c2 and c1 + c2 < 1
 
 
109682
 
 
109685
 
 
109686
Level 23 Mixist
post #109686 :: 2019.04.13 3:46pm
  
  Lia liēkd this
in my last discussion about bytebeat i was told that the true spirit of bytebeat is stateless and filters are ILLEGAL so i never bothered. i dont personally care tho
 
 
109699
Level 29 Mixist
post #109699 :: 2019.04.14 9:26am
  
  petet, kleeder and Sintel liēkd this
I just wanted to thank you all for trying to help me here!

coda reached out to me first on dicksword, then petet, and then Sintel!

Now, call me crazy if you want, but given what I know about audio synthesis and in looking at the bytebeat visualizer, I think my approach resembles the functionality of a filter best. But, of course, there was the clicky glitch which I found unsettling.

@petet -- I thought your fiter solution fixed the clicks, but later I realized they were only slightly better when I got back on the macbook. Speakers make a big difference! On my desktop they are much more negligible. I decided to use it because it was more concise than mine and this was a 1k entry. I think your filter is interesting because instead of minimizing slope, it rounds the bottom.

@Sintel -- congrats on your filter being glitch free! I didn't have enough time to really play with it yet. Your LFO is kind of cray cray: it seems to oscillate down twice and then up twice (but I'm not sure about the up because it just stays completely open for a while)? Also, I wasn't sure how to fit it into my 1k entry. I'll do my best to try and remember to come back here next time I do a full-size bytebeat entry!

Thanks y'all so murch!!! <3
 
 
109700
Level 23 Mixist
post #109700 :: 2019.04.14 10:42am
  
  Slimeball liēkd this
The lfo behaviour is just because of the abs(), i assumed that was intentional!

also the clikcing is - i think - a problem with the site and not the algorithm. for me, it goes away when i change the 'wave' to 'none' at the top, turning off the visualiser.
 
 
109713
Level 29 Mixist
post #109713 :: 2019.04.14 12:11pm
  
  Lia and Sintel liēkd this
omg :facepalm: that fixed the glitch from what i can tell!
 
 

LOGIN or REGISTER to add your own comments!