{"id":5312,"date":"2024-04-19T18:44:00","date_gmt":"2024-04-19T17:44:00","guid":{"rendered":"https:\/\/www.celesteh.com\/blog\/?p=5312"},"modified":"2024-04-19T18:44:01","modified_gmt":"2024-04-19T17:44:01","slug":"octatonic-scales-in-supercollider","status":"publish","type":"post","link":"https:\/\/www.celesteh.com\/blog\/2024\/04\/19\/octatonic-scales-in-supercollider\/","title":{"rendered":"Octatonic Scales in SuperCollider"},"content":{"rendered":"\n<p>You can generate your own Octatonic scale in an arbitrary Equal Temperament using the following code.<\/p>\n\n\n\n<p>Change octaveRatio to the ratio you&#8217;d like and steps to the number of steps. The Scale is saved to the global variable o;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(\n\nvar octaveRatio = 2, steps = 12;\nvar ratio, tuning_arr, tuning, octatonic_arr, octatonicScale, index;\n\nratio = octaveRatio.pow(steps.reciprocal);\n\ntuning_arr = steps.collect({|i| ratio.pow(i).ratiomidi });\ntuning = Tuning(tuning_arr, octaveRatio);\n\nindex = 0;\noctatonic_arr =&#91;];\n\n{index &lt; steps }.while({\n\toctatonic_arr = octatonic_arr.add(index);\n\tindex = index+2;\n\t(index &lt;= steps).if({\n\t\toctatonic_arr = octatonic_arr.add(index);\n\t});\n\tindex = index + 1;\n});\n\n\noctatonicScale = Scale(octatonic_arr, tuning: tuning);\n\no = octatonicScale;\n)\n<\/code><\/pre>\n\n\n\n<p>You can then use this in a Pbind by using \\scale. For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(\nPbind(\n\t\\scale, o,\n\t\\degree, Prand((0..7), 7)\n).play\n)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>You can generate your own Octatonic scale in an arbitrary Equal Temperament using the following code. Change octaveRatio to the ratio you&#8217;d like and steps to the number of steps. The Scale is saved to the global variable o; You can then use this in a Pbind by using \\scale. For example:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"federated","footnotes":""},"categories":[1],"tags":[436,64,166],"class_list":["post-5312","post","type-post","status-publish","format-standard","hentry","category-uncategorised","tag-octatonic","tag-supercollider","tag-tuning"],"_links":{"self":[{"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/posts\/5312","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/comments?post=5312"}],"version-history":[{"count":1,"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/posts\/5312\/revisions"}],"predecessor-version":[{"id":5313,"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/posts\/5312\/revisions\/5313"}],"wp:attachment":[{"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/media?parent=5312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/categories?post=5312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.celesteh.com\/blog\/wp-json\/wp\/v2\/tags?post=5312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}