<commit_before>---
layout: post
title:  "Recreating Daft Punk's Da Funk"
date:   2016-04-03 21:18:00
categories: remake
---

This is the first of (I hope...) series of tutorials on using great [Overtone](http://overtone.github.io/) library for turning your computer into a musical instrument with Clojure.

Today we'll recreate Daft Punk's "Da Funk" [main theme](https://youtu.be/mmi60Bd4jSs?t=9). The track which had a huge influence for me (and many more) entering the world of electronic music. It's really simple but how huge!

### TL;DR
At the end of this tutorial we'll create this phrase:
<audio controls>
	<source src="/assets/sounds/all.ogg"/>
</audio>

<br/>

### Theme

The nice thing about Daft Punk is that they "open sourced" a large amount of their music. You can find midi notes, loops, acapellas and beats for many of their songs on a site called [Daft Club](http://daft.club/daftabase). You can download midi file and beats (kick, snare, percussion) for Da Funk. The track is also the subject of many YouTube tutorial videos, and appears in Mitchell Sigman's [Steal this sound](http://www.amazon.com/Keyboard-Presents-Steal-This-Sound/dp/1423492811) which make a great one to recreate using Overtone.

So from the midi file from Daft Club we can get these notes:

![notes](/assets/images/da-funk.png)

The key is F major and BPM is 110.

To recreate the melody I'll use [Leipzig](https://github.com/ctford/leipzig) - superb library which provides a DSL for constructing melody as data structure.

{% highlight clojure %}
(require '[leipzig.melody :refer :all])<commit_msg>final fixes<commit_after>---
layout: post
title:  "Recreating Daft Punk's Da Funk"
date:   2016-04-03 21:18:00
categories: remake
---

This is the first of (I hope...) series of tutorials on using great [Overtone](http://overtone.github.io/) library for turning your computer into a musical instrument with Clojure.

Today we'll recreate Daft Punk's "Da Funk" [main theme](https://youtu.be/mmi60Bd4jSs?t=9). The track which had a huge influence for me (and many more) entering the world of electronic music. It's really simple but how huge!

### TL;DR
At the end of this tutorial we'll create this phrase:
<audio controls>
	<source src="/assets/sounds/all.ogg"/>
</audio>

<br/>

### Theme

The nice thing about Daft Punk is that they "open sourced" a large amount of their music. You can find midi notes, loops, acapellas and beats for many of their songs (including Da Funk) on a site called [Daft Club](http://daft.club/daftabase). The track is also the subject of many YouTube tutorial videos, and appears in Mitchell Sigman's [Steal this sound](http://www.amazon.com/Keyboard-Presents-Steal-This-Sound/dp/1423492811) which make a perfect one to recreate using Overtone.

So from the midi file from Daft Club we can get these notes:

![notes](/assets/images/da-funk.png)

The key is F major and BPM is 110.

To recreate the melody I'll use [Leipzig](https://github.com/ctford/leipzig) - superb library which provides a DSL for constructing melody as data structure.

{% highlight clojure %}
(require '[leipzig.melody :refer :all])
{'fraction_non_alphanumeric': 0.10147247119078105, 'fraction_numerical': 0.019846350832266324, 'mean_word_length': 4.305602716468591, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2478449', 'n_tokens_mistral': 1027, 'n_tokens_neox': 938, 'n_words': 422}