{"id":1297,"date":"2018-02-26T17:23:17","date_gmt":"2018-02-26T16:23:17","guid":{"rendered":"http:\/\/yarogniew.net\/arduino\/?page_id=1297"},"modified":"2018-02-26T20:44:24","modified_gmt":"2018-02-26T19:44:24","slug":"minim-library","status":"publish","type":"page","link":"https:\/\/arduino.net.pl\/index.php\/processing\/processing-sound-library\/minim-library\/","title":{"rendered":"Biblioteka Minim"},"content":{"rendered":"<p>\u22a5 \u0179r\u00f3d\u0142o:\u00a0http:\/\/code.compartmental.net\/tools\/minim\/<\/p>\n<blockquote class=\"wp-embedded-content\" data-secret=\"aLNm2mBcQc\"><p><a href=\"http:\/\/code.compartmental.net\/tools\/minim\/quickstart\/\">Quickstart Guide<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/code.compartmental.net\/tools\/minim\/quickstart\/embed\/#?secret=aLNm2mBcQc\" data-secret=\"aLNm2mBcQc\" width=\"600\" height=\"338\" title=\"&#8220;Quickstart Guide&#8221; &#8212; Compartmental\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>Minim 2.2.2 Damien Di Fede and Anderson Mills<br \/>\nAn audio library that provides easy to use classes for playback, recording, analysis, and synthesis of sound.<\/p>\n<pre class=\"brush: plain; light: false; title: Kod:; toolbar: true; notranslate\" title=\"Kod:\">\r\n\r\n\/** \r\n  * This sketch demonstrates how to use &lt;code&gt;setLoopPoints&lt;\/code&gt;\r\n  * using an &lt;code&gt;AudioPlayer&lt;\/code&gt;. Left-click with the mouse\r\n  * to set the start point of the loop and right-click to set the\r\n  * end point of the loop. You will likely find\r\n  * there to be a break during loops while the code seeks from the \r\n  * beginning of the file to the start of the loop. This seek time\r\n  * can become quite noticable if you are using an mp3 file \r\n  * because it will need to decode as it seeks.\r\n  *\/\r\n\r\nimport ddf.minim.*;\r\n\r\nMinim minim;\r\nAudioPlayer snip;\r\n\r\nint loopBegin;\r\nint loopEnd;\r\n\r\nvoid setup()\r\n{\r\n  size(512, 200, P3D);\r\n  minim = new Minim(this);\r\n  snip = minim.loadFile(&quot;AC_120_RMXFILL.WAV&quot;);\r\n  textFont(loadFont(&quot;ArialMT-14.vlw&quot;));\r\n}\r\n\r\nvoid draw()\r\n{\r\n  background(0);\r\n  fill(255);  \r\n    stroke(255);\r\n    line(0, height\/2+20, width, height\/2+20);\r\n\r\n  text(&quot;Loop Count: &quot; + snip.loopCount(), 5, 20);\r\n  text(&quot;Looping: &quot; + snip.isLooping(), 5, 40);\r\n  text(&quot;Playing: &quot; + snip.isPlaying(), 5, 60);\r\n  int p = snip.position();\r\n  int l = snip.length();\r\n  text(&quot;Position: &quot; + p, 5, 80);\r\n  text(&quot;Length: &quot; + l, 5, 100);\r\n  float x = map(p, 0, l, 0, width);\r\n  stroke(255);\r\n  line(x, height\/2 - 50, x, height\/2 + 50);\r\n  float lbx = map(loopBegin, 0, snip.length(), 0, width);\r\n  float lex = map(loopEnd, 0, snip.length(), 0, width);\r\n  stroke(0, 255, 0);\r\n  line(lbx, 0, lbx, height);\r\n  stroke(255, 0, 0);\r\n  line(lex, 0, lex, height);\r\n}\r\n\r\nvoid mousePressed()\r\n{\r\n  int ms = (int)map(mouseX, 0, width, 0, snip.length());\r\n  if ( mouseButton == RIGHT )\r\n  {\r\n    snip.setLoopPoints(loopBegin, ms);\r\n    loopEnd = ms;\r\n  }\r\n  else\r\n  {\r\n    snip.setLoopPoints(ms, loopEnd);\r\n    loopBegin = ms;\r\n  }\r\n}\r\n\r\nvoid keyPressed()\r\n{\r\n  snip.loop();\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u22a5 \u0179r\u00f3d\u0142o:\u00a0http:\/\/code.compartmental.net\/tools\/minim\/ Quickstart Guide Minim 2.2.2 Damien Di Fede and Anderson Mills An audio library that provides easy to use classes for playback, recording, analysis, and synthesis of sound. \/**&#8230;<\/p>\n","protected":false},"author":3,"featured_media":0,"parent":1281,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-1297","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/pages\/1297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/types\/page"}],"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=1297"}],"version-history":[{"count":8,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/pages\/1297\/revisions"}],"predecessor-version":[{"id":1315,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/pages\/1297\/revisions\/1315"}],"up":[{"embeddable":true,"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/pages\/1281"}],"wp:attachment":[{"href":"https:\/\/arduino.net.pl\/index.php\/wp-json\/wp\/v2\/media?parent=1297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}