tidalcycles / Dirt

Experimental sample playback
GNU General Public License v3.0
85 stars 24 forks source link

New params for beatmatching, updates for bandpass, crush, coarse #23

Closed bgold-cosmos closed 9 years ago

bgold-cosmos commented 9 years ago

I’ve added the new parameters “matchcps” and “stretchTo” that simplify beatmatching or automatically stretching samples to specified lengths with Tidal. These override the “speed “ and “accelerate” parameters.

I’ve also added some extra functionality to the bandpass filter and the quantizers “coarse” and “crush”. Using a negative frequency in “bandf” will switch the bandpass to a bandnotch filter. Using a negative value for “crush” will use a nonlinear quantization scheme that drops the effective noise floor a bit and handles quiet samples at low bit depths a bit better. And using a negative value for “coarse” will use different “resampling” method that has a bit less aliasing and effectively low-passes the sound.

Finally, to try and future-proof Dirt a little, I also made a slight change to the way the server handles messages with too many parameters. Instead of logging a generic error and playing no sound, it will now log a shorter error message but play the sound if the rest of the parameters are valid.

This updated Dirt should be fully backward compatible with prior versions of Tidal.

yaxu commented 9 years ago

Hey Ben Sorry have been travelling and haven't caught up with the forum.. Looks great, wondering though about whether stretchTo and matchcps could be turned into a single parameter, e.g. unit. speed "1" |+| unit "cycle" for matchcps, speed "1" |+| unit "sec" for seconds and speed "1" |+| unit "rate" for the current behaviour. We should also try to get Tidal to pass through the current cps for us as a hidden parameter, so that speed can be expressed as a ratio of the current cps Also if you think your filters are better than why not just replace the existing ones rather than using negative numbers?

bgold-cosmos commented 9 years ago

OK, I hadn't thought of having a modifier parameter like "unit". I think that would be elegant - passing cps as a hidden parameter might be useful for other situations too. I'm not entirely sure how to get Tidal to stamp the OSC messages with it, but I can take a look and see if I can figure it out.

I don't really think the new crush and coarse are "better"; often I prefer the sound of the old ones. But after a while I've found that for some samples they just don't work very well, and I thought an alternative algorithm might make them more useful or appealing to people.

yaxu commented 9 years ago

Hey Ben

Ok I've pushed a change so you should be able to switch cpsStamp to True in Dirt.hs and start receiving the current cps with every message, is that helpful?

bgold-cosmos commented 9 years ago

Very cool - I was pretty stumped looking at Stream.hs but you've done the hard stuff for me. I've successfully tested communication of cps from Tidal to Dirt, so I should be able to hack the rest up in Dirt soon.

kindohm commented 9 years ago

Makefile was added to .gitignore, that's why it isn't included.

bgold-cosmos commented 9 years ago

OK, here's the new version with "unit". You can look at the latest commit for detailed comments, but in short now you can do something like

cps 0.75
d1 $ sound "[breaks125, breaks125/2, breaks165, rave:6/4]" |+| unit "c"

and Wham! automatic beat-matching. It's a lot of fun.