{"id":1166,"date":"2018-02-21T10:25:07","date_gmt":"2018-02-21T18:25:07","guid":{"rendered":"http:\/\/tre.ucsd.edu\/wordpress\/?p=1166"},"modified":"2018-02-28T10:33:52","modified_gmt":"2018-02-28T18:33:52","slug":"mus271a-max-w7-sampling","status":"publish","type":"post","link":"https:\/\/tre.ucsd.edu\/wp7\/?p=1166","title":{"rendered":"MUS271A (Max w7) &#8211; sampling"},"content":{"rendered":"<p>These patches should get you started with sampling. Not all techniques are shown in my examples, and many things are easier if you use the <strong>groove~<\/strong> object. Also, only a few of my examples are shown in this blog entry.<\/p>\n<p>Download the patches here: <a href=\"https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/05-sampling.zip\">05-sampling<\/a><\/p>\n<hr \/>\n<p><a href=\"https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.08.39-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-1168 size-medium\" src=\"https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.08.39-AM-300x200.png\" alt=\"Screen Shot 2018-02-28 at 9.08.39 AM\" width=\"300\" height=\"200\" srcset=\"https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.08.39-AM-300x200.png 300w, https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.08.39-AM-451x300.png 451w, https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.08.39-AM.png 798w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>1) This first example shows manual playback of a sample by moving a slider to move through the samples. Your slider movement is smoothed out using the <strong>line~<\/strong> object.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p><a href=\"https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.15.47-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-1169 size-medium\" src=\"https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.15.47-AM-300x276.png\" alt=\"Screen Shot 2018-02-28 at 9.15.47 AM\" width=\"300\" height=\"276\" srcset=\"https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.15.47-AM-300x276.png 300w, https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.15.47-AM-326x300.png 326w, https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.15.47-AM.png 700w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>2) In this example, <strong>line~<\/strong> is again used to playback the sample, with the speed of playback controlled by setting the beginning and end playback points and the amount of time to get to the end. Reverse playback is easily achieved this way.<br \/>\nAlso, <strong>sin<\/strong> and <strong>cos<\/strong> are used for crossfading between 2 samples.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p><a href=\"https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.32.56-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-1170 size-medium\" src=\"https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.32.56-AM-300x256.png\" alt=\"Screen Shot 2018-02-28 at 9.32.56 AM\" width=\"300\" height=\"256\" srcset=\"https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.32.56-AM-300x256.png 300w, https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.32.56-AM-351x300.png 351w, https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.32.56-AM.png 574w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>3) An unrefined patch for stutter playback. The <strong>startms<\/strong> number box controls the playback position in the <strong>buffer~.\u00a0<\/strong>The size of the stutter is controlled by the <strong>metro<\/strong> time. Pitch shifting is controlled by <strong>speed ratio.<br \/>\n<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.47.20-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignright wp-image-1171 size-medium\" src=\"https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.47.20-AM-300x195.png\" alt=\"Screen Shot 2018-02-28 at 9.47.20 AM\" width=\"300\" height=\"195\" srcset=\"https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.47.20-AM-300x195.png 300w, https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.47.20-AM-462x300.png 462w, https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.47.20-AM.png 859w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>A slightly more refined stutter playback patch using <strong>trapezoid~<\/strong> to remove clicks on the beginning and end of each segment. Also, pitch can be controlled by MIDI note number with 69 representing normal playback speed.<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.50.50-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-1172 size-medium\" src=\"https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.50.50-AM-300x259.png\" alt=\"Screen Shot 2018-02-28 at 9.50.50 AM\" width=\"300\" height=\"259\" srcset=\"https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.50.50-AM-300x259.png 300w, https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.50.50-AM-348x300.png 348w, https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.50.50-AM.png 624w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>4) A sound file player which uses the <strong>folder<\/strong> object to open all sound files in a folder, and a popup menu to list and select them. A <strong>coll<\/strong>\u00a0object<br \/>\ncould also be used to organize the files.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p><a href=\"https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.56.47-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-1173 size-medium\" src=\"https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.56.47-AM-290x300.png\" alt=\"Screen Shot 2018-02-28 at 9.56.47 AM\" width=\"290\" height=\"300\" srcset=\"https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.56.47-AM-290x300.png 290w, https:\/\/tre.ucsd.edu\/wp7\/wp-content\/uploads\/2018\/02\/Screen-Shot-2018-02-28-at-9.56.47-AM.png 703w\" sizes=\"auto, (max-width: 290px) 100vw, 290px\" \/><\/a><\/p>\n<p>5) OLA (overlap add) sound file playback. This plays the sound in many overlapping segments, with each segment enveloped by a raised cosine window\/envelope. Position and pitch can be controlled independently so that time stretching and pitch shifting are possible. A random offset can be added to each segment\u00a0to avoid repetition.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>These patches should get you started with sampling. Not all techniques are shown in my examples, and many things are easier if you use the groove~ object. Also, only a few of my examples are shown in this blog entry. &hellip; <a href=\"https:\/\/tre.ucsd.edu\/wp7\/?p=1166\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-1166","post","type-post","status-publish","format-standard","hentry","category-music-271a"],"_links":{"self":[{"href":"https:\/\/tre.ucsd.edu\/wp7\/index.php?rest_route=\/wp\/v2\/posts\/1166","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tre.ucsd.edu\/wp7\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tre.ucsd.edu\/wp7\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tre.ucsd.edu\/wp7\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tre.ucsd.edu\/wp7\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1166"}],"version-history":[{"count":4,"href":"https:\/\/tre.ucsd.edu\/wp7\/index.php?rest_route=\/wp\/v2\/posts\/1166\/revisions"}],"predecessor-version":[{"id":1179,"href":"https:\/\/tre.ucsd.edu\/wp7\/index.php?rest_route=\/wp\/v2\/posts\/1166\/revisions\/1179"}],"wp:attachment":[{"href":"https:\/\/tre.ucsd.edu\/wp7\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1166"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tre.ucsd.edu\/wp7\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1166"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tre.ucsd.edu\/wp7\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1166"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}