Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SSAW14 第1回 - Mozziを使ってみる

SSAW14 第1回 - Mozziを使ってみる

Atsushi Tadokoro

April 12, 2014
Tweet

More Decks by Atsushi Tadokoro

Other Decks in Technology

Transcript

  1. #include <MozziGuts.h> #include <Oscil.h> #include <tables/sin2048_int8.h> ! Oscil <2048, AUDIO_RATE>

    aSin(SIN2048_DATA); ! void setup(){ startMozzi(CONTROL_RATE); aSin.setFreq(440); } ! void updateControl(){ } ! int updateAudio(){ return aSin.next(); } ! void loop(){ audioHook(); } .P[[Jϓϩάϥϛϯά ɺ͸͡ΊͷҰา ‣ ԼهͷϓϩάϥϜΛ"SEVJOPʹهೖ
  2. ίϯτϩʔϧͱΦʔσΟΦ ‣ ʮίϯτϩʔϧ৴߸ʯͱʮΦʔσΟΦ৴߸ʯͭͷछྨͷ৴ ߸͕ଘࡏ͢Δ ‣ ༻్ʹԠͯ͡࢖͍Θ͚Δ ! ‣ ίϯτϩʔϧ৴߸ ‣

    Ώͬ͘Γͱͨ͠มԽɺԻྔɺԻఔͷมԽͳͲ ‣ ܭࢉྔ͕গͳ͍ ! ‣ ΦʔσΟΦ৴߸ ‣ ԻΛੜ੒͢Δ೾ܗͷมԽ ‣ ܭࢉྔ͕ଟ͍
  3. ίϯτϩʔϧͱΦʔσΟΦ ‣ ͦΕͧΕͷ৴߸ͷࡉ͔͞͸ɺϓϩάϥϜ಺ͰఆٛͰ͖Δ ! ‣ ίϯτϩʔϧ৴߸ ‣ $0/530-@3"5& ‣ ॳظ஋͸

    ! ‣ ΦʔσΟΦ৴߸ ‣ "6%*0@3"5& ! ‣ ͨͩ͠ɺͲͪΒ΋ͷႈ৐Λࢦఆ͠ͳ͍ͱ͍͚ͳ͍ ‣       ʜ
  4. ! ! ! ‣ ඞཁͳ෦඼ ϔομϑΝΠϧ ΛಡΈࠐΜͰ͍Δ ! ‣ .P[[J(VUTI.P[[JͷίΞػೳ

    ‣ 0TDJMIΦγϨʔλ ‣ UBCMFTTJO@JOUIαΠϯ೾ͷ஋Λςʔϒϧʹอ࣋ #include <MozziGuts.h> #include <Oscil.h> #include <tables/sin2048_int8.h> .P[[Jϓϩάϥϛϯά ɺ͸͡ΊͷҰา
  5. ! ! ‣ αΠϯ೾ͷΦγϨʔλΛఆ͍ٛͯ͠Δ ! ‣ ΦγϨʔλͷαϯϓϧ਺ ‣ "6%*0@3"5&ΦʔσΟΦϨΠτ ‣

    4*/@%"5"TJO@JOUIͰఆٛ͞ΕͨαΠϯ೾ͷ ςʔϒϧͷ஋ Oscil <2048, AUDIO_RATE> aSin(SIN2048_DATA); .P[[Jϓϩάϥϛϯά ɺ͸͡ΊͷҰา
  6. ! ! ! ‣ ॳظઃఆ ! ‣ $0/530-@3"5&  Λࢦఆͯ͠ɺ.P[[JΛ։࢝

    ‣ ΦγϨʔλͷप೾਺Λɺ)[ʹ void setup(){ startMozzi(CONTROL_RATE); aSin.setFreq(440); } .P[[Jϓϩάϥϛϯά ɺ͸͡ΊͷҰา
  7. ! ! ! ‣ ϧʔϓ ‣ ݱࡏͷ.P[[JͰੜ੒͞ΕͨԻΛग़ྗ ‣ BVEJP)PPL Λ༻͍Δ

    void loop(){ audioHook(); } .P[[Jϓϩάϥϛϯά ɺ͸͡ΊͷҰา
  8. .P[[JΫΠζ ‣ ݱࡏͷαϯϓϧϓϩάϥϜΛվ଄ͯ͠ҎԼͷػೳʹ ! ‣ 2 ॳڃ  ‣ ੜ੒͞ΕΔԻͷप೾਺ΛมԽͤ͞Δ

    ‣ )[ )[ )[ʜFUD ! ‣ 2 தڃ  ‣ )[͔Β։࢝ͯ͠ɺঃʑʹप೾਺͕ߴ͘ͳΔ ! ‣ 2 Ԡ༻  ‣ αΠϯ೾ʹɺϏϒϥʔτ ԻఔͷมԽ Λ͚ͭͯΈΔ