{"action":"created","comment":{"url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/pulls/comments/84605159","pull_request_review_id":5371721,"id":84605159,"diff_hunk":"@@ -0,0 +1,122 @@\n+---\n+chapter: Lag en sang\n+title: Legg til tilfeldigheter\n+lang: no\n+layout: exercise\n+---\n+\n+Strålende! Nå har du en sang med en fin rytme og bass og med melodien over. Nå skal vi gjøre noe skikkelig tøft og demonstrere Sonic Pis virkelige potensial. La oss legge til noe generert musikk til sangen og programmere datamaskinen til å komponere musikk for oss!\n+\n+## Kast en terning og transponer melodien\n+\n+Å transponere betyr å endre tonearten. Vi kan legge til litt tilfeldig transponering til en melodi innimellom for å krydre sangen litt. Du kan kaste en terning for å bestemme når vi skal endre melodiens tonehøyde. Her er ett eksempel:\n+\n+{% highlight ruby %}\n+live_loop :melodi do\n+  if one_in(6)\n+    use_transpose 2\n+  else\n+    use_transpose 0\n+  end\n+  play_pattern_timed [:c4, :e4, :f4, :g4, :f4, :e4, :f4, :g4, :f4, :e4, :f4], [0.25, 0.25, 0.25, 1.5, 0.25, 0.25, 0.25, 0.25, 0.25, 0.25], attack: 0, release: 0.2\n+end\n+{% endhighlight %}\n+\n+## Å lage et tilfeldig acid bass spor\n+\n+La oss gjøre noe spennende med bassløkken. `.choose` er en nyttig metode som velger et tilfeldig element fra en liste. Det ser sånn ut:\n+\n+{% highlight ruby %}\n+play [:c, :e, :g].choose\n+{% endhighlight %}\n+\n+`[:c, :e, :g]` er en liste av noter (i dette eksempelet er det notene i C-dur akkorden). `.choose` velger ut en av disse notene tilfeldig. Istedenfor noter kn du ha hva du vil i listen, for eksempel verdier for sleep:\n+\n+{% highlight ruby %}\n+loop do\n+  use_octave [0, 1].choose\n+  play [:c, :e, :g].choose\n+  sleep [0.25, 0.25, 0.5, 1].choose\n+end\n+{% endhighlight %}\n+\n+Du trenger ikke engang å huske hvilke noter som er i hvilke akkorder. Sonic Pi kan fikse det for deg. Istedenfor å skrive `[:c, :e, :g]` kan du bare skrive `(chord :C, :major)`. Det lager en list av noter for deg automatisk. For eksempel:\n+\n+{% highlight ruby %}\n+loop do\n+  play (chord :c, :major).choose\n+  sleep [0.25, 0.25, 0.5, 1].choose\n+end\n+{% endhighlight %}\n+\n+La oss bruke trolldommen vi nettopp lærte for å lage et boblende bassspor. Lagre arbeidet ditt og kopier `:bass` løkken til et annet mellomlager (buffer) i tilfelle du vil bruke det siden. Slett det som er inni løkken så vi får plass til noe nyt. La oss bruke den klassiske `:tb303` synthen og spille tilfeldige noter fra C-dur akkorden:\n+\n+{% highlight ruby %}\n+live_loop :bass do\n+  use_synth :tb303\n+  play (chord :C2, :major).choose\n+  sleep 0.25\n+end\n+{% endhighlight %}\n+\n+Ough! Ikke akkurat sånn... Legg til `, release: 0.125` parameteren etter play kommandoen, som dette:\n+\n+{% highlight ruby %}\n+live_loop :bass do\n+  use_synth :tb303\n+  play (chord :C2, :major).choose, release: 0.125\n+  sleep 0.25\n+end\n+{% endhighlight %}\n+\n+Det høres bedre ut, men vi må pusse litt mer på det. Så langt har vi brukt `attack:` og `release:` parametere for play kommandoen. Avhengig av synthen du bruker så er det mange andre parametere man kan bruke. For eksempel har tb303 synthen 45 forskjellige muligheter å skru på. La oss bruke en parameter for en play kommando som heter `cutoff` på bassen. Cutoff fjerner alle frekvenser over cutoff frekvenser, altså den lyse/høye biten av tonen.  Du kan bruke verdier mellom 0-130.\n+\n+Men hvorfor bruke en fast cutoff verdi når vi kan ha en tilfeldig verdi? Med `rrand(min, max)` kan du velge tilfeldige tall i et bestemt intervall. Prøv det:","path":"_exercises/no/02-make-a-song/05-add-randomization.md","position":74,"original_position":74,"commit_id":"5f4423cafb38f05c6bf9b9aaa41ceab43cd33c79","original_commit_id":"5f4423cafb38f05c6bf9b9aaa41ceab43cd33c79","user":{"login":"arve0","id":4810521,"avatar_url":"https://avatars.githubusercontent.com/u/4810521?v=3","gravatar_id":"","url":"https://api.github.com/users/arve0","html_url":"https://github.com/arve0","followers_url":"https://api.github.com/users/arve0/followers","following_url":"https://api.github.com/users/arve0/following{/other_user}","gists_url":"https://api.github.com/users/arve0/gists{/gist_id}","starred_url":"https://api.github.com/users/arve0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arve0/subscriptions","organizations_url":"https://api.github.com/users/arve0/orgs","repos_url":"https://api.github.com/users/arve0/repos","events_url":"https://api.github.com/users/arve0/events{/privacy}","received_events_url":"https://api.github.com/users/arve0/received_events","type":"User","site_admin":false},"body":"cutoff-verdi","created_at":"2016-10-23T21:24:06Z","updated_at":"2016-10-23T21:34:20Z","html_url":"https://github.com/mehackit/sonic-pi-workshop/pull/9#discussion_r84605159","pull_request_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/mehackit/sonic-pi-workshop/pulls/comments/84605159"},"html":{"href":"https://github.com/mehackit/sonic-pi-workshop/pull/9#discussion_r84605159"},"pull_request":{"href":"https://api.github.com/repos/mehackit/sonic-pi-workshop/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/pulls/9","id":86660332,"html_url":"https://github.com/mehackit/sonic-pi-workshop/pull/9","diff_url":"https://github.com/mehackit/sonic-pi-workshop/pull/9.diff","patch_url":"https://github.com/mehackit/sonic-pi-workshop/pull/9.patch","issue_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/issues/9","number":9,"state":"open","locked":false,"title":"Initial translation to norwegian","user":{"login":"bjartwolf","id":1174441,"avatar_url":"https://avatars.githubusercontent.com/u/1174441?v=3","gravatar_id":"","url":"https://api.github.com/users/bjartwolf","html_url":"https://github.com/bjartwolf","followers_url":"https://api.github.com/users/bjartwolf/followers","following_url":"https://api.github.com/users/bjartwolf/following{/other_user}","gists_url":"https://api.github.com/users/bjartwolf/gists{/gist_id}","starred_url":"https://api.github.com/users/bjartwolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjartwolf/subscriptions","organizations_url":"https://api.github.com/users/bjartwolf/orgs","repos_url":"https://api.github.com/users/bjartwolf/repos","events_url":"https://api.github.com/users/bjartwolf/events{/privacy}","received_events_url":"https://api.github.com/users/bjartwolf/received_events","type":"User","site_admin":false},"body":"Translated to norwegian. I think it is better kept without links until it has been proof read properly, but like this it can be used in education and it is easier to get peoples input on the translation if it can be accessed and read properly formatted online, so as long as it doesnt break the existing site I think it is best to include it as is, deploy and use the index_no.html link to access the translated version and after it has been proof read, include proper navigation\r\n\r\nI didn't manage to get the descriptions translated.","created_at":"2016-09-25T19:44:55Z","updated_at":"2016-10-23T21:34:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a6c0f7f017666b209218a4aa38304aba53ceb358","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/pulls/9/commits","review_comments_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/pulls/9/comments","review_comment_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/issues/9/comments","statuses_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/statuses/5f4423cafb38f05c6bf9b9aaa41ceab43cd33c79","head":{"label":"bjartwolf:translate-no","ref":"translate-no","sha":"5f4423cafb38f05c6bf9b9aaa41ceab43cd33c79","user":{"login":"bjartwolf","id":1174441,"avatar_url":"https://avatars.githubusercontent.com/u/1174441?v=3","gravatar_id":"","url":"https://api.github.com/users/bjartwolf","html_url":"https://github.com/bjartwolf","followers_url":"https://api.github.com/users/bjartwolf/followers","following_url":"https://api.github.com/users/bjartwolf/following{/other_user}","gists_url":"https://api.github.com/users/bjartwolf/gists{/gist_id}","starred_url":"https://api.github.com/users/bjartwolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjartwolf/subscriptions","organizations_url":"https://api.github.com/users/bjartwolf/orgs","repos_url":"https://api.github.com/users/bjartwolf/repos","events_url":"https://api.github.com/users/bjartwolf/events{/privacy}","received_events_url":"https://api.github.com/users/bjartwolf/received_events","type":"User","site_admin":false},"repo":{"id":68901170,"name":"sonic-pi-workshop","full_name":"bjartwolf/sonic-pi-workshop","owner":{"login":"bjartwolf","id":1174441,"avatar_url":"https://avatars.githubusercontent.com/u/1174441?v=3","gravatar_id":"","url":"https://api.github.com/users/bjartwolf","html_url":"https://github.com/bjartwolf","followers_url":"https://api.github.com/users/bjartwolf/followers","following_url":"https://api.github.com/users/bjartwolf/following{/other_user}","gists_url":"https://api.github.com/users/bjartwolf/gists{/gist_id}","starred_url":"https://api.github.com/users/bjartwolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjartwolf/subscriptions","organizations_url":"https://api.github.com/users/bjartwolf/orgs","repos_url":"https://api.github.com/users/bjartwolf/repos","events_url":"https://api.github.com/users/bjartwolf/events{/privacy}","received_events_url":"https://api.github.com/users/bjartwolf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bjartwolf/sonic-pi-workshop","description":" Website for mehackit Sonic-Pi workshop","fork":true,"url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop","forks_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/forks","keys_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/teams","hooks_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/hooks","issue_events_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/issues/events{/number}","events_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/events","assignees_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/assignees{/user}","branches_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/branches{/branch}","tags_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/tags","blobs_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/git/refs{/sha}","trees_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/statuses/{sha}","languages_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/languages","stargazers_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/stargazers","contributors_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/contributors","subscribers_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/subscribers","subscription_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/subscription","commits_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/commits{/sha}","git_commits_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/git/commits{/sha}","comments_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/comments{/number}","issue_comment_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/issues/comments{/number}","contents_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/contents/{+path}","compare_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/merges","archive_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/downloads","issues_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/issues{/number}","pulls_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/pulls{/number}","milestones_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/milestones{/number}","notifications_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/labels{/name}","releases_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/releases{/id}","deployments_url":"https://api.github.com/repos/bjartwolf/sonic-pi-workshop/deployments","created_at":"2016-09-22T08:31:56Z","updated_at":"2016-09-22T08:31:58Z","pushed_at":"2016-09-25T19:50:09Z","git_url":"git://github.com/bjartwolf/sonic-pi-workshop.git","ssh_url":"git@github.com:bjartwolf/sonic-pi-workshop.git","clone_url":"https://github.com/bjartwolf/sonic-pi-workshop.git","svn_url":"https://github.com/bjartwolf/sonic-pi-workshop","homepage":"http://sonic-pi.mehackit.org/","size":76132,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mehackit:master","ref":"master","sha":"294c80e4ca6e02f612fc78be2735e3c61322548f","user":{"login":"mehackit","id":16879407,"avatar_url":"https://avatars.githubusercontent.com/u/16879407?v=3","gravatar_id":"","url":"https://api.github.com/users/mehackit","html_url":"https://github.com/mehackit","followers_url":"https://api.github.com/users/mehackit/followers","following_url":"https://api.github.com/users/mehackit/following{/other_user}","gists_url":"https://api.github.com/users/mehackit/gists{/gist_id}","starred_url":"https://api.github.com/users/mehackit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mehackit/subscriptions","organizations_url":"https://api.github.com/users/mehackit/orgs","repos_url":"https://api.github.com/users/mehackit/repos","events_url":"https://api.github.com/users/mehackit/events{/privacy}","received_events_url":"https://api.github.com/users/mehackit/received_events","type":"Organization","site_admin":false},"repo":{"id":50384832,"name":"sonic-pi-workshop","full_name":"mehackit/sonic-pi-workshop","owner":{"login":"mehackit","id":16879407,"avatar_url":"https://avatars.githubusercontent.com/u/16879407?v=3","gravatar_id":"","url":"https://api.github.com/users/mehackit","html_url":"https://github.com/mehackit","followers_url":"https://api.github.com/users/mehackit/followers","following_url":"https://api.github.com/users/mehackit/following{/other_user}","gists_url":"https://api.github.com/users/mehackit/gists{/gist_id}","starred_url":"https://api.github.com/users/mehackit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mehackit/subscriptions","organizations_url":"https://api.github.com/users/mehackit/orgs","repos_url":"https://api.github.com/users/mehackit/repos","events_url":"https://api.github.com/users/mehackit/events{/privacy}","received_events_url":"https://api.github.com/users/mehackit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mehackit/sonic-pi-workshop","description":" Website for mehackit Sonic-Pi workshop","fork":false,"url":"https://api.github.com/repos/mehackit/sonic-pi-workshop","forks_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/forks","keys_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/teams","hooks_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/hooks","issue_events_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/issues/events{/number}","events_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/events","assignees_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/assignees{/user}","branches_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/branches{/branch}","tags_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/tags","blobs_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/git/refs{/sha}","trees_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/statuses/{sha}","languages_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/languages","stargazers_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/stargazers","contributors_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/contributors","subscribers_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/subscribers","subscription_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/subscription","commits_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/commits{/sha}","git_commits_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/git/commits{/sha}","comments_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/comments{/number}","issue_comment_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/issues/comments{/number}","contents_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/contents/{+path}","compare_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/merges","archive_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/downloads","issues_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/issues{/number}","pulls_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/pulls{/number}","milestones_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/milestones{/number}","notifications_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/labels{/name}","releases_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/releases{/id}","deployments_url":"https://api.github.com/repos/mehackit/sonic-pi-workshop/deployments","created_at":"2016-01-25T22:13:24Z","updated_at":"2016-09-23T08:35:09Z","pushed_at":"2016-09-25T19:50:09Z","git_url":"git://github.com/mehackit/sonic-pi-workshop.git","ssh_url":"git@github.com:mehackit/sonic-pi-workshop.git","clone_url":"https://github.com/mehackit/sonic-pi-workshop.git","svn_url":"https://github.com/mehackit/sonic-pi-workshop","homepage":"http://sonic-pi.mehackit.org/","size":76072,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":7,"mirror_url":null,"open_issues_count":3,"forks":7,"open_issues":3,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mehackit/sonic-pi-workshop/pulls/9"},"html":{"href":"https://github.com/mehackit/sonic-pi-workshop/pull/9"},"issue":{"href":"https://api.github.com/repos/mehackit/sonic-pi-workshop/issues/9"},"comments":{"href":"https://api.github.com/repos/mehackit/sonic-pi-workshop/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/mehackit/sonic-pi-workshop/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/mehackit/sonic-pi-workshop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mehackit/sonic-pi-workshop/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/mehackit/sonic-pi-workshop/statuses/5f4423cafb38f05c6bf9b9aaa41ceab43cd33c79"}}}}
{"actor":{"display_login":"arve0"}}