petercommand has quit [Remote host closed the connection]
selimcan has joined #racket
selimcan has quit [Remote host closed the connection]
efm has quit [Ping timeout: 245 seconds]
dbmikus has joined #racket
efm has joined #racket
efm has quit [Ping timeout: 255 seconds]
dbmikus has quit [Ping timeout: 245 seconds]
dbmikus_ has joined #racket
efm has joined #racket
pera has joined #racket
lavaflow has joined #racket
efm has quit [Ping timeout: 245 seconds]
badkins has joined #racket
selimcan has joined #racket
quipa_ has quit [Ping timeout: 246 seconds]
sauvin has quit [Ping timeout: 246 seconds]
ZombieChicken has joined #racket
badkins_ has joined #racket
badkins has quit [Ping timeout: 255 seconds]
quipa has joined #racket
keep_learning has quit [Ping timeout: 268 seconds]
pie___ has joined #racket
pie__ has quit [Remote host closed the connection]
quipa_ has joined #racket
quipa has quit [Ping timeout: 255 seconds]
quipa_ has quit [Client Quit]
badkins_ has quit [Ping timeout: 252 seconds]
eddof13 has quit [Quit: eddof13]
sz0 has joined #racket
freeduck has joined #racket
eddof13 has joined #racket
<freeduck>
Hi all. I would like to use array-fft in one of my projects. I am told my a friend that fft can identify the different frequencies that make up a signal. My math skill are limited, and I am looking for examples where fft is used. Can any of you point me the right direction? thanks
orivej has joined #racket
FreeFull has joined #racket
freeduck has left #racket ["ERC (IRC client for Emacs 25.1.1)"]
eddof13 has quit [Quit: eddof13]
eddof13 has joined #racket
libertyprime has joined #racket
selimcan has quit [Remote host closed the connection]
libertyprime has quit [Ping timeout: 245 seconds]
<rjungemann>
@freeduck it's used frequently in music software for monophonic/polyphonic pitch detection, pitch/formant shifting, and vocoders, and also frequently used in the sciences
<rjungemann>
It takes a signal (in the frequency domain) and breaks it up into "buckets" where each bucket represents a sine wave of a certain frequency, with a certain amplitude
<rjungemann>
You can use it for analysis, or you can manipulate the amplitudes of the buckets and use an inverse FFT to generate a new signal
ubLIX has joined #racket
<rjungemann>
My favorite use is "spectral freezing"—track a handful of snapshots of the FT and then cycle through them and IFFT to create an apparent "frozen" version of a sound, like a sustain pedal for any sound
<rjungemann>
For more info you can look up "spectral sound processing". It really sank in for me what an FFT does when I learned about additive synthesis, which is a little bit like an IFFT
<rjungemann>
To use for monophonic pitch detection, a good place to start is to loop through the buckets and find the one with the highest amplitude
libertyprime has joined #racket
<rjungemann>
If I'm inside of a macro, and I have a syntax-wrapped hash, let's say, how can I use it? Calling `(hash-has-key? #'my-hash #'my-key)` returns `hash-has-key?: contract violation expected: hash? given: #<syntax #hash()>`
<rjungemann>
Ah, `syntax-e` does it. It makes me nervous because I've read the docs on it a dozen times and I still don't "get" `syntax-e` but at least it seems to work
<rjungemann>
I've been writing unhygenic macros for a long time, and so I tend to start with `define-macro`and then port it to hygenic, but there's so much to learn...
<rjungemann>
Here's another question. If I have a macro that only modifies a syntax parameter and doesn't need to generate a body necessarily, is there a way to define a function at the syntax level and make it available for calling outside of a macro? If I define a function in `begin-for-syntax` it isn't available outside
pera has quit [Ping timeout: 246 seconds]
pera has joined #racket
eddof13 has quit [Quit: eddof13]
<rjungemann>
I don't know if this is interesting to anyone, but I wrote my own take on multiple dispatch based on Clojure's `defmulti`. It boils down to an inline `cond` so it should be stupid fast. I'll be using it as a library for my Lisp game jam game, to dispatch an `update` method based on an entity's name (there are reasons for not using alternatives which are too complicated to unpack atm)
<rjungemann>
If anyone would like to poke holes in my insane attempt at converting my unhygenic macros to hygenic, please do, I'd like to get better (the commented-out code is the unhygenic original version)
<rjungemann>
I feel like I'm using `syntax-e` and `syntax->datum` way way too much...
<rjungemann>
Oh and the example code is in the `main` module at the bottom
eddof13 has joined #racket
libertyprime has quit [Ping timeout: 245 seconds]
libertyprime has joined #racket
dbmikus__ has joined #racket
dbmikus_ has quit [Ping timeout: 245 seconds]
pera has quit [Quit: leaving]
pera has joined #racket
jao has joined #racket
selimcan has joined #racket
selimcan has quit [Remote host closed the connection]