{"id":10221,"date":"2014-03-11T21:42:58","date_gmt":"2014-03-11T21:42:58","guid":{"rendered":"http:\/\/zerokidz.com\/ideas\/?p=10221"},"modified":"2015-01-10T18:26:00","modified_gmt":"2015-01-10T23:26:00","slug":"changing-the-phase-of-a-waveform","status":"publish","type":"post","link":"https:\/\/reactivemusic.net\/?p=10221","title":{"rendered":"Changing the phase of a waveform"},"content":{"rendered":"<p><cite>From a Max\/MSP tutorial:\u00a0<a href=\"http:\/\/cycling74.com\/docs\/max5\/tutorials\/msp-tut\/mspchapter04.html\">http:\/\/cycling74.com\/docs\/max5\/tutorials\/msp-tut\/mspchapter04.html<\/a>\u00a0at Cycling 74<\/cite><\/p>\n<h4>Changing the phase of a waveform<\/h4>\n<p>For the most part, the phase offset of an isolated audio wave doesn&#8217;t have a substantial effect perceptually. For example, a sine wave in the audio range sounds exactly like a cosine wave, even though there is a theoretical phase difference of a quarter cycle. For that reason, we have not been concerned with the rightmost phase inlet of\u00a0<a href=\"http:\/\/cycling74.com\/docs\/max5\/refpages\/msp-ref\/cycle~.html\">cycle~<\/a>\u00a0until now.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/cycling74.com\/docs\/max5\/tutorials\/msp-tut\/images\/image073.gif\" alt=\"\" \/><\/p>\n<p><em>A sine wave offset by a quarter cycle is a cosine wave<\/em><\/p>\n<p>However, there are some very useful reasons to control the phase offset of a wave. For example, by leaving the frequency of\u00a0<a href=\"http:\/\/cycling74.com\/docs\/max5\/refpages\/msp-ref\/cycle~.html\">cycle~<\/a>\u00a0at 0, and continuously increasing its phase offset, you can change its instantaneous value (just as if it had a positive frequency). The phase offset of a sinusoid is usually referred to in degrees (a full cycle is 360\u00b0) or\u00a0<em>radians<\/em>\u00a0(a full cycle is 2\u03c0 radians). In the\u00a0<a href=\"http:\/\/cycling74.com\/docs\/max5\/refpages\/msp-ref\/cycle~.html\">cycle~<\/a>\u00a0object, phase is referred to in wave cycles; so an offset of \u03c0 radians is\u00a0<a>1<\/a>\/<a>2<\/a>\u00a0cycle, or 0.5. In other words, as the phase varies from 0 to 2\u03c0 radians, it varies from 0 to 1 wave cycles. This way of describing the phase is handy since it allows us to use the common signal range from 0 to 1.<\/p>\n<p>So, if we vary the phase offset of a stationary (0 Hz)\u00a0<a href=\"http:\/\/cycling74.com\/docs\/max5\/refpages\/msp-ref\/cycle~.html\">cycle~<\/a>\u00a0continuously from 0 to 1 over the course of one second, the resulting output is a cosine wave with a frequency of 1 Hz.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/cycling74.com\/docs\/max5\/tutorials\/msp-tut\/images\/image074.gif\" alt=\"\" \/><\/p>\n<p><em>The resulting output is a cosine wave with a frequency of 1 Hz<\/em><\/p>\n<p>Incidentally, this shows us how the\u00a0<a href=\"http:\/\/cycling74.com\/docs\/max5\/refpages\/msp-ref\/phasor~.html\">phasor~<\/a>\u00a0object got its name. It is ideally suited for continuously changing the phase of a\u00a0<a href=\"http:\/\/cycling74.com\/docs\/max5\/refpages\/msp-ref\/cycle~.html\">cycle~<\/a>\u00a0object, because it progresses repeatedly from 0 to 1. If a\u00a0<a href=\"http:\/\/cycling74.com\/docs\/max5\/refpages\/msp-ref\/phasor~.html\">phasor~<\/a>\u00a0is connected to the phase inlet of a 0 Hz\u00a0<a href=\"http:\/\/cycling74.com\/docs\/max5\/refpages\/msp-ref\/cycle~.html\">cycle~<\/a>, the frequency of the\u00a0<a href=\"http:\/\/cycling74.com\/docs\/max5\/refpages\/msp-ref\/phasor~.html\">phasor~<\/a>\u00a0will determine the rate at which the\u00a0<a href=\"http:\/\/cycling74.com\/docs\/max5\/refpages\/msp-ref\/cycle~.html\">cycle~<\/a>\u00a0object&#8217;s waveform is traversed, thus determining the effective frequency of the<a href=\"http:\/\/cycling74.com\/docs\/max5\/refpages\/msp-ref\/cycle~.html\">cycle~<\/a>.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/cycling74.com\/docs\/max5\/tutorials\/msp-tut\/images\/image075.gif\" alt=\"\" \/><\/p>\n<p><em>The effective frequency of the 0 Hz cycle~ is equal to the rate of the phasor~<\/em><\/p>\n<p>The important point demonstrated by the tutorial patch, however, is that the phase inlet can be used to read through the 512 samples of\u00a0<a href=\"http:\/\/cycling74.com\/docs\/max5\/refpages\/msp-ref\/cycle~.html\">cycle~<\/a>\u00a0object&#8217;s waveform at any desired rate. (In fact, the contents of\u00a0<a href=\"http:\/\/cycling74.com\/docs\/max5\/refpages\/msp-ref\/cycle~.html\">cycle~<\/a>\u00a0can be scanned at will with any value in the range 0 to 1.) In this case,\u00a0<a href=\"http:\/\/cycling74.com\/docs\/max5\/refpages\/msp-ref\/line~.html\">line~<\/a>\u00a0is used to change the phase of\u00a0<a href=\"http:\/\/cycling74.com\/docs\/max5\/refpages\/msp-ref\/cycle~.html\">cycle~<\/a>\u00a0from .75 to 1.75 over the course of 10 seconds.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/cycling74.com\/docs\/max5\/tutorials\/msp-tut\/images\/image076.gif\" alt=\"\" \/><\/p>\n<p>The result is one cycle of a sine wave. The sine wave is multiplied by a \u2018depth\u2019 factor to scale its amplitude up to 8. This sub-audio sine wave, varying slowly from 0 up to 8, down to -8 and back to 0, is added to the frequency of Oscillator B. This causes the frequency of Oscillator B to fluctuate very slowly between 1008 Hz and 992 Hz.<\/p>\n<p>\u2022 Click on the\u00a0<a href=\"http:\/\/cycling74.com\/docs\/max5\/refpages\/max-ref\/message.html\">message<\/a>\u00a0box in the lower-left part of the window, and notice how the beat frequency varies sinusoidally over the course of 10 seconds, from 0 Hz up to 8 Hz (as the frequency of Oscillator B approaches 1008 Hz), back to 0 Hz, back up to 8 Hz (as the frequency of Oscillator B approaches 992 Hz), and back to 0 Hz.<\/p>\n<div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>From a Max\/MSP tutorial:\u00a0http:\/\/cycling74.com\/docs\/max5\/tutorials\/msp-tut\/mspchapter04.html\u00a0at Cycling 74 Changing the phase of a waveform For the most part, the phase offset of an isolated audio wave doesn&#8217;t have a substantial effect perceptually. For example, a sine wave in the audio range sounds exactly like a cosine wave, even though there is a theoretical phase difference of a &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/reactivemusic.net\/?p=10221\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Changing the phase of a waveform&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","footnotes":""},"categories":[21,28],"tags":[],"class_list":["post-10221","post","type-post","status-publish","format-standard","hentry","category-dsp","category-maxmsp"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Changing the phase of a waveform - reactive music<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/reactivemusic.net\/?p=10221\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Changing the phase of a waveform - reactive music\" \/>\n<meta property=\"og:description\" content=\"From a Max\/MSP tutorial:\u00a0http:\/\/cycling74.com\/docs\/max5\/tutorials\/msp-tut\/mspchapter04.html\u00a0at Cycling 74 Changing the phase of a waveform For the most part, the phase offset of an isolated audio wave doesn&#8217;t have a substantial effect perceptually. For example, a sine wave in the audio range sounds exactly like a cosine wave, even though there is a theoretical phase difference of a &hellip; Continue reading &quot;Changing the phase of a waveform&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/reactivemusic.net\/?p=10221\" \/>\n<meta property=\"og:site_name\" content=\"reactive music\" \/>\n<meta property=\"article:published_time\" content=\"2014-03-11T21:42:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-01-10T23:26:00+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/cycling74.com\/docs\/max5\/tutorials\/msp-tut\/images\/image073.gif\" \/>\n<meta name=\"author\" content=\"Tom Zicarelli\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tom Zicarelli\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=10221#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=10221\"},\"author\":{\"name\":\"Tom Zicarelli\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#\\\/schema\\\/person\\\/56224d281582df7e5518e037ca63e571\"},\"headline\":\"Changing the phase of a waveform\",\"datePublished\":\"2014-03-11T21:42:58+00:00\",\"dateModified\":\"2015-01-10T23:26:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=10221\"},\"wordCount\":540,\"image\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=10221#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/cycling74.com\\\/docs\\\/max5\\\/tutorials\\\/msp-tut\\\/images\\\/image073.gif\",\"articleSection\":[\"DSP\",\"Max\\\/MSP\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=10221\",\"url\":\"https:\\\/\\\/reactivemusic.net\\\/?p=10221\",\"name\":\"Changing the phase of a waveform - reactive music\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=10221#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=10221#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/cycling74.com\\\/docs\\\/max5\\\/tutorials\\\/msp-tut\\\/images\\\/image073.gif\",\"datePublished\":\"2014-03-11T21:42:58+00:00\",\"dateModified\":\"2015-01-10T23:26:00+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#\\\/schema\\\/person\\\/56224d281582df7e5518e037ca63e571\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=10221#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/reactivemusic.net\\\/?p=10221\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=10221#primaryimage\",\"url\":\"http:\\\/\\\/cycling74.com\\\/docs\\\/max5\\\/tutorials\\\/msp-tut\\\/images\\\/image073.gif\",\"contentUrl\":\"http:\\\/\\\/cycling74.com\\\/docs\\\/max5\\\/tutorials\\\/msp-tut\\\/images\\\/image073.gif\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/?p=10221#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/reactivemusic.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Changing the phase of a waveform\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#website\",\"url\":\"https:\\\/\\\/reactivemusic.net\\\/\",\"name\":\"reactive music\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/reactivemusic.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/reactivemusic.net\\\/#\\\/schema\\\/person\\\/56224d281582df7e5518e037ca63e571\",\"name\":\"Tom Zicarelli\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g\",\"caption\":\"Tom Zicarelli\"},\"sameAs\":[\"http:\\\/\\\/tomzicarelli.com\"],\"url\":\"https:\\\/\\\/reactivemusic.net\\\/?author=2\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Changing the phase of a waveform - reactive music","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/reactivemusic.net\/?p=10221","og_locale":"en_US","og_type":"article","og_title":"Changing the phase of a waveform - reactive music","og_description":"From a Max\/MSP tutorial:\u00a0http:\/\/cycling74.com\/docs\/max5\/tutorials\/msp-tut\/mspchapter04.html\u00a0at Cycling 74 Changing the phase of a waveform For the most part, the phase offset of an isolated audio wave doesn&#8217;t have a substantial effect perceptually. For example, a sine wave in the audio range sounds exactly like a cosine wave, even though there is a theoretical phase difference of a &hellip; Continue reading \"Changing the phase of a waveform\"","og_url":"https:\/\/reactivemusic.net\/?p=10221","og_site_name":"reactive music","article_published_time":"2014-03-11T21:42:58+00:00","article_modified_time":"2015-01-10T23:26:00+00:00","og_image":[{"url":"http:\/\/cycling74.com\/docs\/max5\/tutorials\/msp-tut\/images\/image073.gif","type":"","width":"","height":""}],"author":"Tom Zicarelli","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tom Zicarelli","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/reactivemusic.net\/?p=10221#article","isPartOf":{"@id":"https:\/\/reactivemusic.net\/?p=10221"},"author":{"name":"Tom Zicarelli","@id":"https:\/\/reactivemusic.net\/#\/schema\/person\/56224d281582df7e5518e037ca63e571"},"headline":"Changing the phase of a waveform","datePublished":"2014-03-11T21:42:58+00:00","dateModified":"2015-01-10T23:26:00+00:00","mainEntityOfPage":{"@id":"https:\/\/reactivemusic.net\/?p=10221"},"wordCount":540,"image":{"@id":"https:\/\/reactivemusic.net\/?p=10221#primaryimage"},"thumbnailUrl":"http:\/\/cycling74.com\/docs\/max5\/tutorials\/msp-tut\/images\/image073.gif","articleSection":["DSP","Max\/MSP"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/reactivemusic.net\/?p=10221","url":"https:\/\/reactivemusic.net\/?p=10221","name":"Changing the phase of a waveform - reactive music","isPartOf":{"@id":"https:\/\/reactivemusic.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/reactivemusic.net\/?p=10221#primaryimage"},"image":{"@id":"https:\/\/reactivemusic.net\/?p=10221#primaryimage"},"thumbnailUrl":"http:\/\/cycling74.com\/docs\/max5\/tutorials\/msp-tut\/images\/image073.gif","datePublished":"2014-03-11T21:42:58+00:00","dateModified":"2015-01-10T23:26:00+00:00","author":{"@id":"https:\/\/reactivemusic.net\/#\/schema\/person\/56224d281582df7e5518e037ca63e571"},"breadcrumb":{"@id":"https:\/\/reactivemusic.net\/?p=10221#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/reactivemusic.net\/?p=10221"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/reactivemusic.net\/?p=10221#primaryimage","url":"http:\/\/cycling74.com\/docs\/max5\/tutorials\/msp-tut\/images\/image073.gif","contentUrl":"http:\/\/cycling74.com\/docs\/max5\/tutorials\/msp-tut\/images\/image073.gif"},{"@type":"BreadcrumbList","@id":"https:\/\/reactivemusic.net\/?p=10221#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/reactivemusic.net\/"},{"@type":"ListItem","position":2,"name":"Changing the phase of a waveform"}]},{"@type":"WebSite","@id":"https:\/\/reactivemusic.net\/#website","url":"https:\/\/reactivemusic.net\/","name":"reactive music","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/reactivemusic.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/reactivemusic.net\/#\/schema\/person\/56224d281582df7e5518e037ca63e571","name":"Tom Zicarelli","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0da58cf21a2707dd335b204b8ed3cd9194dcbf9d9814ac5d71195a65c76c8a72?s=96&d=mm&r=g","caption":"Tom Zicarelli"},"sameAs":["http:\/\/tomzicarelli.com"],"url":"https:\/\/reactivemusic.net\/?author=2"}]}},"_links":{"self":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts\/10221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10221"}],"version-history":[{"count":4,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts\/10221\/revisions"}],"predecessor-version":[{"id":18131,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=\/wp\/v2\/posts\/10221\/revisions\/18131"}],"wp:attachment":[{"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/reactivemusic.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}