{"id":1470,"date":"2018-03-17T00:17:29","date_gmt":"2018-03-16T23:17:29","guid":{"rendered":"http:\/\/yarogniew.net\/arduino\/?p=1470"},"modified":"2018-03-18T00:00:00","modified_gmt":"2018-03-17T23:00:00","slug":"p5js-loadsound","status":"publish","type":"post","link":"https:\/\/arduino.net.pl\/index.php\/p5js-loadsound\/","title":{"rendered":"p5*js loadSound"},"content":{"rendered":"<p><a href=\"https:\/\/yarogniew.github.io\/Sound_testowy\/\">https:\/\/yarogniew.github.io\/Sound_testowy\/<\/a><\/p>\n<pre class=\"brush: plain; light: false; title: Kod:; toolbar: true; notranslate\" title=\"Kod:\">\r\n\r\nvar song;\r\nvar sliderVolume;\r\nvar sliderRate;\r\nvar sliderPan;\r\n\r\nfunction setup() {\r\n  createCanvas(200, 200);\r\n  song = loadSound(&quot;szumy.mp3&quot;, loaded);\r\n\r\n  sliderVolume = createSlider(0, 1, 0.5, 0.01);\r\n  sliderVolume.position(20, 20);\r\n  sliderRate = createSlider(0, 3, 1, 0.01);\r\n  sliderRate.position(20, 50);\r\n  sliderPan = createSlider(-1, 1, 0, 0.01);\r\n  sliderPan.position(20, 80);\r\n}\r\n\r\nfunction loaded(){\r\nsong.play();\r\n}\r\n\r\nfunction draw(){\r\nbackground(random(100,120));\r\n\/\/ console.log(slider.value());\r\nsong.setVolume(sliderVolume.value());\r\nsong.rate(sliderRate.value());\r\nsong.pan(sliderPan.value());\r\n\r\n}\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/yarogniew.github.io\/Sound_testowy\/ var song; var sliderVolume; var sliderRate; var sliderPan; function setup() { createCanvas(200, 200); song = loadSound(&quot;szumy.mp3&quot;, loaded); sliderVolume = createSlider(0, 1, 0.5, 0.01); sliderVolume.position(20, 20); sliderRate = createSlider(0, 3,&#8230;<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[51],"tags":[53,52],"class_list":["post-1470","post","type-post","status-publish","format-standard","hentry","category-javascript","tag-javascript","tag-p5js"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/posts\/1470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/comments?post=1470"}],"version-history":[{"count":3,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/posts\/1470\/revisions"}],"predecessor-version":[{"id":1474,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/posts\/1470\/revisions\/1474"}],"wp:attachment":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/media?parent=1470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/categories?post=1470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/tags?post=1470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}