It ended up being 78% smaller than the equivalent C++ parser I wrote last year and certainly more than 78% easier to reason about. The next weekend I even implemented a parser in Haskell based on the principles from this paper. This time it was easy - it all clicked - it all made sense. One weekend I decide to try to tackle a paper that has been confusing me for a while (the last two times I tried to learn Haskell I could not make it through). I am focused much more on composing functions to create cool sounds than all the fun and fancy lingo like monads, functors, etc. I am now learning Haskell for the second (third?) time, but this time in the context of a DSL for live coding music. It turns out this approach was largely not beneficial in the long run… even though I read an entire book on Rust and listened to the wonderful New Rustacean Podcast, if you held a gun to my head right now and said “write me a proper linked list in Rust” I would surely fail. However, at this time my focus was on learning languages for the sake of learning languages. From there I got the programming language bug and very quickly doubled the languages I could write basic projects in from three to six. The first part of this year was spent at a coding bootcamp, where I learned fullstack JavaScript (MERN stack).
Haskell functional programming as a liberal arts code#
Lesson 1: Code is Merely a Toolĭuring the 2017-2018 school year, I took a gap year where I spent the majority of my time in San Francisco. However, coding in this unconventional way taught me a few unexpected lessons. My TakeawaysĪs a computer science major and coding enthusiast, I came into this class from a coding perspective: I viewed this class as coding music, not creating music via code. There is certainly a lot more you can do with Tidal… the above is just a small taste :) To learn more checkout the website and the docs. The following fades in the reverbkick sample gradually over the course of 10 cycles onto synth input 1. The following will randomly pan the sample:įinally, let’s assume you are playing a set and want to have a spiffy fade in of a nice percussion kick. To make things more interesting, we can apply effects to samples. Note: samples like bd or hh often have multiple varieties which can be specified by bd:2 or s "bd" # n "2". Consider the following which reverses, then slows, then increments the selection of the first sample every 2 cycles:ĭ1 $ every 2 ((|+ n "2"). To reverse some samples every 2 cycles, we can use the every function:įor this part of Tidal, Haskell works wonderfully, as you compose functions in a typical Haskell style. I don’t formally know music, but if you do, you can setcps, set the cycles per second, to match what you may expect in terms of beats per second. This takes the sample bd and plays it once every cycle. To play a simple bass drum sample, you would type: d1 $ s "bd" The TLDR of TidalCyclesīelow is a sampling of what you can do with TidalCycles, a.k.a. In my class, we focused on using TidalCycles, a Haskell DSL that allows users (even the musically challenged) to create cool patterns via the SuperDirt synth. There are many different platforms and languages allowing for a variety of techniques for music creation. Algoraves can include a range of styles, including a complex form of minimal techno, and the movement has been described as a meeting point of hacker philosophy, geek culture, and clubbing. What is an Algorave?Īn event where people dance to music generated from algorithms, often using live coding techniques. While I’ve never dabbled in creating music or designing visuals my final performance this afternoon ended up pretty ok. This course was Silicon Valley in a nutshell: experimental electronic music via pure, functional programming (Haskell). There’s a quote by Jim Rohn that goes “you are the average of the five people you spend the most time with.” Considering I spent the last two summers deep in Silicon Valley’s blockchain scene, surrounded by people immersed in cutting edge tech always planning for the next Burning Man, it was nearly inevitable that I enroll in a class called algorave (offered for the first time this year at Colby College).