This .md is translation into Japanese a very good tutorial book "A Gentle Introduction to SuperCollider (2nd edition)" published by Bruno Ruviaro. (Work In Progress)
You can see the original book file here. https://github.com/brunoruviaro/A_Gentle_Introduction_To_SuperCollider
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-sa/4.0/deed.jaãã«ãŒãã»ã«ãŽã£ã¢ãŒã
翻蚳ããããšã»ãã ãª
ãã®äœåã¯ãCreative Commons Attribution-ShareAlike 4.0 International Licenseã®äžã§ã©ã€ã»ã³ã¹ãããŠããŸãããã®ã©ã€ã»ã³ã¹ã®ã³ããŒã衚瀺ããã«ã¯ã次ãã芧ãã ããã
http://creativecommons.org/licenses/by-sa/4.0/
First published in 2014. This revision is from November 20, 2015.
[TOC]
SuperColliderã®åªãã玹ä»
ãã«ãŒãã»ã«ãŽã£ã¢ãŒã
2015幎11æ20æ¥
æåã® SuperCollider ããã°ã©ã ãäœæããæºåã¯ã§ããŸãããïŒ SCã皌åããŠãããšä»®å®ããŸãã
ããªãã®åã§ãæ°ããããã¥ã¡ã³ããéã(menu FileâNew, ãããã¯ã·ã§ãŒãã«ãã [ctrl+N]) ã次ã®è¡ãå ¥åããŸãã
"Hello World".postln;
ãã®è¡ã®ä»»æã®å Žæã«ã«ãŒãœã«ã眮ããŸã(éå§ãäžéãçµäºã®ãããã§ãããŸããŸãã)ã[ctrl + Enter]ãæŒããŠã³ãŒããè©äŸ¡ããŸããâHello worldâ ãPost ãŠã£ã³ããŠã«è¡šç€ºãããŸããããã§ãšãããããŸãïŒãããããªãã®ã¯ãããŠã® SuperCollider ããã°ã©ã ã§ããã
å³1ïŒSuperCollider IDEã€ã³ã¿ãŒãã§ãŒã¹ã
ãã³ãïŒ |
---|
ãã®ããã¥ã¡ã³ãå šäœãéããŠãctrl(ã³ã³ãããŒã«)ã¯ãLinuxããã³Windowsãã©ãããã©ãŒã ã§äœ¿çšãããããŒããŒãã·ã§ãŒãã«ããã®modifierããŒã瀺ããŸããMac OSXã§ã¯ã代ããã«cmd(ã³ãã³ã)ã䜿çšããŸãã |
å³1ã¯ãæåã«SuperCollider IDE(çµ±åéçºç°å¢)ãéãããšãã®ã¹ã¯ãªãŒã³ã·ã§ããã§ããå°ãæéããããŠç解ããŠãããŸãããã
SuperCollider IDEãšã¯äœã§ããïŒ ããã¯ã"SuperColliderå°çšã«éçºãããã¯ãã¹ãã©ãããã©ãŒã ã®ã³ãŒãã£ã³ã°ç°å¢(...)ã§ããã䜿ãããããçµéšè±å¯ãªã³ãŒããŒåãã®åŒ·åãªæ©èœãæ£ãã°ããããŠããŸãããŸããéåžžã«ã«ã¹ã¿ãã€ãºå¯èœã§ããããã¯Mac OSXãLinuxãWindowsã§ãåæ§ã«åäœããŸãã" *
SCãŠã£ã³ããŠã«è¡šç€ºãããäž»ãªéšåã¯ãã³ãŒããšãã£ã¿ãŒããã«ããã©ãŠã¶ãŒãããã³Post ãŠã£ã³ããŠã§ããSuperColliderãéãããšãã«ãããã®ãããã衚瀺ãããªãå Žåã¯ãã¡ãã¥ãŒã«ç§»åããŸãã
ViewâDocklets (ããããåããã¯ã¬ããã衚瀺ãŸãã¯é衚瀺ã«ã§ããŸã)ãã¹ããŒã¿ã¹ããŒããããåžžã«ãŠã£ã³ããŠã®å³äžé ã«ãããŸããããã«ããªã³ããããŠãããã®ãã¹ãŠããŸã ç解ããŠããªãå Žåã§ããåžžã« Post ãŠã£ã³ããŠã衚瀺ãããŸãŸã«ããŸããPost ãŠã£ã³ããŠã«ã¯ãã³ãã³ãã«å¯Ÿããããã°ã©ã ã®å¿ç(ã³ãŒãè©äŸ¡ã®çµæãããŸããŸãªéç¥ãèŠåããšã©ãŒãªã©)ã衚瀺ãããŸãã
ãã³ãïŒ |
---|
ã·ã§ãŒãã«ãã [Ctrl ++] ããã³ [Ctrl +-] ã§ãšãã£ã¿ãŒã®ãã©ã³ããµã€ãºãäžæçã«æ¡å€§ããã³çž®å°ã§ããŸã(ããããã³ã³ãããŒã«ããŒãšãã©ã¹ããŒãŸãã¯ãã€ãã¹ããŒ)ãå®éã®ãã©ã¹ããŒãæããªãã©ãããããã䜿çšããŠããå Žåã¯ã[Ctrl + shift + =] ã䜿çšããŸãã |
ã¹ããŒã¿ã¹ããŒã«ã¯ã" Interpreter "ãš"Server"ãšããèšèã衚瀺ãããŸããInterpreterã¯ããã©ã«ãã§ãªã³("Active")ã«ãªãã"Server"ã¯ãªãã«ãªããŸã(ãã¹ãŠãŒããæå³ããŸã)ãInterpreterãšã¯äœã§ããïŒServerãšã¯äœã§ããïŒ
SuperCollider ã¯å®éã«ã¯ããµãŒããŒãšèšèªã®2ã€ã®ç°ãªãã¢ããªã±ãŒã·ã§ã³ã§æ§æãããŠããŸãããµãŒããŒã¯ãé³ãåºã責任ããããŸããèšèª(ã¯ã©ã€ã¢ã³ããŸãã¯ã€ã³ã¿ãŒããªã¿ãŒãšãåŒã°ãã)ã¯ããµãŒããŒã®å¶åŸ¡ã«äœ¿çšãããŸããæå㯠scsynth(SC-synthesizer) ãšåŒã°ãã2çªç®ã¯ sclang(SC-language) ãšåŒã°ããŸããã¹ããŒã¿ã¹ããŒã«ã¯ãããã2ã€ã®ã³ã³ããŒãã³ãã®ã¹ããŒã¿ã¹(ãªã³/ãªã)ã衚瀺ãããŸãã
*SuperCollider ããã¥ã¡ã³ãããåŒçšïŒhttp://doc.sccode.org/Guides/SCIde.html IDEã€ã³ã¿ãŒãã§ãŒã¹ã®è©³çŽ°ã«ã€ããŠã¯ããã®ããŒãžãã芧ãã ããã
ãã®åºå¥ãä»ããªãã«ãšã£ãŠããŸãæå³ããªããªãå Žåã§ãå¿é ããªãã§ãã ããããã®æç¹ã§ç¥ã£ãŠããå¿ èŠããã2ã€ã®äž»ãªãã®ã¯æ¬¡ã®ãšããã§ãã
-
SuperCollider ã«å ¥åãããã¹ãŠã®ãã®ã¯ãSuperCollider èšèª(ã¯ã©ã€ã¢ã³ã)ã§äœæãããŸããããã§ã³ãã³ããèšè¿°ããã³å®è¡ããPostãŠã£ã³ããŠã«çµæã衚瀺ããŸãã
-
SuperCollider ã§ãµãŠã³ããçæãããã®ã¯ãã¹ãŠããµãŒããŒããéãããŸããã€ãŸããããã°"ãµãŠã³ããšã³ãžã³"ã§ããããªãã«ãã£ãŠ SuperCollider èšèªãéããŠã³ã³ãããŒã«ãããŸãã
"Hello World"ããã°ã©ã ã¯é³ãåºããŸããã§ããããã¹ãŠã¯èšèªã§è¡ããããµãŒããŒã¯ãŸã£ãã䜿çšãããŸããã§ããã次ã®äŸã§ã¯é³ãåºãŸãã®ã§ããµãŒããŒã皌åããŠããããšã確èªããå¿ èŠããããŸãã
ãµãŒããŒãèµ·åããæãç°¡åãªæ¹æ³ã¯ãã·ã§ãŒãã«ãã [ctrl + B] ã䜿çšããããšã§ãããŸãã¯ãã¹ããŒã¿ã¹ããŒã®ãŒããã¯ãªãã¯ããããšãã§ããŸããã¡ãã¥ãŒããããã¢ãããããªãã·ã§ã³ã®1ã€ã"Boot Server"ã§ãããµãŒããŒãèµ·åãããšãPost ãŠã£ã³ããŠã«ã¢ã¯ãã£ããã£ã衚瀺ãããŸãããµãŒããŒãæ£åžžã«èµ·åãããšãã¹ããŒã¿ã¹ããŒã®æ°åãç·è²ã«å€ãããŸããSCãèµ·åãããã³ã«ãããè¡ãå¿ èŠããããŸãããã»ãã·ã§ã³ããšã«1åã ãã§ãã
"Hello World" ã¯äŒçµ±çã«ãæ°ããããã°ã©ãã³ã°èšèªãåŠã¶ãšãã«äººã ãäœæããæåã®ããã°ã©ã ã§ããSuperCollider ã§æ¢ã«ãããè¡ã£ãŠããŸãã
åçŽãªæ£åŒŠæ³¢ã®äœæã¯ãã³ã³ãã¥ãŒã¿ãŒé³æ¥œèšèªã® "Hello World" ãããããŸãããããã«ãžã£ã³ãããŸãããã次ã®ã³ãŒãè¡ãå ¥åããŠè©äŸ¡ããŸãã泚æããŠãã ããããã¯å€§ããªé³ã«ãªãå ŽåããããŸããããªã¥ãŒã ãå®å šã«äžããã©ã€ã³ãè©äŸ¡ããŠããããã£ããããªã¥ãŒã ãäžããŸãã
{SinOsc.ar}.play;
ããã¯çŸãããæ»ããã§ãé£ç¶çã§ãããããå°ãéå±ãªãµã€ã³æ³¢ã§ãã[ctrl +.]ã§ãµãŠã³ããåæ¢ã§ããŸã(ã³ã³ãããŒã«ããŒãšããªãªãããŒã§ã)ããã®ããŒã®çµã¿åãããèŠããŠãããŠãã ãããSCã®ãã¹ãŠã®ãµãŠã³ããåæ¢ããããã«é »ç¹ã«äœ¿çšããããã§ãã次ã«ããã®æ£åŒŠæ³¢ãããå°ãé¢çœãããŸãããããããå ¥åããŠãã ããïŒ
{SinOsc.ar(LFNoise0.kr(10).range(500, 1500), mul: 0.1)}.play;
è¡å ã®ä»»æã®å Žæã«ã«ãŒãœã«ã眮ããŠã[ctrl + Enter]ã æŒãã ãã§è©äŸ¡ã§ããŸãããŸãã¯ãè©äŸ¡ããåã«è¡å šäœãéžæããããšãã§ããŸãã
ãã³ãïŒ |
---|
ã³ãŒãäŸãèªåã§å ¥åããããšã¯ãåªããåŠç¿ããŒã«ã§ããèªä¿¡ãã€ããèšèªã«æ £ããã®ã«åœ¹ç«ã¡ãŸããããžã¿ã«åœ¢åŒã®ãã¥ãŒããªã¢ã«ãèªããšãããµã³ãã«ããçãã³ãŒãã¹ãããããã³ããŒããŠè²Œãä»ããããšæããããããŸãããããã§åé¡ãããŸããããèªåã§å ¥åããã°ãã£ãšåŠç¿ã§ããŸããå°ãªããšãSCåŠç¿ã®æåã®æ®µéã§è©ŠããŠã¿ãŠãã ããã |
æåŸã®äŸãè©äŸ¡ããŠãé³ãããŸãããïŒ ãã®å Žåãã³ãŒãã«ã¿ã€ããã¹ããã£ãå¯èœæ§ããããŸããééã£ãæåãã«ã³ããæ¬åŒ§ã®æ¬ èœãªã©ã§ããã³ãŒãã«åé¡ãçºçãããšãPost ãŠã£ã³ããŠã«ãšã©ãŒã¡ãã»ãŒãžã衚瀺ãããŸãããšã©ãŒã¡ãã»ãŒãžã¯é·ããŠäžå¯è§£ãªããšããããŸããããããã¯ã«ãªããªãã§ãã ãããæéã®çµéãšãšãã«ãšã©ãŒã¡ãã»ãŒãžã®èªã¿æ¹ãåŠã³ãŸããçããšã©ãŒã¡ãã»ãŒãžã¯æ¬¡ã®ããã«ãªããŸãã
ERROR: Class not defined.
in file âselected textâ
line 1 char 19:
{SinOsc.ar(LFNoiseO.kr(12).range(400, 1600), mul: 0.01)}.play;
-----------------------------------
nil
ãã®ãšã©ãŒã¡ãã»ãŒãžã¯ã"ã¯ã©ã¹ãå®çŸ©ãããŠããŸãã"ãšè¡šç€ºããããšã©ãŒã®ããããã®å Žæ("è¡1æå19")ãæããŸããSCã®ã¯ã©ã¹ã¯ã倧æåã§å§ãŸãéãåèªïŒSinOsc ã LFNoise0 ãªã©ïŒã§ãããã®ãšã©ãŒã¯ããŠãŒã¶ãŒãæåŸã«å€§æåã®"O"ãä»ã㊠LFNoiseO ãå ¥åããããšãåå ã§ããããšãããããŸãããæ£ããã¯ã©ã¹ã¯ LFNoise0 ã§ãæ«å°Ÿã«æ°åã®ãŒãããããŸããã芧ã®ãšããã现éšãžã®æ³šæãéèŠã§ãã
ã³ãŒãã«ãšã©ãŒãããå Žåã¯ãæ ¡æ£ããŠãå¿ èŠã«å¿ããŠå€æŽããä¿®æ£ããããŸã§åè©Šè¡ããŠãã ãããæåã«ãšã©ãŒãçºçããŠããªãã£ãå Žåã¯ããšã©ãŒã¡ãã»ãŒãžãã©ã®ããã«è¡šç€ºããããã確èªã§ããããã«ãä»ããå°å ¥ããŠã¿ãŠãã ãã(ããšãã°ãã³ã³ããåé€ããŸã)ã
ãã³ãïŒ |
---|
SuperCollider ã®åŠç¿ã¯ããã€ãèªããã«ãã¬ã«èªãæ¥æ¬èªãªã©ã®å¥ã®èšèªãåŠç¿ãããããªãã®ã§ãããã®ãŸãŸè©±ãããšããèªåœãå¢ãããææ³ãšæ§æã«æ³šæãæããééãããåŠã³ãŸããããããã§èµ·ããåŸãææªã®äºæ ã¯ãSuperCollider ãã¯ã©ãã·ã¥ãããããšã§ãããµã³ããŠãã§ééã£ããã¹ã«ä¹ãã»ã©æªãã¯ãããŸããããéé ã®èŠæ±ã誀解ãããŠããŸãã |
SuperCollider Bookã®æåã®ç« ããæ¹äœãããçŽ æŽãããäŸããããŸãã*åã®äŸãšåæ§ã«ããã¹ãŠãç解ããããšããŠå¿é ããå¿ èŠã¯ãããŸãããé³ã®çµæã楜ããã§ãæ°åã§éãã§ãã ããã
{RLPF.ar(Dust.ar([12, 15]), LFNoise1.ar([0.3, 0.2]).range(100, 3000), 0.02)}.play;
ãµãŠã³ããåæ¢ããããã€ãã®æ°å€ãå€æŽããŠãããäžåºŠè©äŸ¡ããŠãã ãããããšãã°ãæ°å12ãš15ã1ãš5ã®éã®å°ããæ°åã«çœ®ãæãããšã©ããªããŸããïŒ LFNoise1 ã®åŸã0.3ãš0.2ã®ä»£ããã«1ãš2ã®ãããªãã®ãè©ŠããŠã¿ããã©ãã§ããããïŒ äžåºŠã«1ã€ãã€å€æŽããŸããæ°ãããµãŠã³ãã以åã®ãµãŠã³ããšæ¯èŒããéããèããŠãã ãããäœãäœãæ¯é ããŠããããç解ã§ãããã©ããã確èªããŠãã ãããããã¯ãSuperCollider ãæ¢çŽ¢ãã楜ããæ¹æ³ã§ããäœãé¢çœããã®ãäœæããã³ãŒãã¹ãããããååŸãããã©ã¡ãŒã¿ãŒãããã£ãŠããªãšãŒã·ã§ã³ãäœæããŸãããã¹ãŠã®æ°åã®åœ¹å²ãå®å šã«ç解ããŠããªããŠããèå³æ·±ãé³ã®çµæãèŠã€ããããšãã§ããŸãã
ãã³ãïŒ |
---|
ä»ã®ãœãããŠã§ã¢ãšåæ§ã«ã[ctrl + S]ã䜿çšããŠäœæ¥å 容ãé »ç¹ã«ä¿åããŠãã ããããã®ãããªãã¥ãŒããªã¢ã«ã§äœæ¥ããå ŽåãæäŸãããŠãããµã³ãã«ã䜿çšããŠå®éšããããšã§ãèå³æ·±ããµãŠã³ããæãã€ãããšããããããŸãã奜ããªãã®ãæ®ãããå Žåã¯ãã³ãŒããæ°ããããã¥ã¡ã³ãã«ã³ããŒããŠä¿åããŸãããã¹ãŠã® SuperCollider ãã¡ã€ã«ã«ã¯ã"SuperCollider Document"ãè¡šãæ¡åŒµå.scdããããŸãã |
*Wilson,S.ãšCottle,D.ãšCollinsãN.(ç·šéè )ãSuperCollider Book,MIT Press,2011,p. 5.
ãã¥ãŒããªã¢ã«ã®ããã€ãã®å 容ã¯ãSuperCollider Book ã®æåã®ç« ã§ããDavid Cottle ã®åªãã"Beginnerâs Tutorial"ããåçšãæ¹äœããŸãã¯ã€ã³ã¹ãã¬ãŒã·ã§ã³ãåããŠããŸãããã®ãã¥ãŒããªã¢ã«ã§ã¯ãCottle ã®ç« ããããã€ãã®äŸãšèª¬æãåçšããŸããããããšã¯ç°ãªããã³ã³ãã¥ãŒã¿ãŒé³æ¥œãžã®é²åºãå°ãªããšæ³å®ããæè²çã¢ãããŒãã®ããã¯ããŒã³ãšããŠãã¿ãŒã³ãã¡ããªãŒã玹ä»ããŸãã
ã³ãŒãå ã®èµ€è²ã§è¡šç€ºãããããã¹ãã¯ãã¹ãŠã³ã¡ã³ãã§ããããã°ã©ãã³ã°èšèªãåããŠäœ¿çšããå Žåãã³ã¡ã³ãã¯ãèªåèªèº«ãšåŸã§èªãå¿ èŠã®ãã人ã«ãšã£ãŠãã³ãŒããææžåããã®ã«éåžžã«äŸ¿å©ãªæ¹æ³ã§ããäºéã¹ã©ãã·ã¥ã§å§ãŸãè¡ã¯ã³ã¡ã³ãã§ããæå¹ãªã³ãŒãè¡ã®çŽåŸã«ã³ã¡ã³ããæžãããšãã§ããŸããè©äŸ¡ã®éãã³ã¡ã³ãéšåã¯ç¡èŠãããŸããSCã§ã¯ãã»ãã³ãã³ã䜿çšããŠæå¹ãªã¹ããŒãã¡ã³ãã®çµããã瀺ããŸãã
2 + 5 + 10 â 5; // ãã èšç®ããã ã
rrand(10, 20); // 10~20ã®ä¹±æ°ãçæããŸã
ã«ãŒãœã«ããã®è¡ã®åŸã®ã³ã¡ã³ãã®éäžã«ããå Žåã§ããè¡ãè©äŸ¡ã§ããŸããã³ã¡ã³ãéšåã¯ç¡èŠãããŸãã次ã®2ã€ã®æ®µèœã¯ãäŸã®ããã ãã«"ã³ã¡ã³ã"ãšããŠèšè¿°ãããŸãã
//ã·ã§ãŒãã«ãã[ctrl + /]ã䜿çšããŠã1è¡ã®ã³ãŒãããã°ããã³ã¡ã³ãã¢ãŠãã§ããŸãã
"Some SC code here...".postln;
2 + 2;
//æ¬åœã«é·ãã³ã¡ã³ããæžããšãããã¹ãã¯ãäºéã¹ã©ãã·ã¥ã§*éå§*ãããªãæ°ããè¡ã®ããã«èŠããå ŽåããããŸããããã§ããã³ã¡ã³ãã®1è¡ãšããŠã«ãŠã³ããããŸãã
/*"ã¹ã©ãã·ã¥+ã¢ã¹ã¿ãªã¹ã¯"ã䜿çšããŠãè€æ°ã®è¡ã§é·ãã³ã¡ã³ããéå§ããŸãã
"ã¢ã¹ã¿ãªã¹ã¯+ã¹ã©ãã·ã¥"ã§å€§ããªã³ã¡ã³ããã£ã³ã¯ãéããŸãã
äžèšã®ã·ã§ãŒãã«ããã倧ããªãã£ã³ã¯ã«å¯ŸããŠæ©èœããŸããã³ã¡ã³ãã¢ãŠãããã³ãŒãã®è¡ãéžæãã[ctrl + /]ãæŒããŸããã³ã¡ã³ã解é€ãšåãã§ãã*/
SuperCollider ã¯ãæäœã«é¢ä¿ãªããå·Šããå³ã®åªå é äœã«åŸããŸããããã¯ãããšãã°ãä¹ç®ãæåã«çºçããªãããšãæå³ããŸãã
// é«æ ¡ã§ã¯ãçµæã¯9ã§ãããSCã§ã¯ã14ã§ãã
5 + 2 * 2;
// æ¬åŒ§ã䜿çšããŠãç¹å®ã®æäœé åºã匷å¶ããŸãã
5 + (2 * 2); // 9ã«çããã
ã¡ãã»ãŒãžãšãã€ããªæäœãçµã¿åãããå Žåãã¡ãã»ãŒãžãåªå ãããŸããããšãã°ã5 + 2.squared ã§ã¯ãå¹³æ¹ãæåã«çºçããŸãã
å°ãããŠã圹ã«ç«ã€è©³çŽ°ïŒããã©ã«ãã§ãSuperCollider ã¯æåŸã«è©äŸ¡ããããã®ã®çµæãåžžã«PostãŠã£ã³ããŠã«postããŸããããã¯ãè©äŸ¡æã« Hello World ã³ãŒãã2床ããªã³ããããçç±ã説æããŠããŸããæ°ããããã¥ã¡ã³ãã«æ¬¡ã®è¡ãå ¥åãã[ctrl + A]ã§ãã¹ãŠãéžæããŠããã¹ãŠã®è¡ãäžåºŠã«è©äŸ¡ããŸãã
"æåã®è¡".postln;
"2è¡ç®".postln;
(2 + 2).postln;
3 + 3;
"Finished".postln;
5è¡ãã¹ãŠã SuperCollider ã«ãã£ãŠå®è¡ãããŸããæ瀺ç㪠postln èŠæ±ããã£ããããPostãŠã£ã³ããŠã«2 + 2ã®çµæã衚瀺ãããŸãã3 + 3 ã®çµæãèšç®ãããŸããããpostãããªã¯ãšã¹ãããªãã£ãããã衚瀺ãããŸããã次ã«ãæåŸã®è¡ã®ã³ãã³ããå®è¡ãããŸãïŒ postln ãªã¯ãšã¹ãã«ããã"Finished" ãšããåèªãpostãããŸãïŒãæçµçã«ãæåŸã«è©äŸ¡ããããã®ã®çµæãããã©ã«ã㧠post ãããŸãããã®å ŽåãããŸããŸã"Finished" ãšããåèªã§ããã
è©äŸ¡ããåã«è€æ°è¡ã®ã³ãŒããéžæããã®ã¯é¢åã§ããã³ãŒããããã¯ãäžåºŠã«å®è¡ããã¯ããã«ç°¡åãªæ¹æ³ã¯ãã³ãŒããããã¯ãäœæããããšã§ããäžç·ã«å®è¡ãããã¹ãŠã®ã³ãŒãè¡ããã£ãã§å²ãã ãã§ãã以äžã«äŸã瀺ããŸãã
(
// A little poem
"Today is Sunday".postln;
"Foot of pipe".postln;
"The pipe is made of gold".postln;
"It can beat the bull".postln;
)
å€åŽã®æ¬åŒ§ã¯ã³ãŒããããã¯ãåºåããŸããã«ãŒãœã«ãæ¬åŒ§å ã®ä»»æã®å Žæã«ããéããåäžã® [ctrl + Enter] ããã¹ãŠã®è¡ãè©äŸ¡ããŸã(äžããäžã®é ã«å®è¡ãããŸãããéåžžã«é«éãªã®ã§åæå®è¡ãããŠããããã«èŠããŸã)ã
ã³ãŒããããã¯ã䜿çšãããšãäœããå€æŽããŠåè©äŸ¡ãããã³ã«ãã¹ãŠã®è¡ãå床éžæããå¿ èŠããªããªããŸããããšãã°ãäºéåŒçšç¬Šã§å²ãŸããäžéšã®åèªãå€æŽããå€æŽããçŽåŸã« [ctrl + Enter] ãæŒããŸãããã¹ãŠã®è¡ãæåã§éžæããããšãªããã³ãŒããããã¯å šäœãè©äŸ¡ãããŸããSuperCollider ã¯ãããã¯ã1ç§éãã€ã©ã€ãããŠãå®è¡ãããŠããå 容ã®èŠèŠçãªãã³ããæäŸããŸãã
[ctrl + shift + P] ããã¯ãç¬èªã®ã»ã¯ã·ã§ã³ã«çžå¿ããããªãŒã¯ãã¯ãªãŒãã³ã°ããã®ã«éåžžã«äŸ¿å©ãªã³ãã³ãã§ã§ã:
ãã®è¡ãè©äŸ¡ããŠãåŸã§ Post ãŠã£ã³ããŠããããã«ããŠãã ããã
100.do({"ãã®è¡ãç¹°ãè¿ãptint...".scramble.postln});
ã©ãããããŸããŠã
ããã« SuperCollider ãããã®ãµãŠã³ãåºåã®é²é³ãéå§ããå¿ èŠããããŸãããã®ããã®ç°¡åãªæ¹æ³ã次ã«ç€ºããŸãã
//ã¯ã€ãã¯ã¬ã³ãŒã
//èšé²ãéå§ïŒ
s.record;
//ã¯ãŒã«ãªãµãŠã³ããäœæãã
{Saw.ar(LFNoise0.kr([2,3]).range(100,2000),LFPulse.kr([4,5])* 0.1)}.play;
//èšé²ãåæ¢ããïŒ
s.stopRecording;
//ãªãã·ã§ã³ïŒé²é³ãã¿ã³ãããªã¥ãŒã ã³ã³ãããŒã«ããã¥ãŒããã¿ã³ãåããGUIïŒ
s.makeWindow;
Post ãŠã£ã³ããŠã«ã¯ããã¡ã€ã«ãä¿åããããã©ã«ããŒã®ãã¹ã衚瀺ãããŸãããã¡ã€ã«ãèŠã€ããŠãAudacity ãŸãã¯åæ§ã®ããã°ã©ã ã§éãããµãŠã³ããå®éã«é²é³ãããããšã確èªããŸãã詳现ã«ã€ããŠã¯ã"ãµãŒããŒ"ãã«ããã¡ã€ã«ãåç §ããŠãã ãã( âRecording Supportâ ãŸã§ã¹ã¯ããŒã«ããŸã)ããŸãã¯ããªã³ã©ã€ã³ã§ http://doc.sccode.org/Classes/Server.html
æ°å€ãwordsãunit ãžã§ãã¬ãŒã¿ãŒãé¢æ°ããŸãã¯ã³ãŒããããã¯å šäœãå€æ°ã«ä¿åã§ããŸããå€æ°ã¯ã1æåãŸãã¯ãŠãŒã¶ãŒãéžæããåèªå šäœã§ããçå·(=)ã䜿çšããŠå€æ°ã"å²ãåœãŠ"ãŸãããããã®è¡ãäžåºŠã«1ã€ãã€å®è¡ããPost ãŠã£ã³ããŠãç£èŠããŸãã
x = 10;
y = 660;
y; // å
容ã確èªããŸã
x;
x + y;
y â x;
æåã®è¡ã¯ãå€æ° x ã«æ°å€10ãå²ãåœãŠãŸãã2è¡ç®ã¯ãå€æ° y ã«660ãå ¥ããŸãã次ã®2è¡ã¯ããããã®æåããããã®æ°å(ããŒã¿)ã"å«ã"ããšã蚌æããŠããŸããæåŸã«ãæåŸã®2è¡ã¯ãå€æ°ã䜿çšããŠããŒã¿ãæäœã§ããããšã瀺ããŠããŸããå°æåã®a~zã¯ãSuperCollider ã®å€æ°ãšããŠãã€ã§ã䜿çšã§ããŸããæ £äŸã«ãã䜿çšããªãå¯äžã®æåã¯sã§ãããããã¯ããã©ã«ãã§ãµãŒããŒãè¡šããŸããäœã§ãå€æ°ã«å ¥ããããšãã§ããŸãïŒïŒç¿»èš³è ã泚:以äžã®å 容ã«å«ãŸãã \ ïŒããã¯ã¹ã©ãã·ã¥ïŒã¯ãç°å¢ã«ãã£ãŠã¯ï¿¥ïŒåèšå·ïŒãšè¡šç€ºãããŸãïŒ
a = "Hello,World"; // æåå
b = [0,1,2,3,5]; // ãªã¹ã
c = Pbind(\note,Pwhite(0,10),\dur,0.1); // åŸã§ Pbind ã«ã€ããŠãã¹ãŠåŠç¿ããŸããå¿é
ããªãã§ãã ãã
// ...ãããŠå
ã®ããŒã¿ã䜿çšããã®ãšåãããã«äœ¿çšã§ããããã«ãªããŸããïŒ
a.postln; // postãã
b + 100; // èšç®ãè¡ããŸã
c.play; // ãã® Pbind ãåçããŸã
d = b * 5; // bãåãã5ãæããŠããããæ°ããå€æ°ã«å²ãåœãŠãŸã
å€ãã®å Žåãå€æ°ã«é©åãªååãä»ããŠãã³ãŒãå ã§å€æ°ãäœãè¡šããŠããã®ããæãåºãã®ã«åœ¹ç«ã¡ãŸãã~ (ãã«ã)ã䜿çšããŠãããé·ãååã®å€æ°ã宣èšã§ããŸãããã«ããšå€æ°åã®éã«ã¹ããŒã¹ããªãããšã«æ³šæããŠãã ããã
~myFreqs = [415,220,440,880,220,990];
~myDurs = [0.1,0.2,0.2,0.5,0.2,0.1];
Pbind(\freq,Pseq(~myFreqs),\dur,Pseq(~myDurs)).play;
å€æ°åã¯å°æåã§å§ãŸãå¿ èŠããããŸããååã«ã¯ãæåã®æåãšããŠã§ã¯ãªããæ°åãã¢ã³ããŒã¹ã³ã¢ã倧æåã䜿çšã§ããŸãããã¹ãŠã®æåã¯é£ç¶ããŠããå¿ èŠããããŸã(ã¹ããŒã¹ãå¥èªç¹ã¯äœ¿çšã§ããŸãã)ãèŠããã«ãå€æ°ã«ååãä»ãããšãã¯ãæåãšæ°åãããã³ãšãã©ãã¢ã³ããŒã¹ã³ã¢ã䜿çšããããšããä»ã®ãã¹ãŠã®æåãé¿ããŠãã ããã
~myFreqs,~theBestSineWave,ããã³ ~banana_3 ã¯æå¹ãªååã§ãã
~MyFreqs,~theBestïŒ*ïŒSineWave,ããã³ ~banana!!! ãããã¯æªãååã§ãã
äœæã§ããå€æ°ã«ã¯ã"ã°ããŒãã«"å€æ°ãšããŒã«ã«å€æ°ã®2çš®é¡ããããŸãã
ãããŸã§ã«èŠãå€æ°(åäžã®å°æåaããzãããã³ãã«ã(~)æåãå«ã)ã¯ã倧ãŸãã«"ã°ããŒãã«å€æ°"ãšåŒã°ããå ŽåããããŸãã宣èšããããšãSuperCollider ãçµäºãããŸã§ããããã®ã©ãã§ããä»ã®ãããã§ããä»ã®SCããã¥ã¡ã³ãã§ã"ã°ããŒãã«ã«"åäœããŸãã*
*æè¡çã«ã¯ããã«ãã§å§ãŸãå€æ°ã¯ç°å¢å€æ°ãšåŒã°ããå°æåã®å€æ°(a~z)ã¯ã€ã³ã¿ãŒããªã¿ãŒå€æ°ãšåŒã°ããŸããSuperCollider ã®åå¿è ã¯ããããã®éããå¿é ããå¿ èŠã¯ãããŸããããå°æ¥ã®ããã«å¿ã«çããŠãããŠãã ãããSuperCollider Bookã®ç¬¬5ç« ã§ã¯ãéãã«ã€ããŠè©³ãã説æããŠããŸãã
äžæ¹ãããŒã«ã«å€æ°ã¯ãè¡ã®å é ã§äºçŽããŒã¯ãŒã var ã§å®£èšãããŸãã宣èšæã«å€æ°ã«åæå€ãå²ãåœãŠãããšãã§ããŸã (var apples = 4) ãããŒã«ã«å€æ°ã¯ããã®ã³ãŒããããã¯ã®ã¹ã³ãŒãå ã«ã®ã¿ååšããŸãã
以äžã«ã2çš®é¡ã®å€æ°ãæ¯èŒããç°¡åãªäŸã瀺ããŸããè¡ããšã«è©äŸ¡ããPost ãŠã£ã³ããŠãç£èŠããŸãã
// ç°å¢å€æ°
~galaApples = 4;
~bloodOranges = 5;
~limes = 2;
~plantains = 1;
["Citrus", ~bloodOranges + ~limes ];
["Nonâcitrus", ~plantains + ~galaApples ];
// ããŒã«ã«å€æ°ïŒã³ãŒããããã¯å
ã§ã®ã¿æå¹ã
// ãããã¯ã1åè©äŸ¡ããŠãPost ãŠã£ã³ããŠãèŠãïŒ
(
var apples = 4,oranges = 3,lemons = 8,bananas = 10;
["Citrus fruits", oranges + lemons].postln;
["Nonâcitrus fruits", bananas + apples].postln;
"End".postln;
)
~galaApples; // ãŸã ååšããŠããŸã
apples; // ãªããªã£ã
å€æ°ã«ã€ããŠç解ããæåŸã®äŸ¿å©ãªç¹ã¯ãå€æ°ãåå²ãåœãŠã§ããããšã§ãããã€ã§ãæ°ããå€ãäžããããšãã§ããŸãã
// å€æ°ãå²ãåœãŠã
a = 10 + 3;
a.postln; // 確èªããŠãã ãã
a = 999; // å€æ°ãåå²ãåœãŠããŸã(æ°ããå€ãäžããŸã)
a.postln; // ãã§ãã¯ããŠãã ããïŒå€ãå€ã¯ãªããªããŸããã
åå¿è ã«ãšã£ãŠæ··ä¹±ãæãããšãããéåžžã«äžè¬çãªæ¹æ³ã¯ãå€æ°èªäœãç¬èªã®åå²ãåœãŠã§äœ¿çšãããå Žåã§ãããã®äŸãèŠãŠãã ããïŒ
x = 10; // å€æ°xã«10ãå²ãåœãŠãŸã
x = x + 1; // å€æ°xã«x + 1ãå²ãåœãŠãŸã
x.postln; // 確èªããŠãã ãã
æåŸã®è¡ãç解ããæãç°¡åãªæ¹æ³ã¯ã
"å€æ° x ã®çŸåšã®å€ãååŸããããã« 1 ãè¿œå ãããã®æ°ããçµæãå€æ° xã«å²ãåœãŠã"
ãšããããã«èªãããšã§ãã
ãŸãããããã©ã®ããã«åœ¹ç«ã€ãã«ã€ããŠã¯åŸã§èª¬æããŸãã*
*ãã®äŸã¯ãããã°ã©ãã³ã°ã§ã®çå·ãæ°åŠã§åŠãã çå·ãšã¯ç°ãªãããšãæ確ã«ç€ºããŠããŸããæ°åŠã§ã¯ãx = x + 1 ã¯äžå¯èœã§ã(æ°å€ãããèªäœã«1ã足ãããšã¯ã§ããŸãã)ãSuperCollider ã®ãããªããã°ã©ãã³ã°èšèªã§ã¯ãçå·ã¯äžçš®ã®ã¢ã¯ã·ã§ã³ãšèŠãªãããšãã§ããŸããèšå·ã®å³åŽã§åŒã®çµæãååŸããå·ŠåŽã§å€æ°ã«"ä»£å ¥"ããŸãã
æ°ãã«ãããè©ŠããŠã¿ãŸãããã次ã®ã³ãŒãè¡ãå ¥åããŠå®è¡ããŸãã
Pbind(\degree,Pseries(0,1,30),\dur,0.05).play;
Pbind ã¯ãSuperCollider ã® Pattern ãã¡ããªãŒã®ã¡ã³ããŒã§ããPbind ããã³ Pseries ã®å€§æåPã¯ããã¿ãŒã³ (Pattern) ãè¡šããŸããç§ãã¡ã¯ãããããã«ãã¡ããªãŒã®ä»ã®ã¡ã³ããŒã«äŒããŸãããšãããããPbind ã ãã詳ããèŠãŠã¿ãŸãããããã®åçŽãªäŸãè©ŠããŠãã ããïŒ
Pbind(\degree,0).play;
ãã®ã³ãŒãè¡ãå®éã«è¡ãå¯äžã®ããšã¯ã1ç§éã«1åãäžå€®ã®CãæŒå¥ããããšã§ããããŒã¯ãŒã \degree ã¯é³éã瀺ããæ°å€0ã¯é³éã®ã¯ããŸããæå³ããŸã(Cã¡ãžã£ãŒé³éãæ³å®ãããŠãããããã§ã ãã®Cé³ãã®ãã®ã§ã)ãSuperCollider ã¯1ã§ã¯ãªã0ããã«ãŠã³ããéå§ããããšã«æ³šæããŠãã ãããäžèšã®ãããªåçŽãªè¡ã§ã¯ãããŒãCãDãEãFãG ...ã¯0ã1ã2ã3ã4 ...ã®æ°åã§è¡šãããŸãããã®æ°åãå€æŽããŠã¿ãŠãåè©äŸ¡ãããšãã«é³ãã©ã®ããã«å€åãããã確èªããŠãã ãããè² ã®æ°ã䜿çšããŠãäžå€®ã®Cã®äžã®é³ç¬Šãéžæããããšãã§ããŸã(ããšãã°ã-2ã䜿çšãããšãäžå€®ã®Cã®äžã«é³ç¬ŠAã衚瀺ãããŸã)ãèŠããã«ããã¢ãã®äžå€®ã®Cé³ã0ã§ãããšæ³åããŠãããçœéµãäžäžã«æ°ããŠ(æ£ãŸãã¯è² ã®æ°)ä»ã®é³ãååŸããŸãã
次ã«ãé³ç¬Šã®é·ããå°ãè©ŠããŠã¿ãŸããPbind ã¯ããŒã¯ãŒã \dur ã䜿çšããŠãç§åäœã§æéãæå®ããŸãã
Pbind(\degree,0,\dur,0.5).play;
ãã¡ãããããã¯äŸç¶ãšããŠéåžžã«å³æ Œã§æè»æ§ããããŸãããåžžã«åãé³ã§ãåžžã«åãæç¶æéã§ããå¿é ããªãã§ãã ããïŒç©äºã¯ããã«è¯ããªããŸãã
ã¹ã±ãŒã«ã®ããã«ãããã€ãã®é³ãé çªã«æŒå¥ããŠã¿ãŸãããããŸããé³ç¬Šãçããããšãã°0.2ç§ã«ããŸãããã
Pbind(\degree,Pseq([0,1,2,3,4,5,6,7],1),\dur,0.2).play;
ãã®è¡ã¯ããã¿ãŒã³ãã¡ããªã®æ°ããã¡ã³ããŒã§ãã Pseq ã玹ä»ããŠããŸããååã瀺ãããã«ããã®ãã¿ãŒã³ã¯ã·ãŒã±ã³ã¹ãæ±ããŸããã·ãŒã±ã³ã¹ãåçããããã« Pseq ã«å¿ èŠãªã®ã¯æ¬¡ã®ãšããã§ãã
-
è§æ¬åŒ§ã§å²ãŸããã¢ã€ãã ã®ãªã¹ã
-
ãªã¹ãã®ç¹°ãè¿ãåæ°
ãã®äŸã§ã¯ããªã¹ã㯠[0,1,2,3,4,5,6,7] ã§ãç¹°ãè¿ãåæ°ã¯1ã§ãããã® Pseq ã¯ãåã«"ãªã¹ãã®ãã¹ãŠã®é ç®ãé çªã«åçãã"ãšããæå³ã§ãããããã®2ã€ã®èŠçŽ ããªã¹ããšç¹°ãè¿ãåæ°ã¯ãPseq ã®æ¬åŒ§å ã«ãããã³ã³ãã§åºåãããŠããããšã«æ³šæããŠãã ããã
Pbind å ã® Pseq ã®äœçœ®ã«ã泚æããŠãã ãããããã¯ã\degreeã®å ¥åå€ã§ããããã¯éèŠã§ããæåã®åçŽãª Pbind ã®ããã«ãã¹ã±ãŒã«ã®åºŠåãã«åäžã®åºå®æ°ãæäŸãã代ããã«ãäžé£ã®æ°ã®ã¬ã·ãã§ãã Pseq å šäœãæäŸããŠããŸããããã念é ã«çœ®ããŠããã®ã¢ã€ãã¢ãç°¡åã«æ¡åŒµããå¥ã® Pseq ã䜿çšããŠç¶ç¶æéãå¶åŸ¡ããããšãã§ããŸãã
Pbind(\degree,Pseq([0,1,2,3,4,5,6,7],5),\dur,Pseq([0.2,0.1,0.1,0.2,0.2,0.35],inf) ).play;
ãã®äŸã§ã¯äœãèµ·ãã£ãŠããŸããïŒ
æåã«ãæåã® Pseq ã®ç¹°ãè¿ãæ°ã5ã«å€æŽãããããã¹ã±ãŒã«å šäœã5ååçãããŸãã
次ã«ã以åã«åºå®ãã0.2ã® \dur å€ãå¥ã® Pseq ã«çœ®ãæããŸããããã®æ°ãã Pseq ã«ã¯ã6ã€ã®ã¢ã€ãã ã®ãªã¹ãããããŸãïŒ[0.2,0.1,0.1,0.2,0.2,0.35]ããããã®æ°å€ã¯ãçµæã®ããŒãã®ãã¥ã¬ãŒã·ã§ã³å€ã«ãªããŸãã
ãã®2çªç®ã® Pseq ã®ç¹°ãè¿ãå€ã¯ "infinite." ãè¡šã inf ã«èšå®ãããŸããããã¯ãPseq ãã·ãŒã±ã³ã¹ãç¹°ãè¿ãããšãã§ããåæ°ã«å¶éããªãããšãæå³ããŸãã
Pbind ã¯æ°žé ã«ãã¬ã€ããŸããïŒ ãããïŒä»ã® Pseq ããžã§ããçµäºããåŸãã€ãŸãäžé£ã®ã¹ã±ãŒã«åºŠã5ååçãããåŸã«åæ¢ããŸãã
æåŸã«ããã®äŸã«ã¯åèš8ã€ã®ç°ãªãããŒãïŒæåã® Pseq ã®ãªã¹ã[0,1,2,3,4,5,6,7]ïŒããããŸããããã¥ã¬ãŒã·ã§ã³ïŒ2çªç®ã® Pseq ïŒã«ã¯6ã€ã®å€ãããããŸããããã®ããã«ç°ãªããµã€ãºã®ã·ãŒã±ã³ã¹ãæäŸãããšãPbind ã¯å¿ èŠã«å¿ããŠåçŽã«åŸªç°ããŸãã
ãããã®è³ªåã«çããŠãåŠãã ããšãå®è·µããŠãã ããã
-
2çªç®ã® Pseq ã® repeats åŒæ°ãšããŠãinf ã®ä»£ããã«æ°å€1ãè©ŠããŠãã ããã äœãèµ·ããã®ã§ããïŒ
-
ãã® Pbind ãæ°žä¹ ã«ãã¬ã€ããã«ã¯ã©ãããã°ããã§ããïŒ
ãœãªã¥ãŒã·ã§ã³ã¯æ¬ã®æåŸã«ãããŸãã1
äžèšã®ã³ãŒãè¡ãéåžžã«é·ãããšã«æ°ã¥ãããããããŸãããå®éãæè¡çã«ã¯åäžã®ã¹ããŒãã¡ã³ãã§ããã«ãããããããæ°ããè¡ã«æãè¿ãããã»ã©é·ããé·ãã³ãŒãè¡ã¯èªã¿ã«ãããããããŸããããããåé¿ããã«ã¯ãã³ãŒããããã€ãã®ã€ã³ãã³ãããè¡ã«åå²ããã®ãäžè¬çã§ãã
ç®æšã¯ãã§ããã ãæ確ã§ãããããããã®ã«ããããšã§ããäžèšãšåã Pbind ã¯ã次ã®ããã«æžãããšãã§ããŸãã
Pbind(
\degree,Pseq([0,1,2,3,4,5,6,6,7],5),
\dur,Pseq([0.2,0.1,0.1,0.2,0.2,0.35],inf)
).play;
ããããã¯ããã®ããã« Pbind ãäœæããç¿æ £ã身ã«ä»ããŠãã ããããã¡ããšæŽçããããã¡ããšæŽçãããã³ãŒããæžãããšã¯ãSuperCollider ãåŠã¶äžã§å€§ãã«åœ¹ç«ã¡ãŸãã
ãŸãããã® Pbind ãæ¬åŒ§ã§å²ãã§ã³ãŒããããã¯ãäœæããŠããããšã«æ³šæããŠãã ãã(ã»ã¯ã·ã§ã³9ãæãåºããŠãã ãã)ãããã¯1è¡ã§ã¯ãªãããããã¹ãŠãäžç·ã«å®è¡ããããã«ãããè¡ãå¿ èŠããããŸããè©äŸ¡ããåã«ãã«ãŒãœã«ããããã¯å ã®ã©ããã«ããããšã確èªããŠãã ããã
Pbind ã¯ãé³åºŠïŒäž»é³ãšã®é³çšã«åŸã£ãŠãçªå·ãæ¯ã£ããã®ïŒã ãã§ãªããããããæå®ããä»ã®æ¹æ³ãåãå ¥ããŸãã
- 12åãã¹ãŠã®åé³ç¬Š(ãã¢ãã®é»éµãšçœéµ)ã䜿çšããå Žåã¯ã\degree ã®ä»£ããã«\note ã䜿çšã§ããŸãã0ã¯ããã«C ãæå³ããŸãããã¹ãããã«ã¯ãã¢ãã®é»éµãå«ãŸããŸã(0=middle C, 1=C#, 2=D, etc)ã
- MIDIããŒãã®çªå·ä»ãã䜿çšããå Žåã¯ã\midinote ã䜿çšããŸã(60=middle C, 61=C#, 62=D,etc)ã
- æåŸã«ããã«ãã§çŽæ¥åšæ³¢æ°ãæå®ããå Žåã¯ã\freq ã䜿çšããŸãã
4ã€ã®æ¹æ³ãã¹ãŠã®æ¯èŒã«ã€ããŠã¯ãå³2ãåç §ããŠãã ããã
次ã®äŸã§ã¯ã4ã€ã® Pbind ããã¹ãŠåãé³ç¬ŠãæŒå¥ããŸãïŒäžå€®ã®Cã®äžã®A (A4)ã
å³2ïŒé³éãããŒãçªå·ãããã£ããããããã³åšæ³¢æ°ã®æ¯èŒ
Pbind(\degree,5).play;
Pbind(\note,9).play;
Pbind(\midinote,69).play;
Pbind(\freq,440).play;
ãã³ãïŒ |
---|
ãããä»æ§ã®åã¿ã€ãã¯ãç°ãªãåççãªç¯å²ã®æ°å€ãæ³å®ããŠããããšã«æ³šæããŠãã ããã[-1,0,1,3] ã®ãããªæ°åã®ãªã¹ãã¯ã\degree ã \note ã«ã¯æå³ããããŸããã\midinote ã \freq ã«ã¯æå³ããããŸããã次ã®è¡šã§ã¯ããã¢ãããŒããŒããåºæºãšããŠäœ¿çšããŠããã€ãã®å€ãæ¯èŒããŠããŸãã |
A0 (lowest piano note) | C4 | A4 | C5 | C8 (highest piano note) | |
---|---|---|---|---|---|
\degree | -23 | 0 | 5 | 7 | 21 |
\note | -39 | 0 | 9 | 12 | 48 |
\midinote | 21 | 60 | 69 | 72 | 108 |
\freq | 27.5 | 261.6 | 440 | 523.2 | 4186 |
次ã®äŸã§ã¯ãã€ãã³ãã®æ¯å¹ ãšé³ç¬Šéã®ã¬ã¬ãŒãã®éãå®çŸ©ãã2ã€ã®æ°ããããŒã¯ãŒã \amp ãš \legato ã玹ä»ããŸããè¯ãã€ã³ãã³ãã®ãããã§ã³ãŒããéåžžã«èªã¿ããããè€æ°è¡ã«åºãã£ãŠããããšã«æ³šç®ããŠãã ããããã£ã(äžãšäž)ãå²ããšãã³ãŒããããã¯ãåºåã£ãŠãã°ããå®è¡ã§ããŸãã
(
Pbind(
\degree,Pseq([0,-1,2,-3,4,-3,7,11,4,2,0,-3],5),
\dur,Pseq([0.2,0.1,0.1],inf),
\amp,Pseq([0.7,0.5,0.3,0.2],inf),
\legato,0.4
).play;
)
Pbind ã«ã¯ãããã®äºåå®çŸ©ãããããŒã¯ãŒãã®å€ããããããããã詳ããåŠãã§ããããŸããããã§ã¯ãã®ãã¡ã®ããã€ãã1ã€ã¯ãããïŒ\degreeã\noteã\midinoteããŸã㯠\freq ããéžæïŒã1ã€ã¯ãã¥ã¬ãŒã·ã§ã³ïŒ\durïŒã1ã€ã¯æ¯å¹ ïŒ\ampïŒã1ã€ã¯ã¬ã¬ãŒãïŒ\legatoïŒã«ã€ããŠåãäžããŸããæç¶æéã¯ããŒãã§ãïŒãã®å Žåã1ç§ããã1ããŒãããããããã©ã«ãã§ãïŒãæ¯å¹ ã¯0~1ã®éã§ãªããã°ãªããŸããïŒ0 =ç¡é³ã1 =éåžžã«å€§ããïŒããããŠãã¬ã¬ãŒãã¯0.1ãã1ã®éã®å€ã§æé©ã«åäœããŸãïŒã¬ã¬ãŒããäœãããã®ãããããªãå Žåã¯ãäžèšã®äŸã0.1ã0.2ã0.3ã®é ã«1ãŸã§è©ŠããçµæãèããŠãã ããïŒã
æåŸã®äŸãåºçºç¹ãšããŠãæ°ãã Pbind ãäœæããŸããã¡ããã£ãå€æŽããŸããæç¶æéãšæ¯å¹ ã®æ°ãããªã¹ããäœæããŸãããããã« \freq ã䜿çšããŠå®éšããŸããå¿ èŠãªå Žåã¯ãä»»æã®ãã©ã¡ãŒã¿ãŒã«åºå®æ°ã䜿çšããããšãåžžã«éžæã§ããŸããããšãã°ãã¡ããã£å ã®ãã¹ãŠã®é³ç¬Šã®é·ãã0.2ç§ã«ãããå ŽåãPseq [0.2,0.2,0.2,0.2 ...ãæžãå¿ èŠã¯ãªããPseq([0.2],inf) ã§ããªããåã«å šäœã® Pseqæ§é äœã«0.2ãæžã蟌ã¿ãŸãã
(
Pbind(
\degree, Prand([2, 3, 4, 5, 6], inf),
\dur, 0.15,
\amp, 0.2,
\legato, 0.1
).play;
)
Prand ã Pseq ã«çœ®ãæããŠãçµæãæ¯èŒããŸãã次ã«ãæç¶æéãæ¯å¹ ãã¬ã¬ãŒãã«Prand ã䜿çšããŠã¿ãŠãã ããã
ãã¿ãŒã³ãã¡ããªãŒã®ãã1ã€ã®ããã¥ã©ãŒã¡ã³ããŒã¯ Pwhiteã§ããããã¯ãçååžä¹±æ°ãžã§ãã¬ãŒã¿ã§ãïŒååã¯"ãã¯ã€ããã€ãº"ã«ç±æ¥ããŸãïŒãããšãã°ãPwhite(100,500) ã¯100ãã500ãŸã§ã®ä¹±æ°ãååŸããŸãã
(
Pbind(
\freq, Pwhite(100, 500),
\dur, Prand([0.15, 0.25, 0.3], inf),
\amp, 0.2,
\legato, 0.3
).trace.play;
)
äžèšã®äŸã¯ãå¥ã®åœ¹ç«ã€ããªãã¯ã瀺ããŠããŸãïŒåççŽåã®ã¡ãã»ãŒãžãã¬ãŒã¹ã§ãããã¹ãŠã®ã€ãã³ãã«å¯ŸããŠéžæãããå€ãPostãŠã£ã³ããŠã«åºåããŸãããããã°ãåã«äœãèµ·ãã£ãŠããããç解ããã®ã«éåžžã«äŸ¿å©ã§ãïŒ
Pwhite ãš Prand ã®éãã«æ³šæããŠãã ãããã©ã¡ããã©ã³ãã æ§ã«é¢ä¿ããŠããŠããç°ãªãåŒæ°ãåããç°ãªãããšãè¡ããŸããPwhite ã®æ¬åŒ§å ã«ã¯ãPwhite(low,high) ãšããäœãå¢çãšé«ãå¢çãæå®ããã ãã§ããä¹±æ°ã¯ãã®ç¯å²å ããéžæãããŸããäžæ¹ãPrand ã¯ãé ç®ã®ãªã¹ã(倧æ¬åŒ§ã§å²ãŸããŠããå¿ èŠããããŸã)ãšãå€æ°ã®ç¹°ãè¿ã (Prand([list,of,items],repeats)) ãåãåããŸãããªã¹ãããã©ã³ãã ãªã¢ã€ãã ãéžæãããŸãã
äž¡æ¹ã§éãã§ãéããå®å šã«ç解ããŠãã ããã
ãã³ãïŒ |
---|
2ã€ã®æŽæ°ãæ〠Pwhite ã¯ãæŽæ°ã®ã¿ãçæããŸããããšãã° Pwhite(100,500) ã¯145ã568ã700ãªã©ã®æ°å€ãåºåããŸããã145.6,450.32 ãªã©ã¯åºåããŸãããåºåã«æµ®åå°æ°ç¹æ°ãå¿ èŠãªå Žåã¯ãPwhite(100,500.0) ãšèšè¿°ããŸããããã¯ãããšãã°ãæ¯å¹ ã«éåžžã«åœ¹ç«ã¡ãŸããPwhite(0,1) ãæžã蟌ããšã0ãŸãã¯1ããåŸãããŸããããPwhite(0,1.0) ãæžããšããã¹ãŠãåŸãããŸãã |
次ã®è³ªåãè©ŠããŠãæ°ããç¥èããã¹ãããŠãã ãã
â a) Pwhite(0,10) ãš Prand([0,4,1,5,9,10,2,3],inf) ã®åºåã®éãã¯äœã§ããïŒ
â b) 0ãã100ã®éã§ã©ã³ãã ã«éžæãããæŽæ°ã®ã¹ããªãŒã ãå¿ èŠãªå ŽåãPrand ã䜿çšã§ããŸããïŒ
â c) Pwhite(0,3) ãš Prand([0,1,2,3],inf) ã®åºåã®éãã¯äœã§ããïŒ Pwhite(0,3.0) ãšæžããšã©ããªããŸããïŒ
â d) 以äžã®äŸãå®è¡ããŸããCãã€ããŒã¹ã±ãŒã«(é»éµãå«ã)ãæŒå¥ããããã«ã\degree ã§ã¯ãªã \note ã䜿çšããŸãããªã¹ã[0,2,3,5,7,8,11,12]ã«ã¯ããããCãDãEãFãGãAãBãCã«å¯Ÿå¿ãã8ã€ã®æ°åããããŸãããããããã®ã€ãã³ãã®æ°ã¯äŸã¯å®éã«ãã¬ã€ããŸããïŒã©ãããŠïŒ
// Pseq
(
Pbind(
\note, Pseq([0, 2, 3, 5, 7, 8, 11, 12], 4),
\dur, 0.15;
).play;
)
// Pseq
(
Pbind(
\note, Prand([0, 2, 3, 5, 7, 8, 11, 12], 4),
\dur, 0.15;
).play;
)
// Pwhite
(
Pbind(
\note, Pseq([0, 2, 3, 5, 7, 8, 11, 12], 4),
\dur, Pwhite(0.15, 0.5);
).play;
)
åçã¯ãã®ãã¥ãŒããªã¢ã«ã®æåŸã«ãããŸãã2
ãã³ãïŒ |
---|
Pbind ã¯ãæçã®å éšãã¿ãŒã³ã®åçãçµäºãããšãåçãåæ¢ããŸãïŒåå éšãã¿ãŒã³ã®repeatsåŒæ°ã«ãã£ãŠæ±ºå®ãããŸãïŒã |
ãããŸã§ã«ãèªåã§ç°¡å㪠Pbind ãæžãããšãã§ããã¯ãã§ãããããããã¥ã¬ãŒã·ã§ã³ãæ¯å¹ ãã¬ã¬ãŒãå€ãæå®ããæ¹æ³ãšãä»ã®ãã¿ãŒã³(Pseq,Prand,Pwhite) ãåã蟌ãã§èå³æ·±ããã©ã¡ãŒã¿ãŒå€æŽãçæããæ¹æ³ãç¥ã£ãŠããŸãã
ãã®ã»ã¯ã·ã§ã³ã§ã¯ããã¿ãŒã³ã®èªåœãå°ãå¢ãããŸãã以äžã®äŸã§ã¯ããã¿ãŒã³ãã¡ããªã®ããã«6ã€ã®ã¡ã³ããŒã玹ä»ããŸãã圌ããäœãããããèªåã§èããŠã¿ãŠãã ããã次ã®æŠç¥ã䜿çšããŸãã
- çµæã®ã¡ããã£ãŒãèããŸããããªããèãããã®ãèšè¿°ãåæãã;
- ãã¿ãŒã³åãèŠãŠãã ããïŒäœãã瀺åããŠããŸããïŒïŒäŸãã°ãPshuf ã¯"ã·ã£ããã«"ãšããèšèãæãåºããããããããŸããïŒ;
- æ°ãããã¿ãŒã³å ã®åŒæ°(æ°å)ã確èªããŸãã
- åè¿°ã® .trace.play ã䜿çšããŠãPost ãŠã£ã³ããŠã«åºåãããå€ã確èªããŸãã
- æåŸã«ããã«ããã¡ã€ã«ãåç §ããŠæšæž¬ã確èªããŸãïŒãã¿ãŒã³ã®ååãéžæãã[ctrl + D]ãæŒããŠå¯Ÿå¿ãããã«ããã¡ã€ã«ãéããŸãïŒã
// ãã¿ãŒã³ã®èªåœãå¢ãã
// Pser
(
Pbind(
\note, Pser([0, 2, 3, 5, 7, 8, 11, 12], 11),
\dur, 0.15;
).play;
)
// Pxrand
// Prand ãšæ¯èŒããŠéããèã
(
p = Pbind(
\note, Pxrand([0, 2, 3, 5, 7, 8, 11, 12], inf),
\dur, 0.15;
).play;
)
// Pshuf
(
p = Pbind(
\note, Pshuf([0, 2, 3, 5, 7, 8, 11, 12], 6),
\dur, 0.15;
).play;
)
// Pslide
// 4ã€ã®åŒæ°ã䜿çš: list, repeats, length, step
(
Pbind(
\note, Pslide([0, 2, 3, 5, 7, 8, 11, 12], 7, 3, 1),
\dur, 0.15;
).play;
)
// Pseries
// 3ã€ã®åŒæ°ã䜿çš: start, step, length
(
Pbind(
\note, Pseries(0, 2, 15),
\dur, 0.15;
).play;
)
// Pgeom
// 3ã€ã®åŒæ°ã䜿çš: start, grow, length
(
Pbind(
\note, Pseq([0, 2, 3, 5, 7, 8, 11, 12], inf),
\dur, Pgeom(0.1, 1.1, 25);
).play;
)
// Pn
(
Pbind(
\note, Pseq([0, Pn(2, 3), 3, Pn(5, 3), 7, Pn(8, 3), 11, 12], 1),
\dur, 0.15;
).play;
)
ãããã®ãã¿ãŒã³ã®äœ¿çšãç·Žç¿ããŸããå€ãã®ããšãã§ããŸããPbind ã¯æ¥œèã®ã¬ã·ãã®ãããªãã®ã§ãããŒããšãªãºã ã®åºå®ã·ãŒã±ã³ã¹ãæžãããšã«éå®ãããªããšããå©ç¹ããããŸããåžžã«å€åããé³æ¥œãã©ã¡ãŒã¿ãŒã®ããã»ã¹ãèšè¿°ããããšãã§ããŸãïŒããã¯"algorithmic composition"ãšåŒã°ããããšããããŸãïŒãããã¯ããã¿ãŒã³ãã¡ããªã®åŒ·åãªæ©èœã®1ã€ã®åŽé¢ã«ãããŸããã
å°æ¥çã«ãããå€ãã®ãã¿ãŒã³ãªããžã§ã¯ãã®å¿ èŠæ§ãæããå Žåãæé©ãªå Žæã¯ãçµã¿èŸŒã¿ã®ãã«ããã¡ã€ã«ã§å©çšå¯èœãª James Harkins ã®"A Practical Guide to Patterns,"ã§ãã*
*ãªã³ã©ã€ã³ã§ã http://doc.sccode.org/Tutorials/A-Practical-Guide/PG_01_Introduction.html
Pbinds å ã«ã³ãŒããèšè¿°ãããã§ããïŒãããããªã¹ããšããŠèšè¿°ããŸãïŒè§æ¬åŒ§ã§å²ãŸããã³ã³ãåºåãå€ïŒïŒ
(
Pbind(
\note,Pseq([[0,3,7],[2,5,8],[3,7,10] ,[ 5,8,12 ]],3),
\dur,0.15
).play;
)
//strum
(
Pbind(
\note,Pseq([[-7,3,7 ,10],[ 0,3,5,8 ]],2),
\dur,1,
\legato,0.4,
\strum,0.1 //0,0.1,0.2 ãªã©ãè©Šã
).play;
)
ãããã®æå®ã« \degree ã䜿çšããå ŽåãããŒã¯ãŒã \scale ã䜿çšããŠå¥ã®è¡ãè¿œå ããŠã¹ã±ãŒã«ãå€æŽã§ããŸã ïŒæ³šïŒãã㯠\degree ãšãšãã«ã®ã¿æ©èœãã\note, \midinote ãŸã㯠\freqã§ã¯æ©èœããŸããïŒïŒ
(
Pbind(
\scale,Scale .harmonicMinor,
\degree,Pseq([0,1,2,3,4,5,6,7],1),
\dur,0.15;
).play;
)
// ãã®è¡ãè©äŸ¡ããŠã䜿çšå¯èœãªãã¹ãŠã®ã¹ã±ãŒã«ã®ãªã¹ãã衚瀺ããŸãã
Scale.directory;
// 1床ã®éã«åé³ãå¿
èŠãªå Žåã¯ããããè¡ããŸãïŒ
(
Pbind(
\degree,Pseq([0,1,2,3,3.1,4],1),
).play;
)
// äžèšã®3.1ã¯ã¹ã±ãŒã«`3`ã®äžã®åé³(ãã®å ŽåãFã®äžã®FïŒ)ãæå³ããŸãã\scaleãæ瀺çã«æå®ããªãå ŽåãScale.majorãæ³å®ãããããšã«æ³šæããŠãã ããã
\ctranspose ããŒã¯ãŒãã䜿çšããŠãåé³ã®ãã©ã³ã¹ããŒãºãå®çŸããŸããããã¯ã\degreeã\note ããã³ \midinote ãšé£åããŸããã\freq ãšã¯é£åããŸããã
(
Pbind(
\note,Pser([0,2,3,5,7,8,11,11,12],11),
\ctranspose,12,//ãªã¯ã¿ãŒãäžã§ãã©ã³ã¹ããŒãº(= 12åé³)
\dur,0.15;
).play;
)
ãã€ã¯ãããŒã³ã®æžãæ¹ïŒ
// \note ããã³ \midinote ã䜿çšãããã€ã¯ãããŒã³ïŒ
Pbind(\note,Pseq([0,0.5,1,1.5,1.75,2],1)).play;
Pbind(\midinote,Pseq([60,69,68.5,60.25,70],1)).play;
Pbind ã® \dur ããŒã«æå®ããå€ã¯ææ°ã§ããã€ãŸãã1ã¯1æã0.5ã¯åæãªã©ãæå³ããŸããç¹ã«æå®ããªãéããããã©ã«ãã®ãã³ãã¯60 BPMïŒ1åãããã®ããŒãïŒã§ããå¥ã®ãã³ãã§æŒå¥ããã«ã¯ãæ°ããTempoClock ãäœæããã ãã§ãã120ããŒã/åïŒBPMïŒã§åçãã Pbind ã¯æ¬¡ã®ãšããã§ãã
(
Pbind(\degree,Pseq([0,0.1,1,2,3,4,5,6,7]),
\dur,1;
).play(TempoClock(120/60)); // 60ç§éã§120ããŒãïŒ120 BPM
)
ãšããã§ãäžèšã® Pseq ãåŒæ°(ãªã¹ã)ã1ã€ãããšã£ãŠããªãããšã¯ããããŸãããïŒåžžã«ãªã¹ãã®åŸã«æ¥ãç¹°ãè¿ãå€ã¯ã©ãã«ãããŸããïŒãµã³ãã«ãã·ãŒã±ã³ã¹ã1åã ãåçããã®ãèãããŸããããªãã§ããïŒããã¯ããã¹ãŠã®ãã¿ãŒã³(ããã³å®éãSuperCollider ã®ä»ã®å€ãã®ãªããžã§ã¯ã)ã®å ±éããããã£ã§ããåŒæ°ãçç¥ãããšãçµã¿èŸŒã¿ã®ããã©ã«ãå€ã䜿çšãããŸãããã®å ŽåãPseq ã®ããã©ã«ãã®ç¹°ãè¿ãã¯1ã§ãã
PbindïŒããã¯åãªã Pbind(\degree,0).play ã§ããã1ã€ã®ããŒããæŒå¥ããæ¹æ³ããç¥ããŸããã§ããããã¥ã¬ãŒã·ã§ã³ãæ¯å¹ ãã¬ã¬ãŒããªã©ã®æ å ±ãæäŸããŸããã§ããããããã®å ŽåãPbind ã¯ããã©ã«ãå€ã䜿çšãå ã«é²ã¿ãŸãã
äŒç¬Šã®æžãæ¹ã§ããRest(0.3)ã®ããã«ã«ãã³å ã®æ°åã¯ãäŒç¬Šã®é·ããããŒãã§è¡šãããã®ã§ããäŒç¬Šã¯ã\dur è¡ã ãã§ãªããPbind ã®ä»»æã®å Žæã«ç§»åã§ããŸãã
(
Pbind(
\degree,Pwhite(0,10),
\dur,Pseq([0.1,0.1,0.3,0.6,Rest(0.3),0.25],inf);
).play;
)
ããã€ãã® Pbind ãåæã«éå§ããã«ã¯ãåçŽã«ããããã¹ãŠã 1 ã€ã®ã³ãŒããããã¯å ã«å ¥ããŸãã
(//倧ããªãããã¯
Pbind(
\freq,Pn(Pseries(110,111,10)),
\dur,1/2,
\legato,Pwhite(0.1,1)
).play;
Pbind(
\freq,Pn(Pseries(220,222,10)),
\dur,1/4,
\legato,Pwhite(0.1,1)
).play;
Pbind(
\freq,Pn(Pseries(330,333,10)),
\dur,1/6,
\legato,0.1
).play;
)//倧ããªãããã¯ãéãã
Pbind ãæç³»åã«åçããã«ã¯ïŒåã«ããããæåã§æ¬¡ã ã«è©äŸ¡ãã以å€ïŒã
{} .fork
ã䜿ããŸãïŒ
//åºæ¬çãªãã©ãŒã¯ã®äŸã䜿çšã§ããŸããPostãŠã£ã³ããŠãèŠãŠãã ããïŒ
(
{
"one thing".postln;
2.wait;
"å¥ã®ãã®".postln;
1.5.wait;
"æåŸã®1ã€".postln;
}.fork;
)
//ããèå³æ·±ãäŸïŒ
(
t = TempoClock(76/60);
{
Pbind(
\note,Pseq([[4,11],[6,9]],32),
\dur,1/6,
\amp,Pseq([0.05,0.03],inf)
).play(t);
2.wait;
Pbind(
\note,Pseq([[-25,-13,-1],[-20,-8,4 ],\rest],3),
\dur,Pseq([1,1,Rest( 1)],inf),
\amp,0.1,
\legato,Pseq([0.4,0.7,\rest],inf)
).play(t);
2.75.wait;
Pbind(
\note,Pseq([23,21,25,23,21,20,18,16,16,20,21,23,21],inf),
\dur,Pseq([0.25,0.75,0.25,1.75,0.125,0.125,0.80,0.20,0.125,0.125,1],1),
\amp,0.1,
\legato,0.5
).play(t);
}.fork(t);
)
Pbind ãåæã«ãé çªã«åçããé«åºŠãªæ¹æ³ã«ã€ããŠã¯ãPpar ãš Pspawner ã確èªããŠãã ãããfork ã®è©³çŽ°ã«ã€ããŠã¯ãRoutine Help ãã¡ã€ã«ãã芧ãã ããã
åã®ã»ã¯ã·ã§ã³"ãã¿ãŒã³ã®èªåœãæ¡åŒµãã"ã§,è€æ°ã® Pbind ã«å¯ŸããŠåãããŒããªã¹ã [0,2,3,5,7,8,11,12] ãäœåºŠãå ¥åããå¿ èŠãããããšã«æ°ä»ããŸãããïŒåããã®ãäœåºŠãäœåºŠãã³ããŒããã®ã¯å¹ççã§ã¯ãããŸãããïŒããã°ã©ãã³ã°ã§ã¯ãåãã¿ã¹ã¯ãç¹°ãè¿ãå®è¡ããŠããããšã«æ°ä»ãããšãã¯ãã€ã§ããããããåãç®æšãããã¹ããŒããªæŠç¥ãæ¡çšããŠéæããå¿ èŠããããŸãã
ãã®å Žå,å€æ°ã䜿çšã§ããŸããèŠããŠãããããããŸããããå€æ°ã䜿çšãããšãããŒã¿ã®ãã£ã³ã¯ãæè»ãã€ç°¡æœã«åç §ã§ããŸãïŒå¿ èŠã«å¿ããŠã»ã¯ã·ã§ã³12ã 確èªããŠãã ãã ïŒã以äžã«äŸã瀺ããŸãã
// åãæ°åã®ã·ãŒã±ã³ã¹ããããã䜿çšããŠããŸããïŒå€æ°ã«ä¿åããŸãïŒ
c = [0,2,3,5,7,8,11,11,12]
// ããã§åç
§ã§ããŸã
Pbind(\note,Pseq(c,1),\dur,0.15).play;
Pbind(\note,Prand(c,6),\dur,0.15).play;
Pbind(\note,Pslide(c,5,3,1),\dur,0.15).play;
å€æ°ã®äœ¿çšãç·Žç¿ããå¥ã®äŸïŒ2ã€ã® Pbind ãåæã«ãã¬ã€ããããšããŸãããããããã®1ã€ã¯æé ã®ã¡ãžã£ãŒã¹ã±ãŒã«ãå®è¡ãããã1ã€ã¯1ãªã¯ã¿ãŒãäžã®éé ã®ã¡ãžã£ãŒã¹ã±ãŒã«ãå®è¡ããŸããã©ã¡ããåã durations ã®ãªã¹ãã䜿çšããŸãããããèšè¿°ãã1ã€ã®æ¹æ³ã次ã«ç€ºããŸãã
~scale = [0,1,2,3,4,5,6,7];
~durs = [0.4,0.2,0.2,0.4,0.8,0.2,0.2,0.2];
(
Pbind(
\degree,Pseq(~scale),
\dur,Pseq(~durs)
).play;
Pbind(
\degree,Pseq(~scale.reverse + 7),
\dur,Pseq(~durs)
).play;
)
ããã§èå³æ·±ãããªãã¯ïŒå€æ°ã®ãããã§ãäž¡æ¹ã® Pbind ã«å¯ŸããŠåãã¹ã±ãŒã«åºŠãš durations ã®ãªã¹ããåå©çšããŸãã2çªç®ã®ã¹ã±ãŒã«ãäžéããæåã®ã¹ã±ãŒã«ãã1ãªã¯ã¿ãŒãäžã«ãªãããã«ãããã£ãã
ãããå®çŸããã«ã¯ãåã«ã¡ãã»ãŒãž .reverse ã䜿çšããŠãªã¹ãã®é åºãéã«ããŸã ïŒæ°ããè¡ã«"~scale.reverse"ãšå ¥åããè©äŸ¡ããŠæ£ç¢ºã«ãã®å 容ã確èªããŸãïŒã次ã«7ãè¿œå ããŠã1ãªã¯ã¿ãŒãäžã§ç§»èª¿ããŸãïŒãã¹ãããŠçµæã確èªããŸãïŒã*
2ã€ã® Pbind ã 1ã€ã®ã³ãŒããããã¯ã§å²ãã§åæã«åçããŸããã
æŒç¿ïŒäžèšã®ã³ãŒããããã¯å ã« Pbind ã1ã€è¿œå ããŠã3ã€ã®é³å£°ãèãããããã«ããŸããããã€ãã®ç°ãªãæ¹æ³ã§äž¡æ¹ã®å€æ°ïŒ~scale ããã³ ~durs ïŒã䜿çšããŸããããšãã°ãPseq 以å€ã®ãã¿ãŒã³å ã§äœ¿çšã移調éãå€æŽãdurations ãéã«ãããä¹ç®ãããããªã©ãªã©ã
*åã移調ãåŸãããã« \ctranspose,12 ã䜿çšããããšãã§ããŸãã
ããã¯ãPbindãç¹ã« inf ã䜿çšããŠæ°žä¹ ã«å®è¡ããããã®ã«é¢ããéåžžã«äžè¬çãªè³ªåã§ããåã ã® Pbind ãèªç±ã«åæ¢ããã³èµ·åããã«ã¯ã©ãããã°ããã§ãããçãã«ã¯å€æ°ã䜿çšããå¿ èŠããããããã«å®å šãªäŸã衚瀺ãããŸããããããããã«è¡ãåã«ãPbind ããã¬ã€ãããšãã«äœãèµ·ããããããå°ãç解ããå¿ èŠããããŸãã
Pbind ã¯ãäžçš®ã®æ¥œèãšããŠèããããšãã§ããŸããPbind ã¯ãé³ãåºãããã®ã¬ã·ãã§ãããé³æ¥œã®ããã»ãŒãžãå®çŸããããã®äžé£ã®æ瀺ã§ããã¹ã³ã¢ãé³æ¥œã«ããããã«ã¯ããã¬ãŒã€ãŒã«äžããå¿ èŠããããŸããããã¯ãã¹ã³ã¢ãèªã¿ããããã®æ瀺ã«åºã¥ããŠé³ãåºã人ã§ããããã2ã€ã®ç¬éãæŠå¿µçã«åããŸããããã¹ã³ã¢ã®å®çŸ©ãšãã®ããã©ãŒãã³ã¹ã§ãã
//ã¹ã³ã¢ãå®çŸ©ãã
(
p = Pbind(
\midinote,Pseq([57,62,64,65,67,69],inf),
\dur,1/7
); //ããã§ã¯åçããŸããïŒ
)
//ãã¬ã€ããã¹ã³ã¢ãèŠæ±ãã
p.play;
äžèšã®äŸã®å€æ°pã¯åã«ã¹ã³ã¢ãä¿æããŸããPbind ã«ã¯éãæ¬åŒ§ã®çŽåŸã« .play ã¡ãã»ãŒãžããªãããšã«æ³šæããŠãã ããããã®æç¹ã§é³ã¯åºãŸããã2çªç®ã®ç¬éã¯ãSuperColliderã«ãã®ã¹ã³ã¢ãããã¬ã€ããããã«äŸé Œãããšãã§ãïŒp.play.
ãã®æç¹ã§ããããééãã¯ããã¬ãŒã€ãŒãåæ¢ããããšãæåŸ ã㊠p.stop ãè©Šãããšã§ãããããè©ŠããŠãããããã®ããã«æ©èœããªãããšãèªåã§ç¢ºèªããŠãã ããã次ã®æ®µèœã§ãã®çç±ãç解ã§ããŸãã
[Ctrl] + [Shift] + [P] 㧠post ãŠã£ã³ããŠãæ¶å»ãïŒå®éã«ã¯å¿ èŠãããŸãããããªãããã§ã¯ãªãã®ã§ããïŒïŒãp.play ãå床è©äŸ¡ããŸããPost ãŠã£ã³ããŠãèŠããšãçµæã EventStreamPlayer ãšåŒã°ãããã®ã§ããããšãããããŸããPbind 㧠.play ãåŒã³åºããã³ã«ãSuperCollider ã¯ãã®ã¢ã¯ã·ã§ã³ãå®çŸãããã¬ãŒã€ãŒãäœæããŸããããã EventStreamPlayer ã§ãã"ä»ãããã®æ¥œèãæŒå¥ããã"ãšèšããã³ã«ãç®ã®åã§ãã¢ãã¹ããå ·äœåãããããªãã®ã§ããããã§ããã
ãããã¯ãããã ãããã®å¿åã®ä»®æ³ãã¬ãŒã€ãŒã衚瀺ãããŠãžã§ããéå§ããåŸã¯ãããªãã¯ããã«è©±ãæ¹æ³ããããŸãããååããããŸãããããå°ãæè¡çã«èšãã°ããªããžã§ã¯ããäœæããŸããããåŸã§ãã®ãªããžã§ã¯ããåç §ããæ¹æ³ã¯ãããŸããããã¶ãããã®æç¹ã§ãp.stop ãå®è¡ããŠãããŸããããªãçç±ããããã§ãããããã¬ã€ã€ãŒãšè©±ãã®ã§ã¯ãªããã¹ã³ã¢ãšè©±ãããšããŠããããã§ãã
ã¹ã³ã¢ïŒå€æ° p ã«æ ŒçŽãããŠãã Pbind ïŒã¯ãéå§ãŸãã¯åæ¢ã«ã€ããŠäœãç¥ããŸãããããã¯åãªãã¬ã·ãã§ãããã¬ãŒã€ãŒã¯ãéå§ãåæ¢ã"æåããå§ããŠããããŸããã"ãªã©ãç¥ã£ãŠãã人ã§ããã€ãŸããEventStreamPlayer ãšè©±ãå¿ èŠããããŸããå¿ èŠãªããšã¯ãååãä»ããããšãã€ãŸãå€æ°ã«ä¿åããããšã ãã§ã ã
//ãããã®è¡ã1ã€ãã€è©ŠããŸã
~myPlayer = p.play;
~myPlayer.stop;
~myPlayer.resume;
~myPlayer.stop.reset;
~myPlayer.start;
~myPlayer.stop;
èŠçŽãããšãPbind 㧠.play ãåŒã³åºããšãEventStreamPlayer ãçæãããŸããEventStreamPlayers ãå€æ°ã«ä¿åãããšãåŸã§ãããã«ã¢ã¯ã»ã¹ããŠãã¿ãŒã³ãåå¥ã«éå§ããã³åæ¢ã§ããŸãïŒ [ctrl +.] ã䜿çšããå¿ èŠã¯ãããŸããããã¹ãŠãäžåºŠã«åŒ·å¶çµäºããŸãïŒã
ãã®ã»ã¯ã·ã§ã³ãç· ããããããè€éãªäŸããããŸããäžçªäžã®ã¡ããã£ãŒã¯ãã£ã€ã³ãã¹ããŒã®éå°å¹Žã®ããã®ã¢ã«ãã ããåçšãããŠãããããäœãã¡ããã£ãŒã察äœæ³ã§è¿œå ãããŠããŸããå³3ã¯ã楜èã®ããã»ãŒãžã瀺ããŠããŸãã
//ã¹ã³ã¢ãå®çŸ©ãã
(
var myDurs = Pseq([Pn(1,5),3,Pn(1,5),3,Pn(1,6),1/2,1/2,1,1,3,1,3] ,inf)* 0.4;
~upperMelody = Pbind(
\midinote,Pseq([69,74,76,77,79,81,Pseq([81,79,81,82,79,81],2),82,81,79,77,76,74,74 ],inf),
\dur,myDurs
);
~lowerMelody = Pbind(
\midinote,Pseq([57,62,61,60,59,58,57,55,53,52,50,49,50,52,50,55,53,52,53,55,57,58,
61,62,62 ],inf),
\dur,myDurs
);
)
// 2ã€ãäžç·ã«åçããŸãïŒ
(
~player1 =~upperMelody.play;
~player2 =~lowerMelody.play;
)
//ããããåå¥ã«åæ¢ããŸãïŒ
~player1.stop;
~player2.stop;
//ãã®ä»ã®å©çšå¯èœãªã¡ãã»ãŒãž
~player1.resume;
~player1.reset;
~player1.play;
~player1.start; // playãšåãã
ãŸããå€æ°ã®äœ¿çšã«æ³šæããŠãã ããããã®1ã€ã§ãã myDurs ã¯ããŒã«ã«å€æ°ã§ããããªãã¯ãããããŒã«ã«å€æ°ãšèŠåããããšãã§ããŸãããªããªããããã¯ãã«ã(~)ã§éå§ããããå é 㧠var ããŒã¯ãŒãã§å®£èšãããŠããŸãããã®å€æ°ã¯ãäž¡æ¹ã® Pbind ã®ãªã㧠\dur ãšããŠäœ¿çšãããå šäœã® Pseq ãä¿æããŸããmyDurs ã¯ãã¹ã³ã¢ãå®çŸ©ããæç¹ã§ã®ã¿å®éã«å¿ èŠãšãªãããããããŠããŒã«ã«å€æ°ã䜿çšããããšã¯çã«ããªã£ãŠããŸãïŒãã ããç°å¢å€æ°ãåé¡ãªãæ©èœããŸãïŒããã®äŸã§èŠãä»ã®å€æ°ã¯ç°å¢å€æ°ã§ããäžåºŠå®£èšããããšãããã㯠SuperCollider ãããã®ã©ãã§ãæå¹ã§ãã
第äºã«ãåè¿°ã®ããã«ãã¹ã³ã¢ãšãã¬ã€ã€ãŒã®åé¢ã«æ³šæããŠãã ãããPbind ãå®çŸ©ããããšãããã«ã¯åçãããŸãããéãæ¬åŒ§ã®çŽåŸã« .play ã¯ãããŸããã
å³3 pbind Tchaikovsky melodyã®å¯Ÿäœæ³ïŒ
æåã®ã³ãŒããããã¯ãè©äŸ¡ããåŸã2ã€ã® Pbind å®çŸ©ãå€æ° ~upperMelody ããã³ ~lowerMelody ã«ä¿åããã ãã§ãããã®ïŒã€ã¯ããŸã é³ãåºããŸãããåãªãã¹ã³ã¢ã§ãã~player1 =~upperMelody.play ã®è¡ã§ã¯ãäžæåŸãæŒå¥ãããžã§ããå®è¡ããããã® EventStreamPlayer ãäœæããŠããã®ãã¬ãŒã€ãŒã«ã¯ ~player1 ãšåœåããŸãã~player2 ã«ã€ããŠãåãèãã§ããããã«ãããåãã¬ãŒã€ãŒãšäŒè©±ããŠãåæ¢ãéå§ãåéãªã©ãèŠæ±ã§ããŸãã
é¢åã«ãªãæãããããããæåŸã«ããäžåºŠç¹°ãè¿ããŸãããã
â ⢠Pbind ã¯ã楜èã®ããã«é³ãåºãããã®åãªãã¬ã·ãã§ã;
â ⢠Pbind ã§ã¡ãã»ãŒãž play ãåŒã³åºããšãEventStreamPlayer ãªããžã§ã¯ããäœæãããŸãã
â ⢠ãã® EventStreamPlayer ãå€æ°ã«ä¿åãããšãåŸã§ã¢ã¯ã»ã¹ã㊠stop ã resume ãªã©ã®ã³ãã³ãã䜿çšã§ããŸãã
SuperCollider ã¯ãJava ã C++ ãšããªããªããžã§ã¯ãæåããã°ã©ãã³ã°èšèªã§ãããããäœãæå³ããã®ãã説æããã®ã¯ãã®ãã¥ãŒããªã¢ã«ã®ç¯å²ãè¶ ããŠããã®ã§ãèå³ãããã°ãŠã§ãäžã§æ€çŽ¢ã§ããããã«ããŸããããã§ã¯ãåŠç¿ããŠãããã®æ°ããèšèªãããããç解ããããã«ç¥ã£ãŠããå¿ èŠãããããã€ãã®åºæ¬çãªæŠå¿µã説æããŸãã
SuperCollider ã®ãã¹ãŠã¯ãªããžã§ã¯ãã§ããåçŽãªæ°åã§ãã SC ã®ãªããžã§ã¯ãã§ããç°ãªããªããžã§ã¯ãã¯ç°ãªãæ¹æ³ã§åäœããç°ãªãçš®é¡ã®æ å ±ãä¿æããŸãããªããžã§ã¯ãã«ã¡ãã»ãŒãžãéä¿¡ããããšã«ããããªããžã§ã¯ãããäœããã®æ å ±ãŸãã¯ã¢ã¯ã·ã§ã³ãèŠæ±ã§ããŸãã2.squared ã®ãããªãã®ãäœæãããšãã¡ãã»ãŒãž squared ã¯ã¬ã·ãŒããŒãªããžã§ã¯ã2ã«éä¿¡ãããŸãããããã®éã®ãããã¯æ¥ç¶ã確ç«ããŸãããšããã§ãã¡ãã»ãŒãžã¯ã¡ãœãããšãåŒã°ããŸãã
ãªããžã§ã¯ãã¯ã¯ã©ã¹å ã§éå±€çã«æå®ãããŸããSuperCollider ã«ã¯äºåå®çŸ©ãããã¯ã©ã¹ã®èšå€§ãªã³ã¬ã¯ã·ã§ã³ãä»å±ããŠãããããããã«ç¬èªã®ã¡ãœããã»ããããããŸãã
ãããç解ããè¯ãæ¹æ³ããããŸããAnimal ãšãããªããžã§ã¯ãã®æœè±¡ã¯ã©ã¹ããããšæ³åããŠã¿ãŸããããAnimal ã¯ã©ã¹ã¯ããã¹ãŠã®åç©ã«å ±éã®ããã€ãã®äžè¬çãªã¡ãœãã(ã¡ãã»ãŒãž)ãå®çŸ©ããŸãã幎霢ãäœéãåçãªã©ã®æ¹æ³ã䜿çšããŠãåç©ã«é¢ããæ å ±ãååŸã§ããŸãã移åãé£äºãç¡ç ãªã©ã®æ¹æ³ã¯ãåç©ã«ç¹å®ã®è¡åããããŸãããããããAnimal ã®2ã€ã®ãµãã¯ã©ã¹ãæã€ããšãã§ããŸãã1ã€ã¯ Pet ãšåŒã°ãããã1ã€ã¯ Wild ãšåŒã°ããŸãããããã®ãµãã¯ã©ã¹ã®ããããã«ã¯ãããã«å€ãã®ãµãã¯ã©ã¹ã掟çãããããšãã§ããŸã(Pet ãã掟çãã Dog ã Cat ãªã©)ããµãã¯ã©ã¹ã¯èŠªã¯ã©ã¹ãããã¹ãŠã®ã¡ãœãããç¶æ¿ããç¬èªã®æ°ããã¡ãœãããå®è£ ããŠç¹æ®ãªæ©èœãè¿œå ããŸããããšãã°ãDog ãªããžã§ã¯ããš Cat ãªããžã§ã¯ãã®äž¡æ¹ããAnimal ã¯ã©ã¹ããç¶æ¿ããã .eat ã¡ãã»ãŒãžã«å¿çããŸããDog.name ããã³ Cat.name ã¯ã次ã®ååãè¿ããŸãã
pet: ãã®ã¡ãœããã¯ãPet ãã掟çãããã¹ãŠã®ãªããžã§ã¯ãã«å ±éã§ããDog ã«ã¯ bark ã¡ãœããããããããDog.bark ãåŒã³åºããšäœããã¹ãããããããŸããCat.bark ã¯ãšã©ãŒã¡ãã»ãŒãžãã¹ããŒããŸã ïŒCat ã«ã¯ bark ã¡ãœãããçšæãããŠããªãããã§ããïŒ ïŒ
ERROR: Message âbarkâ not understood.
ããããã¹ãŠã®ä»®èª¬äŸã§ã¯ã倧æåã§å§ãŸãåèªã¯ãªããžã§ã¯ããè¡šãã¯ã©ã¹ã§ãããããã®åŸã®å°æåã®åèªã¯ããããã®ãªããžã§ã¯ãã«éä¿¡ãããã¡ãã»ãŒãžïŒãŸãã¯ã¡ãœããïŒã§ãããªããžã§ã¯ãã«ã¡ãã»ãŒãžãéä¿¡ãããšãåžžã«äœããã®æ å ±ãè¿ãããŸããæåŸã«ãã¡ãã»ãŒãžã¯åŒæ°ãåãå ¥ãã(ãŸãã¯å¿ èŠãšãã)ããšããããŸããåŒæ°ã¯ãã¡ãã»ãŒãžã®çŽåŸã«æ¬åŒ§ã§å²ãŸãããã®ã§ããCat.eat( "sardines",2)ã§ã¯ãé£ã¹ããšããã¡ãã»ãŒãžãšãäœãé£ã¹ãã®ãããšéãšããéåžžã«å ·äœçãªæ å ±ãšãšãã«ãé£ã¹ãã¡ãã»ãŒãžã Cat ã«éä¿¡ãããŠããŸãããã£ãå ã§æ瀺çã«å®£èšãããåŒæ°(ã³ãã³ã§çµããããŒã¯ãŒã)ã衚瀺ãããå ŽåããããŸããããã¯ãåŒãæ°ãäœãåç §ããŠããã®ããã³ãŒããèªã人ã«æãåºãããã®ã«äŸ¿å©ã§ããDog.bark(volumeïŒ10) ã¯ãåã« Dog.bark(10) ãããèªæã§ãã
å³4 Hypothetical class hierarchy.
OKããªããžã§ã¯ãæåããã°ã©ãã³ã°ã®ãã®è¿ éã§èã£ãœã説æã¯ããã§ååã§ãã SuperCollider ã§å®éã«å®è¡ã§ããäŸãããã€ãè©ŠããŠã¿ãŸãããã 1è¡ãã€å®è¡ããã¡ãã»ãŒãžãã¬ã·ãŒããŒãªããžã§ã¯ããããã³åŒæ°(ååšããå Žå)ãèå¥ã§ãããã©ããã確èªããŸãã åºæ¬çãªæ§é ã¯ããã®ããã¥ã¡ã³ãã®æåŸã«ãã Receiver.message(arguments) Answers ã§ãã3
[1, 2, 3, "wow"].reverse;
"hello".dup(4);
3.1415.round(0.1); // æåã®ãããã¯3.1415 4 100.randã®10é²æ°ã®ã±ãŒã¹ã§ããããšã«æ³šæããŠãã ããã//ãã®è¡ãæ°åè©äŸ¡ããŸã
// Chaining messages is fun:
100.0.rand.round(0.01).dup(4);
SuperCollider ã§åŒãèšè¿°ããæ¹æ³ã¯è€æ°ãããŸããäžèšã§èŠããã®ã¯ã¬ã·ãŒããŒè¡šèšæ³ãšåŒã°ããŸãïŒ100.rand ãããã§ãããã¯ãªããžã§ã¯ã( 100 )ãã¡ãã»ãŒãž( rand )ã«æ¥ç¶ããŸãããããã¯ããŸã£ããåãããšã rand( 100 ) ã®ããã«æžãããšãã§ããŸããããã¯é¢æ°è¡šèšæ³ãšåŒã°ããŸãã
ã©ã¡ãã®èšè¿°æ¹æ³ã§ã䜿çšã§ããŸããã¡ãã»ãŒãžã2ã€ä»¥äžã®åŒæ°ãåãå Žåã®åäœã次ã«ç€ºããŸãã
5.dup(20); // ã¬ã·ãŒããŒè¡šèš
dup(5,20); // é¢æ°è¡šèšæ³ã§ãåãããš
3.1415.round(0.1); // ã¬ã·ãŒããŒè¡šèš
round(3.1415, 0.1); // é¢æ°è¡šèš
äžèšã®äŸã§ã¯ãdup(5,20) ã"æ°å€5ã20åè€è£œ"ãšèªã¿ãround(3.1415,0.1) ã"æ°å€3.1415ã1æ¡ã®å°æ°ã«äžžãã"ãšèªã¿ãŸããéã«ãã¬ã·ãŒããŒè¡šèšããŒãžã§ã³ã¯ãâæ°å€5ã20åèªåèªèº«ãè€è£œããŸãïŒâ ( 5.dup(20) ã®å Žå )ããã³"æ°å€3.1415ãå°æ°ç¹ä»¥äž1æ¡ã«äžžããŸãïŒ" ( 3.1415.round(0.1) ã®å Žå )ãšããŠèªã¿åãããšãã§ããŸããã€ãŸããReceiver.message(argument) ã¯message(Receiver,argument) ãšåçã§ããããæžãæ¹ãä»ã®æžãæ¹ãããéžæããããšã¯ãå人ã®å¥œã¿ãšæ £ç¿ã®åé¡ã§ããããã¡ãœãããä»ã®ã¡ãœãããããæ確ãªå ŽåããããŸããã©ããªã¹ã¿ã€ã«ã奜ãããã«(ãããŠããããæ··ããŠãæ§ããŸãã)ãéèŠãªããšã¯äžè²«æ§ãä¿ã€ããšã§ããSuperColliderãŠãŒã¶ãŒã®éã§åºãŸã£ãŠããæ £ç¿ã®1ã€ã¯ãã¯ã©ã¹(倧æåã§å§ãŸãåèª)ã¯ã»ãŒåžžã« Receiver.message(argument) ãšããŠèšè¿°ãããããšã§ããããšãã°ãSinOsc.ar(440)ã¯åžžã«èŠãããŸãããar(SinOsc,440) ã¯äž¡æ¹ãšãæ£ããã«ãããããããã»ãšãã©èŠãããããšããããŸããã
æŒç¿ïŒé¢æ°è¡šèšã®ã¿ã䜿çšããŠæ¬¡ã®ã¹ããŒãã¡ã³ããæžãæããŸã
100.0.rand.round(0.01).dup(4);
åçã¯ãã®ããã¥ã¡ã³ãã®æåŸ 4
æåŸã®æŒç¿ã®è§£æ±ºçã«ããããããã®ãå¥ã®ãã®ã®äžã«ãã¹ãããããšãã§ããŸãããDavid Cottleã¯ãSuperCollider Bookã§ãã¹ãã£ã³ã°ã®åªãã説æãæã£ãŠããã®ã§ãããã§åŒçšããŸãã*
*David Cottle âBeginnerâs Tutorial.â,SuperCollider Book,MIT Press,2011,pp. 8-9
ãã¹ãã£ã³ã°ã®ã¢ã€ãã¢ãããã«æ確ã«ããããã«ãSCãæŒé£ãäœãä»®æ³çãªäŸãèããŠã¿ãŸãããã ãã®ããã«ã¯ããµãŒãã¡ãã»ãŒãžã䜿çšããŸãã åŒæ°ã¯ããµã©ããã¡ã€ã³ã³ãŒã¹ããã¶ãŒããããããŸããã ãã ãããµãŒã(ã¬ã¿ã¹ãéãããã)ãšèšãã ãã§ã¯ãæåŸ ã©ããã®çµæãåŸãããªãå ŽåããããŸãã ãããã£ãŠãå®å šã«ããããã«ããããã®åŒæ°ãæ確ã«ããããããããã¹ããããã¡ãã»ãŒãžãšåŒæ°ã«çœ®ãæããããšãã§ããŸãã
serve(toss(lettuce, tomato, cheese), bake(fish, 400, 20), mix(banana, icecream))
SCã¯ãã¬ã¿ã¹ãéããããã ãã§ãªããã¬ã¿ã¹ãããããããŒãºã®ãµã©ããæäŸããŸãã çŒãé; ããããµã³ããŒã ãããã®å éšã³ãã³ãã¯ãåæå(ã¬ã¿ã¹ãããããããŒãºãªã©)ã®message(arg)ããã¹ãããããšã§ããã«æ確ã«ããããšãã§ããŸãã åå éšã¡ãã»ãŒãžã¯çµæãçæãããã®çµæã¯å€éšã¡ãã»ãŒãžã®åŒæ°ãšããŠäœ¿çšãããŸãã
// Pseudo-code to make dinner:
serve(
toss(
wash(lettuce, water, 10),
dice(tomato, small),
sprinkle(choose([blue, feta, gouda]))
),
bake(catch(lagoon, hook, bamboo), 400, 20),
mix(
slice(peel(banana), 20),
cook(mix(milk, sugar, starch), 200, 10)
)
);
ãã¹ãã«è€æ°ã®ã¬ãã«ãããå Žåãæ確ã«ããããã«æ°ããè¡ãšã€ã³ãã³ãã䜿çšã§ããŸããäžéšã®ã¡ãã»ãŒãžãšåŒæ°ã¯1è¡ã«æ®ãããäžéšã¯1è¡ã«1ã€ã®åŒæ°ãä»ããŠå±éãããŸããåã€ã³ãã³ãã¬ãã«ã¯ããã¹ãã®ã¬ãã«ã瀺ãå¿ èŠããããŸãã(ã³ãŒãã®ãããéã«ã¯ãä»»æã®éã®ç©ºçœ(æ¹è¡ãã¿ãããŸãã¯ã¹ããŒã¹)ãå ¥ããããšãã§ããŸãã)
[å€é£ã®äŸ]ã©ã³ãããã°ã©ã ã§ã¯ãã¬ã¿ã¹ãæ°Žã§10åéæŽæµãããµã©ãããŠã«ã«æããŠããŒãºãæ¯ããããåã«ããããã现ããåãããã«æ瀺ãããŠããŸãããŸããéãæãŸããå ŽæãšããµãŒãã³ã°ã®åã«20åé400床ã§çŒãå Žæãªã©ãæå®ããŸããã
ãã®ã¹ã¿ã€ã«ã®ã³ãŒãã"èªã¿åã"ã«ã¯ãæãå åŽã®ãã¹ããããã¡ãã»ãŒãžããéå§ããé£ç¶ããåã¬ã€ã€ãŒã«ç§»åããŸãã 以äžã¯ãæãå åŽã®ã¡ãã»ãŒãžãå€åŽã®ã¡ãã»ãŒãžå ã«ãã¹ããããæ¹æ³ã瀺ãããã«èª¿æŽãããäŸã§ãã
exprand(1.0,1000.0);
dup({exprand(1.0,1000.0)},100);
sort(dup({exprand(1.0,1000.0)},100));
round(sort(dup({exprand(1.0,1000.0)},100)),0.01);
以äžã®ã³ãŒãã¯ããã¹ãã®å¥ã®äŸã§ãã ç¶ã質åã«çããŠãã ããã æ°åãäœãããŠããã®ãã説æããå¿ èŠã¯ãããŸãããã¿ã¹ã¯ã¯ããã¹ãã®åå±€ã§åŒæ°ãèå¥ããããšã§ãã (äŸãšæŒç¿ã®è³ªåãCottleã®ãã¥ãŒããªã¢ã«ããåçšããããããã«ä¿®æ£ãããŠããŸãã)
// ãã¹ããšé©åãªã€ã³ãã³ã
(
{
CombN.ar(
SinOsc.ar(
midicps(
LFNoise1.ar(3, 24,
LFSaw.ar([5, 5.123], 0, 3, 80)
)
),
0, 0.4
),
1, 0.3, 2)
}.play;
)
a) LFNoise1.ar ã®2çªç®ã®åŒæ°ã¯äœçªã§ããïŒ
b) LFSaw.ar ã®æåã®åŒæ°ã¯äœã§ããïŒ
c) LFNoise1.ar ã®3çªç®ã®åŒæ°ã¯äœã§ããïŒ
d) midicps ã«ã¯ããã€ã®åŒæ°ããããŸããïŒ
e) SinOsc.ar ã®3çªç®ã®åŒæ°ã¯äœã§ããïŒ
f) CombN.ar ã®2çªç®ãš3çªç®ã®åŒæ°ã¯äœã§ããïŒ
åçã«ã€ããŠã¯ããã®ããã¥ã¡ã³ãã®æåŸãåç §ããŠãã ããã5
ãã³ãïŒ |
---|
äœããã®çç±ã§ã³ãŒããé©åãªã€ã³ãã³ãã倱ã£ãå Žåã¯ããã®ãã¹ãŠãéžæããŠã¡ãã¥ãŒãã[Edit]â[Autoindent Line or RegionïŒè¡ãŸãã¯é åã®èªåã€ã³ãã³ãïŒ]ãéžæãããšä¿®æ£ãããŸãã |
å²ãã«ã¯4ã€ã®ã¿ã€ãããããŸãïŒ( parentheses )ã[ brackets ]ã{ braces }ãããã³ "åŒçšç¬Š" ã
éãããã®ã¯ãããããåŸã§éããå¿ èŠããããŸããããã¯"ãã©ã³ã¹"ãšåŒã°ããŸããã€ãŸããã³ãŒãå šäœã§é©åã«äžèŽãããšã³ã¯ããŒãžã£ãŒã®ãã¢ãç¶æããŸãã
SuperCollider IDE ã¯ããã¢ãéãããšãäžèŽãããã£ã (ãã£ããšãã£ã) ãèªåçã«ç€ºããŸãããããã¯èµ€ã§è¡šç€ºãããŸããéå§/çµäºã®äžèŽããªãæ¬åŒ§ãã¯ãªãã¯ãããšãäœãã足ããªãããšã瀺ãæ¿ãèµ€è²ã®éžæã衚瀺ãããŸãã
ãã©ã³ã·ã³ã°ã¯ãè©äŸ¡ãåé€ããŸãã¯ã³ããŒ/貌ãä»ãæäœã®ããã«ã³ãŒãã®å€§ããªã»ã¯ã·ã§ã³ãéžæããç°¡åãªæ¹æ³ã§ããéãæ¬åŒ§ãŸãã¯éãæ¬åŒ§(æ¬åŒ§ãšæ¬åŒ§)ãããã«ã¯ãªãã¯ããŠãäžã®ãã¹ãŠãéžæã§ããŸãã
åŒçšç¬Šã¯ãäžé£ã®æå(ã¹ããŒã¹ãå«ã)ãåäžã®åäœãšããŠå²ãããã«äœ¿çšãããŸãããããã¯æååãšåŒã°ããŸããäžéåŒçšç¬Šã¯ãæååãšã¯ãããã«ç°ãªãã·ã³ãã«ãäœæããŸããèšå·ã¯ãããã¹ãã®çŽåã«ããã¯ã¹ã©ãã·ã¥ãä»ããŠäœæããããšãã§ããŸãããããã£ãŠã'greatSymbol' ãš\greatSymbol ã¯åçã§ãã
"ããã¯çŽ æµãªæååã§ã";
'greatSymbol';
æ¬åŒ§ã¯æ¬¡ã®ç®çã§äœ¿çšã§ããŸãã
-
åŒæ°ãªã¹ããå²ãïŒrrand(0,10);
-
匷å¶ã®åªå é äœïŒ5 +(10 * 4);
-
ã³ãŒããããã¯ãäœæããŸã(äžç·ã«è©äŸ¡ãããè€æ°è¡ã®ã³ãŒã)ã
è§æ¬åŒ§ã¯ã[1,2,3,4, "hello"]ã®ãããªã¢ã€ãã ã®ã³ã¬ã¯ã·ã§ã³ãå®çŸ©ããŸãããããã¯éåžžãé åãšåŒã°ããŸããé åã«ã¯ãæ°åãæååãé¢æ°ããã¿ãŒã³ãªã©ãäœã§ãå«ããããšãã§ããŸãã
é åã¯ããªããŒã¹ãã¹ã¯ã©ã³ãã«ããã©ãŒãªã³ã°ãéžæãªã©ã®ã¡ãã»ãŒãžãç解ããŸããé åã«å¯ŸããŠæ°åŠæŒç®ãå®è¡ããããšãã§ããŸãã
[1,2,3,4, "hello"].scramble;
[1,2,3,4, "hello"].mirror;
[1,2,3,4].reverse + 10;
// midiãHzåäœã®åšæ³¢æ°ã«å€æ
[60,62,64,65,67,69,71].midicps.round(0.1);
Arrays ã®è©³çŽ°ã«ã€ããŠã¯ãã»ã¯ã·ã§ã³22ã§è¿æ¥å ¬éäºå®ã§ãã
äžæ¬åŒ§(ãŸãã¯"äžæ¬åŒ§")ã¯é¢æ°ãå®çŸ©ããŸããé¢æ°ã¯ãããããè€æ°å䜿çšããã³åå©çšãããäœããã®çš®é¡ã®æäœãŸãã¯ã¿ã¹ã¯ãã«ãã»ã«åãããã®ãã³ã«ç°ãªãçµæãè¿ãå¯èœæ§ããããŸãã以äžã®äŸã¯ãSuperCollider bookããã®ãã®ã§ãã
exprand(1,1000.0);
{exprand(1,1000.0)}
David Cottle ã圌ã®äŸã玹ä»ããŸã: "æåã®è¡ã¯ã©ã³ãã ãªæ°åãéžæããŸãããã㯠Post ãŠã£ã³ããŠã«è¡šç€ºãããŸãã2çªç®ã¯ããŸã£ããç°ãªãçµæãã€ãŸãé¢æ°ãåºåããŸããé¢æ°ã¯äœãããŸããïŒ ä¹±æ°ãéžæããŸãããã®éãã¯ã©ã®ããã«ã³ãŒãã«åœ±é¿ããŸããïŒ ä»¥äžã®è¡ãèæ ®ããŠãã ãããæåã¯ä¹±æ°ãéžæããŠè€è£œããŸãã2çªç®ã¯ä¹±æ°æœåºé¢æ°ã5åå®è¡ããçµæãé åã«åéããŸãã" *
rand(1000.0).dup(5); // çªå·ãéžæããŠè€è£œããŸã
{rand(1000.0)}.dup(5); // æ°åãéžã¶æ©èœãè€è£œããŸã
{rand(1000.0)}.dup(5).round(0.1); // äžèšã®ãã¹ãŠããããŠã©ãŠã³ã
// æ¬è³ªçã«ããã(åæ§ã®çµæããããŸã)
[rand(1000.0),rand(1000.0),rand(1000.0),rand(1000.0),rand(1000.0)]
*David Cottle "Beginnerâs Tutorial." SuperCollider Book,MIT Press,2011,p.13.
æ©èœã«ã€ããŠã¯ãããããä»ã®ãšããããã¹ãŠã®å¯èœãªãšã³ã¯ããŒãžã£ãŒã®æŠèŠã¯æ¬¡ã®ãšããã§ãã
ã³ã¬ã¯ã·ã§ã³ [list, of, items]
é¢æ° {ãã°ãã°è€æ°è¡ã®ã³ãŒã}
æåå "åŒçšç¬Šå ã®åèª"
ã·ã³ãã« 'åäžåŒçšç¬Š'ãŸãã¯\ããã¯ã¹ã©ãã·ã¥ãåã«ä»ããŠãã
éšãéã£ãŠããå Žåã¯ãå€åºãããšãã«åããã¡ãŸããæŽããŠããå Žåã¯ããµã³ã°ã©ã¹ãã€ããŸããç§ãã¡ã®æ¥ã ã¯ããã®ãããªææ決å®ã«æºã¡ãŠããŸããããã°ã©ãã³ã°ã§ã¯ããããã¯ã³ãŒããäœããã®æ¡ä»¶ããã¹ãããªããã°ãªããªãç¬éã§ããããã¹ãã®çµæïŒtrueãŸãã¯falseïŒã«å¿ããŠç°ãªãäžé£ã®ã¢ã¯ã·ã§ã³ãå®è¡ããå¿ èŠããããŸããæ¡ä»¶æ§é ã«ã¯å€ãã®çš®é¡ããããŸããif / else ãš case ã®2ã€ã®åçŽãªãã®ãèŠãŠã¿ãŸãããã
SCã® if / else ã®æ§æã¯ãif(condition,{true action},{false action}) ã§ããæ¡ä»¶ã¯ããŒã«ãã¹ãã§ãïŒtrueãŸãã¯falseãè¿ãå¿ èŠããããŸãïŒããã¹ããtrueãè¿ãå Žåãæåã®é¢æ°ãè©äŸ¡ãããŸã; ãã以å€ã®å Žåã2çªç®ã®é¢æ°ã¯ãè©ŠããŠã¿ãŠãã ããïŒ
// if / else
if(100> 50,{"éåžžã«ç".postln},{"éåžžã«åœ".postln});
SuperCollider book *ããåçšãã以äžã®è¡šã¯ã䜿çšã§ããäžè¬çãªããŒã«æŒç®åã瀺ããŠããŸããåäžã®çå·(x = 10)ãš2ã€ã®çå·(x == 10)ã®éãã«æ³šæããŠãã ãããã·ã³ã°ã«ãµã€ã³ã¯"å€æ°xã«10ãå²ãåœãŠã"ããšãæå³ããããã«ãµã€ã³ã¯"xã10ã«çããã"ãæå³ããŸããtrue ãŸã㯠false ã«ã©ã ããããã€ãã®äŸãå ¥åããŠå®è¡ãããšãå®éã« true ãŸã㯠false ã®çµæã衚瀺ãããŸã Post ãŠã£ã³ããŠã
Symbol | Meaning | True Example | False Example |
---|---|---|---|
== | equal to? | 10 == 10 | 10 == 99 |
!= not | equal to? | 10 != 99 | 10 != 10 |
> | greater than? | 10 > 5 | 10 > 99 |
< | less than? | 10 < 99 | 10 < 5 |
>= | greater than or equal to? | 10 >= 10, 10 >= 3 | 10 >= 99 |
<= | less than or equal to? | 10 <= 99, 10 <= 10 | 10 <= 9 |
odd | is it odd? | 15.odd | 16.odd |
even | is it even? | 22.even | 21.even |
isInteger | is it an integer? | 3.isInteger | 3.1415.isInteger |
isFloat | is it a float? | 3.1415.isFloat | 3.isFloat |
and | both conditions | 11.odd.and(12.even) | 11.odd.and(13.even) |
or | either condition | or(1.odd, 1.even) | or(2.odd, 1.even) |
æåŸã®2è¡( and, or )ã¯ãã¬ã·ãŒããŒè¡šèšãŸãã¯é¢æ°è¡šèšã®ããããã§é·ãåŒãèšè¿°ããæ¹æ³ã瀺ããŠããŸãã
å¥ã®æçšãªæ§é ã¯ãcase ã§ãããã¹ãã®1ã€ã true ãè¿ããŸã§é çªã«è©äŸ¡ãããé¢æ°ã®ãã¢ãå®çŸ©ããããšã§æ©èœããŸãã
*Cottle, D. âBeginnerâs Tutorial.â The SuperCollider Book, MIT Press, 2011, p. 33
Case
{test1} {action1} {test2} {action2} {test3} {action3} . . . {testN} {actionN};
åãã¹ãå ã®åŒã¯ãtrue ãŸã㯠false ãè¿ãå¿ èŠããããŸãã test1 ã false ãè¿ãå Žåãããã°ã©ã 㯠action1 ãç¡èŠããtest2 ã«é²ã¿ãŸãã false ã®å Žåãaction2 ãç¡èŠãããtest3 ã«é²ã¿ãŸãã ãããçã§ããããšãå€æããå Žåãaction3 ãå®è¡ãããã±ãŒã¹ã¯åæ¢ããŸã(ãã以äžã®ãã¹ããŸãã¯ã¢ã¯ã·ã§ã³ã¯å®è¡ãããŸãã)ã é¢æ°éã«ã³ã³ãããªãããšã«æ³šæããŠãã ããã case ã¹ããŒãã¡ã³ãã®çµããã瀺ãããã«ãæåŸã«ã»ãã³ãã³ ; ã䜿çšããã ãã§ãã
// case
(
~num = -2;
case
{~num == 0} {"WOW".postln}
{~num == 1} {"ONE!".postln}
{~num < 0} {"negative number!".postln}
{true} {"last case scenario".postln};
)
äžèšã®ã³ãŒããå€æŽããŠãèãããããã¹ãŠã®çµæãååŸããŠãã ããã äžèšã®äŸã®ã±ãŒã¹ã®æåŸã®è¡ã«ãã䟿å©ãª(ããã³ãªãã·ã§ã³ã®)ããªãã¯ã«æ³šæããŠãã ãããtrue ã¯åžžã« true ã«è©äŸ¡ããããããåã®æ¡ä»¶ããã¹ãŠ falseã«ãªã£ãå Žåã«åžžã«çºçãã"æåŸã®ã±ãŒã¹ã·ããªãª"ã¢ã¯ã·ã§ã³ãå®çŸ©ã§ããŸãã 詳现ã«ã€ããŠã¯ãå¶åŸ¡æ§é ã®ãã«ããã¡ã€ã«ãã芧ãã ããã
åãã¿ã¹ã¯ãæ°åå®è¡ããŠããããšã«æ°ä»ããããåå©çšå¯èœãªé¢æ°ãäœæããã®ããããããããŸãã é¢æ°ã¯ã"ãšã³ã¯ããŒãžã£ãŒ"ã»ã¯ã·ã§ã³ã§åŠç¿ããããã«ãäžæ¬åŒ§å ã«èšè¿°ããããã®ã§ããDavid Touretzky ã¯ã次ã®ããã«é¢æ°ã®æŠå¿µã玹ä»ããŠããŸãã"é¢æ°ã¯ãããŒã¿ãæµããããã¯ã¹ãšããŠèããŠãã ãããé¢æ°ã¯äœããã®æ¹æ³ã§ããŒã¿ãæäœãããã®çµæãæµåºããŸãã" *
å³5ïŒé¢æ°ã®äžè¬çãªèãæ¹ã
以äžã®äŸã®æåã®è¡ã¯ãé¢æ°ãå®çŸ©ãããããå€æ°fã«å²ãåœãŠãŸãã2è¡ç®ã¯ãé¢æ°ãæ©èœãããŸãã
f = { 2 + 2 }; // é¢æ°ãå®çŸ©ããŸã
f.value; // é¢æ°ãæ©èœããã
äžèšã®é¢æ°ã¯ã1ã€ã®ããš(2ãš2ãè¿œå )ãè¡ãæ¹æ³ããããããªããããããã»ã©äŸ¿å©ã§ã¯ãããŸããã éåžžã¯ãå ¥ååŒæ°ã«å¿ããŠç°ãªãçµæãåŸãããé¢æ°ãå®çŸ©ããŸãã ããŒã¯ãŒã arg ã䜿çšããŠãé¢æ°ãåãå ¥ããããšãã§ããå ¥åãæå®ããŸãã
以äžã®äŸã¯ãå³5ã®å³é¢ã«äŒŒãŠããŸãã
f = {arg a, b; ["a plus b", a+b, "a times b", a*b].postln}; // é¢æ°ãå®çŸ©
f.value(3, 7); // ããã§ãé¢æ°ã®åŒæ°ãšããŠä»»æã®2ã€ã®æ°å€ãæå®ã§ããŸã
f.value(10, 14);
// æ¯èŒïŒ
~sillyRand = rrand(0, 10); // é¢æ°ã§ã¯ãããŸãã
~sillyRand.value; // è€æ°åè©äŸ¡
~sillyRand2 = {rrand(0, 10)}; // é¢æ°
~sillyRand2.value; // æ°åè©äŸ¡ãã
*Touretzky, David. COMMON LISP: A Gentle Introduction to Symbolic Computation. The Benjamin/Cummings Publishing Company, Inc, 1990, p. 1. ãã®ãã¥ãŒããªã¢ã«ã®ã¿ã€ãã«ã«åœ±é¿ãäžããæ¬ã§ãã
æåŸã®äŸãšããŠãéåžžã«äŸ¿å©ãªé¢æ°ã1ã€ç€ºããŸãã
//ãã®é¢æ°ã䜿çšããŠãå€ã®æ¥ãéããæ¹æ³ã決å®ããŸã
(
~whatToDo = {
var today, dayName, actions;
today = Date.getDate.dayOfWeek;
dayName =
case
{today==0} {"Sunday"}
{today==1} {"Monday"}
{today==2} {"Tuesday"}
{today==3} {"Wednesday"}
{today==4} {"Thursday"}
{today==5} {"Friday"}
{today==6} {"Saturday"};
actions = ["boomerang throwing", "arm wrestling", "stair climbing", "playing
chess", "underwater hockey", "pea shooting", "a nap marathon"];
"Ah, " ++ dayName ++ "...! " ++ "What a good day for " ++ actions.choose;
};
)
// æã«å®è¡ãã
~whatToDo.value;
ãã³ãïŒ |
---|
é¢æ°ã®å é ã§åŒæ°ã宣èšããå¥ã®äžè¬çãªè¡šèšæ³ã¯æ¬¡ã®ãšããã§ãã |
f={| a,b | a + b}
â ããã¯ã
f = {arg a, b; a + b}
â ãšåçã§ãã
é åã¯ãSuperCollider ã§æãäžè¬çãªã¿ã€ãã®ã³ã¬ã¯ã·ã§ã³ã§ãã[0,1,2]ã®ããã«ãè§ãã£ãã§å²ãŸããã¢ã€ãã ã®ã³ã¬ã¯ã·ã§ã³ãèšè¿°ãããã³ã«ããã㯠Array ã¯ã©ã¹ã®ã€ã³ã¹ã¿ã³ã¹ã«ãªããŸããå€ãã®å ŽåãããŸããŸãªæ¹æ³ã§é åãæäœããŸããé åãç解ã§ããèå³æ·±ãã¡ãœããã®äžéšã以äžã«ç€ºããŸãã
// é
åãäœæãã
a = [10, 11, 12, 13, 14, 15, 16, 17];
a.reverse; // ãªããŒã¹
a.scramble; // ã¹ã¯ã©ã³ãã«
a.choose; // ã©ã³ãã ã«1ã€ã®èŠçŽ ãéžæããŸã
a.size; // é
åã®ãµã€ãºãè¿ããŸã
a.at(0); // æå®ãããäœçœ®ã®ã¢ã€ãã ãååŸããŸã
a[0] ; // åäž
a.wrapAt(9); // æå®ãããäœçœ®ã«ããã¢ã€ãã ãååŸãã> a.sizeã®å Žåã¯æãè¿ããŸã
["wow", 99] ++ a; // 2ã€ã®é
åãæ°ãããã®ã«é£çµããŸã
a ++ \hi; // ã·ã³ãã«ã¯åäžã®æåã§ã
a ++ 'hi'; // ã·ã³ãã«ã¯åäžã®æåã§ã
a ++ "hi"; // æååã¯æåã®ã³ã¬ã¯ã·ã§ã³ã§ã
a.add(44); // æåŸã«æ°ããèŠçŽ ãæã€æ°ããé
åãäœæããŸã
a.insert(5, "wow"); // äœçœ®5ã«"wow"ãæ¿å
¥ããä»ã®ã¢ã€ãã ãåæ¹ã«ããã·ã¥ããŸã(æ°ããé
åãè¿ããŸã)
a; // ãããè©äŸ¡ããäžèšã®æäœã®ã©ããå®éã«å
ã®é
åãå€æŽããŠããªãããšã確èªããŸã
a.put(2, "oops"); // ã€ã³ããã¯ã¹2ã« "oops"ã眮ããŸã(destructive;äžã®è¡ãããäžåºŠè©äŸ¡ããŠç¢ºèªããŸã)
to check)
a.permute(3); // äœçœ®3ã®ã¢ã€ãã ã¯äœçœ®0ã«ç§»åããéãåæ§ã§ã
a.mirror; // ãããåæã«ããŸã
a.powerset; // é
åã®èŠçŽ ã®ãã¹ãŠã®å¯èœãªçµã¿åãããè¿ããŸã
é åã䜿çšããŠæ°åŠãè¡ãããšãã§ããŸãïŒ
[1, 2, 3, 4, 5] + 10;
[1, 2, 3, 4, 5] * 10;
([1, 2, 3, 4, 5] / 7).round(0.01); // åªå
é äœã®æ¬åŒ§ã«æ³šæããŠãã ãã
x = 11; y = 12; // ããã€ãã®å€æ°ãè©ŠããŸã
[x, y, 9] * 100;
// ãã ããé©åãªæ°å€ã§ã®ã¿æ°åŠãè¡ãããã«ããŠãã ãã
[1, 2, 3, 4, "oops", 11] + 10; // å¥åŠãªçµæ
ã¯ã©ã¹ Array ã䜿çšããŠæ°ããã³ã¬ã¯ã·ã§ã³ãäœæããããã€ãã®æ¹æ³ã次ã«ç€ºããŸãã
// ç®è¡çŽæ° Arithmetic series
Array.series(size: 6, start: 10, step: 3);
// 幟äœçŽæ° Geometric series
Array.geom(size: 10, start: 1, grow: 2);
// 2ã€ãæ¯èŒããïŒ
Array.series(7, 100, -10); // 7ã¢ã€ãã ; 100ããéå§ã-10ã®ã¹ããã
Array.geom(7, 100, 0.9); // 7ã¢ã€ãã ; 100ããéå§ãæ¯å0.9åãã
// .fillã¡ãœãããæºãã
Array.fill(10, "same");
// æ¯èŒã:
Array.fill(10, rrand(1, 10));
Array.fill(10, {rrand(1, 10)}); // é¢æ°ã¯10ååè©äŸ¡ãããŸã
// .fillã¡ãœããã®é¢æ°ã¯ãã«ãŠã³ã¿ãŒã§ããããã©ã«ãã®åŒæ°ãåãããšãã§ããŸãã
// åŒæ°åã¯äœã§ãæ§ããŸããã
Array.fill(10, {arg counter; counter * 10});
// ããšãã°ãé«èª¿æ³¢åšæ³¢æ°ã®ãªã¹ããçæããŸãïŒ
Array.fill(10, {arg wow; wow+1 * 440});
// .newClearã¡ãœãã
a = Array.newClear(7); // æå®ããããµã€ãºã®ç©ºã®é
åãäœæããŸã
a[3] = "wow"; // a.put(3, "wow")ãšåã
ä»ã®äººã®ã³ãŒãã«30ïŒ4ã®ãããªãã®ã衚瀺ãããã®ã¯æéã®åé¡ã§ãããã®ã·ã§ãŒãã«ããè¡šèšã¯ãåãã¢ã€ãã ãå«ãé åãäœåºŠãäœæããã ãã§ãã
// ã·ã§ãŒãã«ããè¡šèš :
30!4;
"hello" ! 10;
// 以äžãšåãçµæãåŸãããŸã:
30.dup(4);
"hello".dup(10);
// ãŸãã¯
Array.fill(4, 30);
Array.fill(10, "hello");
é åã®äœæã«äœ¿çšããããã1ã€ã®äžè¬çãªæ§æã®ã·ã§ãŒãã«ããã次ã«ç€ºããŸãã
// ããã¯?
(50..79);
// ç®è¡çŽæ°ã®é
åãçæããã·ã§ãŒãã«ããã§ã
// äžèšã®çµæã¯æ¬¡ãšåãã§ã:
series(50, 51, 79);
// ãŸãã¯
Array.series(30, 50, 1);
// 1以å€ã®ã¹ãããã®å Žåããããè¡ãããšãã§ããŸã:
(50, 53 .. 79); // step of 3
// åãçµæ:
series(50, 53, 79);
Array.series(10, 50, 3);
åã³ãã³ãã¯ããããã«ç°ãªãèãæ¹ãæ瀺ããŠããããšã«æ³šæããŠãã ããã(50..79)ã䜿çšãããšã"50~79ã®é åãæå®ããŠãã ãã"ãšããããã«èããããšãã§ããŸããé åã«å«ãŸããã¢ã€ãã ã®æ°ãå¿ ãããèæ ®ããå¿ èŠã¯ãããŸãããäžæ¹ãArray.seriesã䜿çšãããšã"åèšã§30åã®ã¢ã€ãã ãå«ãé åã50åããã«ãŠã³ãã¢ããããŠãã ãã"ãšèããããšãã§ããŸããã·ãªãŒãºã®æåŸã®çªå·ã誰ã«ãªãããå¿ ãããèããå¿ èŠã¯ãããŸããã
ãŸããã·ã§ãŒãã«ããã§ã¯è§æ¬åŒ§ã§ã¯ãªãæ¬åŒ§ã䜿çšãããããšã«æ³šæããŠãã ããããã¡ãããçµæã®é åã¯è§æ¬åŒ§ã§å²ãŸããŸãã
å€ãã®å Žåãã³ã¬ã¯ã·ã§ã³ã®ãã¹ãŠã®ã¢ã€ãã ã«å¯ŸããŠäœããã®ã¢ã¯ã·ã§ã³ãå®è¡ããå¿ èŠããããŸããããã«ã¯ã¡ãœããdoã䜿çšã§ããŸãã
~myFreqs = Array.fill(10, {rrand(440, 880)});
// ããã§ããªã¹ãã®ãã¹ãŠã®é
ç®ã§ç°¡åãªã¢ã¯ã·ã§ã³ãå®è¡ããŸããã:
~myFreqs.do({arg item, count; ("Item " ++ count ++ " is " ++ item ++ " Hz. Closest
midinote is " ++ item.cpsmidi.round).postln});
// ã«ãŠã³ã¿ãŒãå¿
èŠãªãå Žåã¯ã1ã€ã®åŒæ°ã䜿çšããŸãïŒ
~myFreqs.do({arg item; {SinOsc.ar(item, 0, 0.1)}.play});
~myFreqs.do({arg item; item.squared.postln});
// ãã¡ããã次ã®ããã«æåŸã®1ã€ãšåããããç°¡åãªããšãã§ããŸã:
~myFreqs.squared;
èŠçŽãããšãé åã"do"ãããšãé¢æ°ãæäŸãããŸããã¡ãã»ãŒãždoã¯ãé åã®ã¢ã€ãã ãç¹°ãè¿ãåŠçãããã®é¢æ°ãæ¯åè©äŸ¡ããŸãããã®é¢æ°ã¯ãããã©ã«ãã§2ã€ã®åŒæ°ãåãããšãã§ããŸããçŸåšã®å埩ã§ã®é åé ç®ãšãå埩åæ°ã远跡ããã«ãŠã³ã¿ãŒã§ãããããã®åŒæ°ã®ååã¯å¥œããªãã®ã«ããããšãã§ããŸããããããã¯åžžã«ãã®é åºã§ã: item, count.
ã¡ãœãã collect ãåç §ããŠãã ãããããã¯ãdo ãšéåžžã«äŒŒãŠããŸããããã¹ãŠã®äžéçµæãå«ãæ°ããã³ã¬ã¯ã·ã§ã³ãè¿ããŸãã
ãã«ããã¡ã€ã«ã掻çšããæ¹æ³ãåŠã³ãŸããå€ãã®å Žåãåãã«ãããŒãžã®äžéšã«åœ¹ç«ã€äŸããããŸããæåã«ããã¹ãã®èª¬æãå®å šã«ç解ããŠããªãå Žåã§ãã(ãŸãã¯ç¹å¥ã«)äžã«ã¹ã¯ããŒã«ããŠãã§ãã¯ã¢ãŠãããŠãã ããããã«ããã©ãŠã¶ãŒãããµã³ãã«ãçŽæ¥å®è¡ããããã³ãŒããã³ããŒããŠæ°ãããŠã£ã³ããŠã«è²Œãä»ããŠåçããããšãã§ããŸãã
SuperCollider ã³ãŒãã§æå¹ãªã¯ã©ã¹ãŸãã¯ã¡ãœãããéžæã(åèªãããã«ã¯ãªãã¯ããŠéžæããŸã)ã[ctrl + D]ãæŒããŠå¯Ÿå¿ãããã«ããã¡ã€ã«ãéããŸããã¯ã©ã¹å(ããšãã°ãMouseX)ãéžæãããšãã¯ã©ã¹ã®ãã«ããã¡ã€ã«ã衚瀺ãããŸããã¡ãœãããéžæãããšããã®ã¡ãœãããç解ããã¯ã©ã¹ã®ãªã¹ãã衚瀺ãããŸã(ããšãã°ãã¡ãœãã scramble ã®ãã«ãã衚瀺ãããŸã)ã*
*泚æïŒSuperColliderã¯å€§æåã§å§ãŸãåèªãéè²ã§è¡šç€ºããŸãããã®ãéè² ã¯ãåèªã«ã¿ã€ããã¹ããªãããšãä¿èšŒãããã®ã§ã¯ãããŸãããããšãã°ãSinosc (å°æåã® "o"ãééãã) ãå ¥åãããšãéè²ã§è¡šç€ºãããŸãã
SuperCollider IDEã§ãã«ããã¡ã€ã«ãæ¢çŽ¢ããä»ã®æ¹æ³ã¯ã"Browse" ããã³ "Search" ãªã³ã¯ã§ãã[Browse] ã䜿çšããŠãã¡ã€ã«ãã«ããŽãªå¥ã«ç§»åãã[Search] ã䜿çšããŠãã¹ãŠã®ãã«ããã¡ã€ã«å ã®åèªãæ€çŽ¢ããŸããSuperCollider IDE ã®ãã«ããã©ãŠã¶ã«é¢ããéèŠãªæ³šæïŒ
-
å³äžã®ãã£ãŒã«ã(âFind...âãšè¡šç€º)ã䜿çšããŠãçŸåšéããŠãããã«ããã¡ã€ã«å ã®ç¹å®ã®åèªãæ€çŽ¢ããŸã(Webãµã€ãã§"æ€çŽ¢"ãå®è¡ããå Žåãªã©)ã
-
[Search]ãªã³ã¯(âBrowseâã®å³åŽ)ã䜿çšããŠããã¹ãŠã®ãã«ããã¡ã€ã«ã§ããã¹ããæ€çŽ¢ããŸãã
æåã«æ¬åŒ§ãéããŠç¹å®ã®ã¡ãœããã«åŒæ°ãè¿œå ãããšãSCã¯å°ããª"ããŒã«ãã³ããã«ã"ã衚瀺ããŠãäºæ³ãããåŒæ°ãäœã§ãããã瀺ããŸããããšãã°ãå³6ã«è¡šç€ºãããè¡ã®å é ãå ¥åããŸããæåã®ãã£ããéããçŽåŸã«ãSinOsc.arã®åŒæ°ãfreq,phase,mul, ããã³ add ã§ããããšã瀺ãããŒã«ãããã衚瀺ãããŸãããŸããããã©ã«ãå€ãäœã§ãããã瀺ããŠããŸããããã¯ãSinOscãã«ããã¡ã€ã«ããååŸããæ å ±ãšãŸã£ããåãã§ããããŒã«ããããæ¶ããå Žåã¯ã[ctrl + Shift + Space] ã§å ã«æ»ãããšãã§ããŸãã
å³6ïŒå ¥åãããšåœ¹ç«ã€æ å ±ã衚瀺ãããŸã
å¥ã®ã·ã§ãŒãã«ããïŒåŒæ°ã«æ瀺çã«ååãä»ãããå Žå ( SinOsc.ar(freqïŒ890) ãªã© )ãæ¬åŒ§ãéããçŽåŸã«ã¿ãããŒãæŒããŠã¿ãŠãã ãããSCã¯å ¥åæã«æ£ããåŒæ°åãé çªã«å ¥åããŸã(åŸç¶ã®åŒæ°åã®ã³ã³ãã®åŸã«ã¿ããæŒããŸã)ã
ãã³ãïŒ |
---|
ç¬èªã®"ããŒãœãã©ã€ãºããããã«ããã¡ã€ã«"ãå«ããã©ã«ããŒãäœæããŸããæ°ããããªãã¯ãèŠã€ããããæ°ãããªããžã§ã¯ããåŠç¿ããããããšãã¯ãèªåã®èšèã§èª¬æããç°¡åãªäŸãæžããå°æ¥ã®ããã«ä¿åããŸããä»ãã1ãæãŸãã¯1幎åŸã«äŸ¿å©ã«ãªããããããŸããã |
ãŸã£ããåããã«ããã¡ã€ã«ã¯ããªã³ã©ã€ã³ã§èŠã€ããããšãã§ããŸããhttpïŒ//doc.sccode.org/
ãã®æç¹ã§ãSuperColliderã«ã€ããŠãã§ã«å€ãã®ããšãç¥ã£ãŠããŸãããã®ãã¥ãŒããªã¢ã«ã®æåŸã®éšåã§ã¯ãå€æ°ãããšã³ã¯ããŒãžã£ãŒãŸã§ãèšèªèªäœã«ã€ããŠã®è©³çŽ°ã玹ä»ããŸããããŸãããã¿ãŒã³ãã¡ããªã®ããã€ãã®ã¡ã³ããŒã䜿çšããŠãèå³æ·±ãPbind ãäœæããæ¹æ³ãåŠã³ãŸããã
ãã¥ãŒããªã¢ã«ã®ãã®éšåã§ã¯ã(æçµçã«ã¯ïŒ)SuperColliderã䜿çšãããµãŠã³ãã®åæãšåŠçã«ã€ããŠèª¬æããŸãããŠããããžã§ãã¬ãŒã¿ãŒ( UGens )ã®ãããã¯ããå§ããŸãã*
ã»ã¯ã·ã§ã³3ããã³ã»ã¯ã·ã§ã³18ã§ãããã€ãã®ãŠããããžã§ãã¬ãŒã¿ãŒ( UGens )ãåäœããŠããã®ãæ¢ã«èŠãŠããŸããããŠããããžã§ãã¬ãŒã¿ãŒã¯ãé³å£°ä¿¡å·ãŸãã¯å¶åŸ¡ä¿¡å·ãçæãããªããžã§ã¯ãã§ãã ãããã®ä¿¡å·ã¯åžžã«ãµãŒããŒã§èšç®ãããŸãã ãŠããããžã§ãã¬ãŒã¿ã«ã¯å€ãã®ã¯ã©ã¹ãããããããã¯ãã¹ãŠ UGen ã¯ã©ã¹ãã掟çããŠããŸãã SinOsc ãš LFNoise0 㯠UGen ã®äŸã§ãã 詳现ã«ã€ããŠã¯ã"Unit Generators and Synths" ããã³ "Tour of UGens" ãšãããã«ããã¡ã€ã«ãã芧ãã ããã
ãã®ãã¥ãŒããªã¢ã«ã®åå㧠Pbinds ããã¬ã€ãããšããããã©ã«ãã®ãµãŠã³ãã¯åžžã«åãã§ãã·ã³ãã«ãªãã¢ãã®ãããªã·ã³ã»ã§ãã ãã®ã·ã³ã»ã¯ãŠããããžã§ãã¬ãŒã¿ãŒã®çµã¿åããã§äœãããŠããŸãã â åŠç¿ããŸãã
*ã»ãšãã©ã®ãã¥ãŒããªã¢ã«ã¯ãããã«ãŠããããžã§ãã¬ãŒã¿ãŒããå§ãŸããŸãããã ããSCã®ãã®ã€ã³ããã§ã¯ãç°ãªãæè²åŠçã¢ãããŒãã®ããã«ãæåã«ãã¿ãŒã³ãã¡ããªãŒ( Pbind ãšå人)ã匷調ããããšãéžæããŸããã â ãããŸã§ã¯ãPbinds ã䜿çšããŠSuperColliderã§ãµãŠã³ããäœæããŠããããã"ããã ãPbind ã¯ãŠããããžã§ãã¬ãŒã¿ãŒã ïŒ"ãšã¯æããªããããããŸããã Pbind ã¯ãŠããããžã§ãã¬ãŒã¿ã§ã¯ãªããé³æ¥œã€ãã³ã(ã¹ã³ã¢)ãäœæããããã®åãªãã¬ã·ãã§ãã "ã ãããEventStreamPlayerãPbind 㧠play ãåŒã³åºãããšãã«çãããã®ããã㯠UGen ã§ãªããã°ãªããªãïŒ" ãšããçãã¯ãŸã ããŒã§ãã EventStreamPlayer ã¯ããã¢ãã¹ãã®ãããªåãªããã¬ãŒã€ãŒã§ããããŠããããžã§ãã¬ãŒã¿ãçµã¿åãããŠãããããçš®é¡ã®é»å楜åšãåæé³ãšåŠçé³ã§äœæããæ¹æ³ã§ãã 次ã®äŸã¯ãæåã®æ£åŒŠæ³¢ããäœæããŠãããŠã¹ã§ã©ã€ãæŒå¥ã§ããé»å楜åšãäœæããŸãã
ã©ã€ãã§æŒå¥ã§ããã·ã³ãã«ãªã·ã³ã»ãã玹ä»ããŸããããã¯ãæãå€ãé»å楜åšã®1ã€ã§ãããã«ãã³ã®ã·ãã¥ã¬ãŒã·ã§ã³ã§ãã
{SinOsc.ar(freq: MouseX.kr(300, 2500), mul: MouseY.kr(0, 1))}.play;
ãã«ãã³ãšã¯äœãããããªãå Žåã¯ãä»ãããã¹ãŠãåæ¢ããYouTubeã§âClara Rockmore Thereminâãæ€çŽ¢ããŠãã ããããã®åŸãããã«æ»ã£ãŠãSCãã«ãã³ã§çœé³¥ã®æãæŒå¥ããŠã¿ãŠãã ããã
SinOscãMouseXãããã³ MouseY 㯠UGen ã§ããSinOsc ã¯æ£åŒŠæ³¢ããŒã³ãçæããŠããŸãã ä»ã®2ã€ã¯ãç»é¢äžã®ã«ãŒãœã«ã®åã(æ°Žå¹³æ¹åã®åãã¯XãåçŽæ¹åã®åãã¯Y)ããã£ããã£ããæ°å€ã䜿çšããŠåšæ³¢æ°ãšæ¯å¹ å€ãæ£åŒŠæ³¢ã«éããŸãã éåžžã«ã·ã³ãã«ã§ããšãŠã楜ããã§ãã
äžèšã®ãã«ãã³ã¯æ£åŒŠæ³¢çºæ¯åšã䜿çšããŸããããµãŠã³ããäœæããããã«äœ¿çšã§ããä»ã®æ³¢åœ¢ããããŸãã以äžã®è¡ãå®è¡ããŸã(䟿å©ãªããããæ¹æ³ã䜿çšããŸã) SinOsc ã®åœ¢ãèŠãŠãSaw ãš Pulse ãšæ¯èŒããŸãã以äžã®è¡ã¯é³ãåºããŸããã波圢ã®ã¹ãããã·ã§ãããèŠèŠåããã ãã§ãã
ãã¢ãã¹ãã¯é³ãåºããŸããããã®éããã metaphor ã«æ²¿ã£ãŠã楜åšã®ãã¢ãã¯å®éã«æ¯åããŠé³ãçæããŸãããã㯠UGen ã®ããé©åãªäŸãã§ããã¹ã³ã¢ã§ããã¬ã€ã€ãŒã§ããããŸããã楜åšã§ãã以åã« Pbinds ã§é³æ¥œãäœæããå ŽåãSC㯠EventStreamPlayer ãäœæããŠãçµã¿èŸŒã¿ã®ãã¢ãã·ã³ã»ã§ã¹ã³ã¢ãåçããŸãããã¢ãã®äœæãªã©ãå¿é ããå¿ èŠã¯ãããŸããã§ãããSuperColliderã¯ãã¹ãŠã®äœæ¥ããã³ãããã®äžã§è¡ã£ãŠãããŸããããã®é ããããã¢ãã·ã³ã»ã¯ãããã€ãã®ãŠããããžã§ãã¬ãŒã¿ãŒã®çµã¿åããã§äœãããŠããŸãã
{ SinOsc.ar }.plot; // æ£åŒŠæ³¢ sine wave
{ Saw.ar }.plot; // ã®ãããæ³¢ sawtooth wave
{ Pulse.ar }.plot; // æ¹åœ¢æ³¢ square wave
次ã«ãSinOsc ã Saw ã«ã次㫠Pulse ã«çœ®ãæããŠããã«ãã³ã®è¡ãæžãæããŸããé³ã®éããèããŠãã ãããæåŸã«ããã«ãã³ã³ãŒã㧠.play ã®ä»£ããã« .scope ãè©Šããšããªã¢ã«ã¿ã€ã ã§æ³¢åœ¢ã®è¡šçŸãèŠãããšãã§ããŸã("Stethoscope"ãŠã£ã³ããŠããããã¢ãã衚瀺ãããŸã)ã
SuperCollider ã³ãŒã㧠UGen ãèŠã€ããã®ã¯éåžžã«ç°¡åã§ããã»ãšãã©ã®å Žåãã¡ãã»ãŒãžã®åŸã« .ar ãŸã㯠.kr ã®ã¡ãã»ãŒãžãç¶ããŸãããããã®æåã¯ããªãŒãã£ãªã¬ãŒããšã³ã³ãããŒã«ã¬ãŒããè¡šããŠããŸãããããäœãæå³ããã®ãèŠãŠã¿ãŸãããã
"Unit Generators and Synths" ãã«ããã¡ã€ã«ããïŒ
ãŠããããžã§ãã¬ãŒã¿ãŒã¯ãarãŸãã¯krã¡ãã»ãŒãžããŠããããžã§ãã¬ãŒã¿ãŒã®ã¯ã©ã¹ãªããžã§ã¯ãã«éä¿¡ããããšã«ãã£ãŠäœæãããŸããar ã¡ãã»ãŒãžã¯ããªãŒãã£ãªã¬ãŒãã§å®è¡ããããŠããããžã§ãã¬ãŒã¿ãŒãäœæããŸããkr ã¡ãã»ãŒãžã¯ãå¶åŸ¡ã¬ãŒãã§å®è¡ããããŠããããžã§ãã¬ãŒã¿ãŒãäœæããŸããå¶åŸ¡ã¬ãŒããŠããããžã§ãã¬ãŒã¿ãŒã¯ãäœåšæ³¢æ°ãŸãã¯ãã£ããå€åããå¶åŸ¡ä¿¡å·ã«äœ¿çšãããŸããã³ã³ãããŒã« ã¬ãŒããŠããã ãžã§ãã¬ãŒã¿ãŒã¯ãå¶åŸ¡ãµã€ã¯ã«ããšã«1ã€ã®ãµã³ãã«ã®ã¿ãçæããããããªãŒãã£ãªã¬ãŒããŠããããžã§ãã¬ãŒã¿ãŒãããåŠçèœåãäœããªããŸãã*
ã€ãŸããSinOsc.ar ãäœæãããšã"ãªãŒãã£ãªã¬ãŒã"ãšããã¡ãã»ãŒãžã SinOsc UGen ã«éä¿¡ãããŸããã³ã³ãã¥ãŒã¿ãŒã44100 Hzã®äžè¬çãªãµã³ããªã³ã°ã¬ãŒãã§å®è¡ãããŠãããšä»®å®ãããšããã®æ£åŒŠçºæ¯åšã¯ã1ç§ããã44100ãµã³ãã«ãçæããŠãã¹ããŒã«ãŒã«éä¿¡ããŸãã 次ã«ãæ£åŒŠæ³¢ãèãããŸãã
ä»èªãã ãã®ã«ã€ããŠããäžåºŠèããŠã¿ãŠãã ãããar ã¡ãã»ãŒãžã UGen ã«éä¿¡ãããšãæ¯ç§4äž4ååã®æ°åãçæããããã«æ瀺ããŠããŸãã ããã¯ããããã®æ°åã§ãã{SinOsc.ar}.play ãèšèªã§èšè¿°ããèšèªããªã¯ãšã¹ãããµãŒããŒã«äŒããŸãã ããããã¹ãŠã®ãµã³ãã«ãçæããå®éã®äœæ¥ã¯ããµãŒããŒãSuperColliderã®"ãµãŠã³ããšã³ãžã³"ã«ãã£ãŠè¡ãããŸãã
*http://doc.sccode.org/Guides/UGens-and-Synths.html
çŸåšãar ã®ä»£ããã« kr ã䜿çšãããšããžã§ãããµãŒããŒã«ãã£ãŠå®è¡ãããŸãããããã€ãã®éãããããŸãã
-
.krã§çæããã1ç§ãããã®æ°å€ã®éã¯ã¯ããã«å°ãªããªããŸãã{SinOsc.ar} .play ã¯æ¯ç§44100ã®æ°å€ãçæããŸããã{SinOsc.kr} .play ã¯æ¯ç§700æªæºã®æ°å€ãåºåããŸãïŒèå³ãããå Žåãæ£ç¢ºãªéã¯44100/64ã§ãã64ã¯ãããã"control period."ãïŒ
-
krã§çæãããä¿¡å·ã¯ã¹ããŒã«ãŒã«éãããŸããã代ããã«ãéåžžãä»ã®ä¿¡å·ã®ãã©ã¡ãŒã¿ãŒãå¶åŸ¡ããããã«äœ¿çšãããŸããããšãã°ããã«ãã³ã® MouseX.kr ã SinOsc ã®åšæ³¢æ°ãå¶åŸ¡ããŠããŸããã
OKããã㧠UGen ã¯ãããã®éåžžã«é«éãªæ°å€ã®ãžã§ãã¬ãŒã¿ã§ãããããã®æ°å€ã®äžéšã¯é³å£°ä¿¡å·ã«ãªããŸãããã®ä»ã¯å¶åŸ¡ä¿¡å·ã«ãªããŸãããããŸã§ã¯é 調ã§ãããããããçµå±ã®ãšããããããã®æ°åã¯äœã§ããïŒ å€§ããïŒ å°ããïŒ ããžãã£ãïŒ è² ïŒ å€ãã®å Žåã-1ãã+1ã®éãæã«ã¯0ãã1ã®éã®éåžžã«å°ããæ°å€ã§ããããšãããããŸãããã¹ãŠã® UGen ã¯ãçæããæ°å€ã®ç¯å²ã«åŸã£ãŠããŠãããŒã© UGen ãšãã€ããŒã© UGen ã®2ã€ã®ã«ããŽãªã«åé¡ã§ããŸãã
ãŠãããŒã© UGen ã¯ã0~1ã®æ°å€ãçæããŸãã
ãã€ããŒã© UGen ã¯ã-1~+1ã®æ°å€ãçæããŸãã
äžéšã® UGen ã®åºåãèŠãèŠããšããããããæ確ã«ãªããŸããSuperCollider ã Post ãŠã£ã³ããŠã«æ¯ç§æ°åã®æ°åãå°å·ããããšã¯æåŸ ã§ããŸããããæ¯ç§æ°åãå°å·ããããã«äŸé Œããããšã¯ã§ããŸãã次ã®è¡ãäžåºŠã«1ã€ãã€å ¥åããŠå®è¡ã(ãµãŒããŒãå®è¡ãããŠããããšã確èªããŠãã ãã)ãPost ãŠã£ã³ããŠãç£èŠããŸãã
1 // post ãŠã£ã³ããŠãèŠãã ãïŒé³ãªãïŒ
2 {SinOsc.kr(1).poll}.play;
3 // ctrl + ããªãªããæŒããŠã次ã®è¡ãè©äŸ¡ããŸã:
4 {LFPulse.kr(1).poll}.play;
äŸã§ã¯ kr ã䜿çšããŠããããé³ãåºãŸãããçµæã¯å¶åŸ¡ä¿¡å·ã§ãããããã¹ããŒã«ãŒã«ã¯äœãéä¿¡ãããŸãããããã§ã®ãã€ã³ãã¯ãSinOsc ã®å žåçãªåºåãèŠãã ãã§ããã¡ãã»ãŒãžããŒãªã³ã°ã¯ãSinOsc åºåãã1ç§ããã10åã®æ°åãååŸãããããã Post ãŠã£ã³ããŠã«åºåããŸããåŒæ°1ã¯åšæ³¢æ°ã§ããµã€ã³ãæå³ããŸãã
ãµã€ã¯ã«å šäœãå®äºããã«ã¯1ç§ããããŸããããªãã芳å¯ããããšã«åºã¥ããŠãSinOsc ã¯å極ã§ãããå極ã§ããïŒ LFPulse ã¯ã©ãã§ããïŒ6
次ã®è¡ãè©äŸ¡ããåã«ããªã¥ãŒã ãäžããŠããããã£ãããšæ»ããŸãã æãããã¯ãªãã¯é³ãèãããã¯ãã§ãã
{LFNoise0.ar(1).poll}.play;
ã¡ãã»ãŒãž ar ãéä¿¡ããããããã®äœåšæ³¢ãã€ãºãžã§ãã¬ãŒã¿ãŒã¯ããµãŠã³ãã«ãŒãã«æ¯ç§44100ãµã³ãã«ãåºåããŠããŸããããã¯ãªãŒãã£ãªä¿¡å·ã§ããåãµã³ãã«ã¯-1~+1ã®æ°å€ã§ã(ãããã£ãŠããã€ããŒã© UGen ã§ã)ãæ祚ã§ã¯ã1ç§ããã10件ãã衚瀺ãããŸãããLFNoise0.ar(1) ã¯ãæ¯ç§æ°ããä¹±æ°ãéžæããŸãããããã¯ãã¹ãŠãµãŒããŒã«ãã£ãŠå®è¡ãããŸãã[ctrl +.]ã§ã¯ãªãã¯ãåæ¢ããLFNoise0 ã®åšæ³¢æ°ãå€æŽããŠã¿ãŠãã ããã3ã5ã10ãªã©ã®æ°åãè©ŠããŠãã ãããåºåçªå·ãèŠãŠãçµæãèããŸãã
ã»ãšãã©ã®å Žåã䜿çšããŠãã UGen ã®åŒæ°ãæå®ããå¿ èŠããããŸããããªãã¯ãã§ã«ãããèŠãŸããïŒ{SinOsc.ar(440)}.play ãæžããšããæ°å440㯠SinOsc.ar ã®åŒæ°ã§ããèãããåšæ³¢æ°ãæå®ããŸãã{SinOsc.ar(freqïŒ440ãmulïŒ0.5)}.play ã®ããã«ãåŒæ°ã®ååãæ瀺ããããšãã§ããŸããåŒæ°å㯠freq ããã³ mul ã§ãïŒã³ãŒãå ã®åèªã®çŽåŸã®ã³ãã³ïŒã«æ³šæããŠãã ããïŒãmul ã¯"ä¹æ°"ã®ç¥ã§ãåºæ¬çã«ã¯æ³¢åœ¢ã®æ¯å¹ ã§ããmul ãæå®ããªãå ŽåãSuperCollider ã¯ããã©ã«ãå€ã®1ïŒæ倧æ¯å¹ ïŒã䜿çšããŸããmul ã®äœ¿çšïŒ0.5ã¯ã波圢ãååã«ä¹ç®ããããšãæå³ããŸããã€ãŸããæ倧æ¯å¹ ã®ååã§åçããŸãããã«ãã³ã³ãŒãã§ã¯ãSinOsc ã®åŒæ° freq ããã³ mul ã«æ瀺çã«ååãä»ããããŠããŸããMouseX.kr(300ã2500) ã¯ããã«ãã³ã®åšæ³¢æ°ãã³ã³ãããŒã«ããããã«äœ¿çšãããŸãããMouseX.kr ã¯ãåºåç¯å²ã®äžéãšäžéã®2ã€ã®åŒæ°ãåããŸããããããæ°å300ãš2500ã§ããæ¯å¹ ãå¶åŸ¡ãã MouseY.kr(0ã1) ã«ã€ããŠãåãã§ããããŠã¹ UGen å ã®åŒæ°ã«ã¯æ瀺çãªååã¯ä»ããããŸããã§ããããããããããšã¯ã§ããŸãã
UGen ãã©ã®ãããªåŒæ°ãåãå ¥ããããã©ã®ããã«ããŠèŠã€ããŸããïŒå¯Ÿå¿ãããã«ããã¡ã€ã«ã«ç§»åããŸãïŒUGen åãããã«ã¯ãªãã¯ããŠéžæãã[ctrl + D]ãæŒããŠããã¥ã¡ã³ãããŒãžãéããŸããããšãã°ãMouseX ã§ãããè¡ããŸãã[ Description ]ã»ã¯ã·ã§ã³ã®åŸã«ã[ã¯ã©ã¹ã¡ãœãã]ã»ã¯ã·ã§ã³ã衚瀺ãããŸããããã«ã¯ãkr ã¡ãœããã®åŒæ°ã minvalãmaxvalãwarpãããã³ lag ã§ãããšæžãããŠããŸããåãããŒãžãããããããã®æ©èœã確èªã§ããŸãã
åŒæ°ãæå®ããªãå ŽåãSCã¯ãã«ããã¡ã€ã«ã«è¡šç€ºãããããã©ã«ãå€ã䜿çšããŸããåŒæ°ã«æ瀺çã«ååãä»ããªãå Žåã¯ããã«ããã¡ã€ã«ã«ç€ºãããŠããæ£ç¢ºãªé åºã§åŒæ°ãæå®ããå¿ èŠããããŸããæ瀺çã«ååãä»ããå Žåã¯ãä»»æã®é åºã§äžŠã¹ãããšãã§ããéäžã§ã¹ãããããããšãã§ããŸããåŒæ°ãæ瀺çã«åœåããããšããã³ãŒããããããç解ããã®ã«åœ¹ç«ã€ãããåªããåŠç¿ããŒã«ã§ãã以äžã«äŸã瀺ããŸãã
// minvalãšmaxvalãé çªã«æäŸãããããŒã¯ãŒããªã
{MouseX.kr(300, 2500).poll}.play;
// minval,maxval,ããã³lagãæäŸãããã¯ãŒããã¹ããã
{MouseX.kr(minval: 300, maxval: 2500, lag: 10).poll}.play;
å®éã®æ¥œãã¿ã¯ãããã€ãã® UGen ã䜿çšããŠä»ã® UGen ã®ãã©ã¡ãŒã¿ãŒãã³ã³ãããŒã«ãããšãã«å§ãŸããŸãããã«ãã³ã®äŸã¯ãŸãã«ãããè¡ããŸãããïŒä»ãããªãã¯ã»ã¯ã·ã§ã³3ã®äŸã®ã²ãšã€ãæ£ç¢ºã«ç解ããããã®ãã¹ãŠã®ããŒã«ãæã£ãŠããŸããäŸã®äžã§æåŸã®3è¡ã¯ã¹ããããã€ã¹ãããã§ãã©ã®ããã«ã㊠LFNoise0 ã§åšæ³¢æ°ãã³ã³ãããŒã«ãããæ¹æ³ã瀺ããŸãã
{SinOsc.ar(freq: LFNoise0.kr(10).range(500, 1500), mul: 0.1)}.play;
// å解ãã :
{LFNoise0.kr(1).poll}.play; // ã·ã³ãã«ãªLFNoise0ã®åäœãèŠãŸã
{LFNoise0.kr(1).range(500, 1500).poll}.play; // .rangeããããŸã
{LFNoise0.kr(10).range(500, 1500).poll}.play; // now faster
range ã¡ãœããã¯ãåã« UGen ã®åºåãåã¹ã±ãŒãªã³ã°ããŸããLFNoise0 㯠-1 ãã +1 ãŸã§ã®æ°ãçæããããšãèŠããŠãããŠãã ããïŒãã€ããŒã© UGenã§ãïŒããããã®çã®æ°å€ã¯ãåšæ³¢æ°ãå¶åŸ¡ããã®ã«ããŸãæçšã§ã¯ãããŸããïŒäººéã®èŽåç¯å²å ã§é©åãªæ°å€ãå¿ èŠã§ãïŒã.range 㯠-1 ãš +1 ã®éã®åºåãåãåããåŒæ°ãšããŠæå®ããäœãå€ãšé«ãå€ïŒãã®å Žåã¯500ãš1500ïŒã«åãããŠã¹ã±ãŒãªã³ã°ããŸããLFNoise0.kr ã®åŒæ°ã§ããæ°å€10ã¯ãUGen ã®é »åºŠãã€ãŸã1ç§ãããäœåæ°ããä¹±æ°ãéžæããããæå®ããŸãã
èŠããã«ãUGen ã䜿çšããŠå¥ã® UGen ã®ãã©ã¡ãŒã¿ãŒãå¶åŸ¡ããã«ã¯ããŸããå¿ èŠãªæ°å€ã®ç¯å²ãç¥ãå¿ èŠããããŸããæ°å€ã¯åšæ³¢æ°ã«ãªããŸããïŒããšãã°ã100~1000 ã®ç¯å²ã§ãããã䜿çšããŸããïŒãããšãæ¯å¹ ã§ããïŒãããããæ¯å¹ ã0.1ïŒãœããïŒãã0.5ïŒæ倧ã®ååïŒã«ãããã§ããããïŒãŸãã¯ãé«èª¿æ³¢ã®æ°ãå¶åŸ¡ããããšããŠããŸããïŒ 5ãã19ã®éã«ãããã§ããïŒ
å¿ èŠãªç¯å²ãããã£ããã.range ã¡ãœããã䜿çšããŠãã³ã³ãããŒã«ãã UGen ã«æ£ããåäœããããŸãã
æŒç¿ïŒåšæ³¢æ°ã LFPulse.kr ã«ãã£ãŠã³ã³ãããŒã«ãããæ£åŒŠæ³¢ãåçããåçŽãªã©ã€ã³ã³ãŒããèšè¿°ããŸãïŒé©åãªåŒæ°ãæäŸããŸãïŒã次ã«ã.range ã¡ãœããã䜿çšããŠãLFPulse ã®åºåãèããããã®ã«ã¹ã±ãŒãªã³ã°ããŸãã
ããã§ã.range ã¡ãœããã䜿çšããŠããµãŒããŒã§ UGen ã®åºåãã¹ã±ãŒãªã³ã°ããæ¹æ³ãããããŸãããã»ãŒãã¹ãŠã® UGen ãæã£ãŠããåŒæ° mul ããã³ add ã䜿çšããããšã«ãããåãããšãããåºæ¬çãªã¬ãã«ã§å®çŸã§ããŸãã以äžã®ã³ãŒãã¯ããã€ããŒã© UGen ãšãŠãããŒã© UGen ã®äž¡æ¹ã§ãç¯å²ã¢ãããŒããš mul / add ã¢ãããŒãã®ç䟡æ§ã瀺ããŠããŸãã
// ãã¡ãã¯:
{SinOsc.kr(1).range(100, 200).poll}.play;
// ...ãããšåã:
{SinOsc.kr(1, mul: 50, add: 150).poll}.play;
// ãã¡ãã¯:
{LFPulse.kr(1).range(100, 200).poll}.play;
// ...ãããšåã:
{LFPulse.kr(1, mul: 50, add: 100).poll}.play;
å³7ã¯ãUGen åºåã®åã¹ã±ãŒãªã³ã°ã«ããã mul ããã³ add ã®åäœãèŠèŠåããã®ã«åœ¹ç«ã¡ãŸãïŒSinOsc ããã¢ãšããŠäœ¿çšãããŸãïŒã
å³7: mul ãš add ã«ãã UGen ã¹ã±ãŒãªã³ã°ã¬ã³ãž
ãã®ä»ã®ä»»æã®ã¹ã±ãŒãªã³ã°ã«ã¯ã䟿å©ãªã¡ãœãã linlinãlinexpãexplinãexpexp ã䜿çšã§ããŸããã¡ãœããåã¯ãããããäœããããã®ãã³ãã瀺ããŸããç·åœ¢ç¯å²ãå¥ã®ç·åœ¢ç¯å²ã«å€æ( linlin )ãç·åœ¢ããææ°ã«å€æ( linexp )ãªã©ã
// ããããã®æ°å
a = [1, 2, 3, 4, 5, 6, 7];
// 0ãã127ã«åã¹ã±ãŒãªã³ã°ãç·åœ¢ããç·åœ¢
a.linlin(1, 7, 0, 127).round(1);
// 0ãã127ãç·åœ¢ããææ°
a.linexp(1, 7, 0.01, 127).round(1); // ææ°ç¯å²ã«ãŒãã䜿çšããªãã§ãã ãã
ç·åœ¢ããã³ææ°é¢æ°ã®ã¬ãã¥ãŒã«ã€ããŠã¯ãç®è¡ã·ãŒã±ã³ã¹ãšå¹ŸäœåŠçã·ãŒã±ã³ã¹ã®éãããªã³ã©ã€ã³ã§èª¿ã¹ãŠãã ãããç°¡åã«èšãã°ãç·åœ¢ïŒç®è¡ïŒã·ãŒã±ã³ã¹ã¯ã1ã2ã3ã4ã5ã6ããŸãã¯ã3ã6ã9ã12ã15ããªã©ã§ããææ°ïŒå¹ŸäœïŒã·ãŒã±ã³ã¹ã¯ã1ã2ã4ã8ã16ã32ããŸãã¯ã3ã9ã27ã81ã243ããªã©ã®ããã«ãªããŸãã
ããã¯ãããã€ãã®ã·ã³ã»ãéå§ããããããåå¥ã«åæ¢ã§ããéåžžã«äžè¬çãªæ¹æ³ã§ããäŸã¯èªæã§ãïŒ
// äžåºŠã«1è¡ãã€å®è¡ããŸã(éã«é³ãæ¢ããªãã§ãã ãã)ïŒ
a = { Saw.ar(LFNoise2.kr(8).range(1000, 2000), mul: 0.2) }.play;
b = { Saw.ar(LFNoise2.kr(7).range(100, 1000), mul: 0.2) }.play;
c = { Saw.ar(LFNoise0.kr(15).range(2000, 3000), mul: 0.1) }.play;
// ã·ã³ã»ãåå¥ã«åæ¢ããïŒ
a.free;
b.free;
c.free;
ä»ã®é¢æ°(ã¬ãã¥ãŒã»ã¯ã·ã§ã³21)ãšåæ§ã«ãã·ã³ã»é¢æ°ã®å é ã§æå®ãããåŒæ°ã«ã¯ãŠãŒã¶ãŒãã¢ã¯ã»ã¹ã§ããŸããããã«ãããã·ã³ã»ã®ãã©ã¡ãŒã¿ãŒããªã³ã¶ãã©ã€ã§å€æŽã§ããŸã(ã·ã³ã»ã®å®è¡äž)ããã®ããã«ã¡ãã»ãŒãžã»ããã䜿çšãããŸããç°¡åãªäŸïŒ
x = {arg freq = 440, amp = 0.1; SinOsc.ar(freq, 0, amp)}.play;
x.set(\freq, 778);
x.set(\amp, 0.5);
x.set(\freq, 920, \amp, 0.2);
x.free;
ããã©ã«ãå€(äžèšã®440ã0.1ãªã©)ãæå®ããããšããå§ãããŸããããããªããšã"空ã®"ãã©ã¡ãŒã¿ãŒã«é©åãªå€ãèšå®ãããŸã§ã·ã³ã»ãåçãããŸããã
ãªãŒãã£ãª bus ã¯ããªãŒãã£ãªä¿¡å·ã®ã«ãŒãã£ã³ã°ã«äœ¿çšãããŸãããããã¯ããã·ã³ã°ããŒãã®ãã£ã³ãã«ã®ãããªãã®ã§ããSuperCollider ã«ã¯ããã©ã«ãã§128åã®ãªãŒãã£ãª bus ããããŸããã³ã³ãããŒã« busããããŸã(ã³ã³ãããŒã«ä¿¡å·çš)ããããã§ã¯ãªãŒãã£ãª bus ã®ã¿ã«æ³šç®ããŸãããã*
[ctrl + M]ãæŒããŠãã¡ãŒã¿ãŒãŠã£ã³ããŠãéããŸãããã¹ãŠã®å ¥åããã³åºåã®ã¬ãã«ã衚瀺ãããŸããå³8ã¯ããã®ãŠã£ã³ããŠã®ã¹ã¯ãªãŒã³ã·ã§ãããšSuperColliderã®ããã©ã«ããã¹ãžã®å¯Ÿå¿ã瀺ããŠããŸããSuperCollider ã§ã¯ããªãŒãã£ãªãã¹ã«ã¯0ã127ã®çªå·ãä»ããããŸããæåã®8ã€ïŒ0ã7ïŒã¯ãããã©ã«ãã§ãµãŠã³ãã«ãŒãã®åºåãã£ã³ãã«ãšããŠäºçŽãããŠããŸãã次ã®8ã€ïŒ8ã15ïŒã¯ããµãŠã³ãã«ãŒãã®å ¥åçšã«äºçŽãããŠããŸããä»ã®ãã¹ãŠïŒ16ã127ïŒã¯ããªãŒãã£ãªä¿¡å·ããã UGen ããå¥ã® UGen ã«ã«ãŒãã£ã³ã°ããå¿ èŠãããå Žåãªã©ãä»»æã®æ¹æ³ã§èªç±ã«äœ¿çšã§ããŸãã
*ã»ã¯ã·ã§ã³41ã§ã³ã³ãâããŒã« bus ãç°¡åã«èŠãŠãããŸãã
次ã®ã³ãŒããè©ŠããŠãã ãã:
{Out.ar(1, SinOsc.ar(440, 0, 0.1))}.play; // å³ãã£ã³ãã«
å³8ïŒSCã®ãªãŒãã£ãª bus ãšã¡ãŒã¿ãŒãŠã£ã³ããŠ
Out UGen ã¯ãç¹å®ã® bus ãžã®ä¿¡å·ã®ã«ãŒãã£ã³ã°ãåŠçããŸãã Out ã®æåã®åŒæ°ã¯ãã¿ãŒã²ãã busãã€ãŸãããã®ä¿¡å·ã®éä¿¡å ã§ããäžèšã®äŸã§ã¯ãçªå·1ã¯ããµãŠã³ãã«ãŒãã®æ£ãããã£ãã«ã§ãã bus 1ã«ä¿¡å·ãéä¿¡ããããšãæå³ããŸãã Out.ar ã®2çªç®ã®åŒæ°ã¯ããã®ãã¹ã«ãæžã蟌ããå®éã®ä¿¡å·ã§ãã åäžã® UGenããŸã㯠UGen ã®çµã¿åããã«ããããšãã§ããŸããäŸã§ã¯ãããã¯åãªãæ£åŒŠæ³¢ã§ããå³ã®ã¹ããŒã«ãŒïŒãŸãã¯ããããã©ã³ã䜿çšããŠããå Žåã¯å³ã®è³ïŒã§ã®ã¿èãããŸãã ã¡ãŒã¿ãŒãŠã£ã³ããŠãéããŠè¡šç€ºããç¶æ ã§ãOut.ar ã®æåã®åŒæ°ãå€æŽããŸãã 0ãã7ãŸã§ã®æ°åãè©ŠããŠãã¡ãŒã¿ãŒãèŠãŠãã ãããæ瀺ããå Žæã«ä¿¡å·ãéãããããšãããããŸãã
ãã³ãïŒ |
---|
ã»ãšãã©ã®å Žåã2ã€ã®ãã£ã³ãã«ïŒå·Šå³ïŒããåçã§ããªããµãŠã³ãã«ãŒããããããããµã€ã³ããŒã³ã¯ bus 0 ãŸã㯠bus 1 ã«éä¿¡ãããšãã«ã®ã¿èãããŸããä»ã® bus ã«éä¿¡ãããšïŒ3ã 7ïŒã察å¿ããã¡ãŒã¿ãŒã«ä¿¡å·ã衚瀺ãããŸãïŒSCã¯å®éã«ãã® bus ã«ãµãŠã³ããéä¿¡ããŠããŸããã8ãã£ã³ãã«ã®ãµãŠã³ãã«ãŒãããªãéããbus 3ã7ã®åºåãèãããšã¯ã§ããŸããã |
ãšãã§ã¯ãã«äœ¿çšããããªãŒãã£ãª bus ã®ç°¡åãªäŸã以äžã«ç€ºããŸãã
// start the effect
f = {Out.ar(0, BPF.ar(in: In.ar(55), freq: MouseY.kr(1000, 5000), rq: 0.1))}.play;
// start the source
n = {Out.ar(55, WhiteNoise.ar(0.5))}.play;
æåã®è¡ã¯ããã£ã«ã¿ãŒ UGenïŒãã³ããã¹ãã£ã«ã¿ãŒïŒã§æ§æãããã·ã³ã»ïŒå€æ° fã«æ ŒçŽïŒã宣èšããŸãããã³ããã¹ãã£ã«ã¿ãŒã¯ãå ¥åãšããŠä»»æã®ãµãŠã³ããåãåããééãããã1ã€ã®åšæ³¢æ°é åãé€ããã¹ãŠã®åšæ³¢æ°ããã£ã«ã¿ãŒåŠçããŸããIn.ar ã¯ããªãŒãã£ãªãã¹ããã®èªã¿åãã«äœ¿çšãã UGen ã§ãããããã£ãŠãBPF ã®å ¥åãšã㊠In.arïŒ55ïŒ ã䜿çšããããšããã¹55ã«éä¿¡ãããµãŠã³ãã¯ãã¹ãŠãã³ããã¹ãã£ã«ã¿ãŒã«æž¡ãããŸãã ãã®æåã®ã·ã³ã»ã¯æåã¯äœãé³ãç«ãŠãªãããšã«æ³šæããŠãã ãã: æåã®ã©ã€ã³ãè©äŸ¡ããŠãããã¹55ã¯ãŸã 空ã§ããbus 55 ã«ãªãŒãã£ãªãéä¿¡ãããšãã«ã®ã¿é³ãããŸããããã¯2è¡ç®ã§çºçããŸãã
2è¡ç®ã¯ã·ã³ã»ãäœæããå€æ° n ã«ä¿åããŸãããã®ã·ã³ã»ã¯ãåã«ãã¯ã€ããã€ãºãçæããã¹ããŒã«ãŒã«çŽæ¥åºåããã®ã§ã¯ãªãã代ããã«ãªãŒãã£ãª bus 55ã«åºåããŸããããããŸãã«ãã£ã«ã¿ãŒã·ã³ã»ããªãã¹ã³ããŠãã bus ãªã®ã§ã2è¡ç®ãè©äŸ¡ãããšããã«ãã·ã³ã» f ã«ãã£ãŠãã£ã«ã¿ãŒåŠçãããŠãããã¯ã€ããã€ãºãèããå§ããŸããèŠããã«ãã«ãŒãã£ã³ã°ã¯æ¬¡ã®ããã«ãªããŸãã
noise synthâ bus 55â filter synth
å®è¡ã®é åºã¯éèŠã§ããå¹æã®åã«ãœãŒã¹ãè©äŸ¡ããå Žåãåã®äŸã¯æ©èœããŸãããããã«ã€ããŠã¯ãã»ã¯ã·ã§ã³42"å®è¡ã®é åº"ã§è©³ãã説æããŸããæåŸã®1ã€ïŒ{SinOsc.ar(440)}.play ã®ãããªä»¥åã®ãµã³ãã«ã·ã³ã»ã§æžãããšããSCã¯å®éã« {Out.ar(0,SinOsc.ar(440))}.play ã®äžã§ïŒbus 0 ã«ãµãŠã³ããéä¿¡ããããšãæ³å®ããŠãããããæåã® UGen ãèªåçã« Out.ar(0,...)UGen ã§ã©ããããŸãããå®éãèå°è£ã§ããã«ããã€ãã®ããšãè¡ãããŠããŸãããããã«ã€ããŠã¯åŸã§èª¬æããŸãïŒã»ã¯ã·ã§ã³39ïŒã
äžã®äŸã¯ãSoundIn UGen ã䜿çšããŠãµãŠã³ãã«ãŒããããµãŠã³ãå ¥åã«ç°¡åã«ã¢ã¯ã»ã¹ããæ¹æ³ã瀺ããŠããŸãã*
*In.ar ã¯ä»»æã® bus ããèªã¿åãããµãŠã³ãã«ãŒãå ¥åã¯ããã©ã«ã㧠bus 8~15ã«å²ãåœãŠãããŠããããšãããã£ãŠãããããIn.ar(8) ãæžã蟌ãã§ãã€ã¯ãããµãŠã³ããååŸã§ããŸããããã¯ããŸãæ©èœããŸãããSoundIn.ar ã¯ãã䟿å©ãªãªãã·ã§ã³ã§ãã
// èŠåïŒãã£ãŒãããã¯ãé¿ããããã«ããããã©ã³ã䜿çšããŠãã ãã
{SoundIn.ar(0)}.play; // In.ar(8)ãšåãïŒæåã®å
¥åãã¹ãããµãŠã³ããååŸ
// ã¹ãã¬ãªããŒãžã§ã³
{SoundIn.ar([0, 1])}.play; // 1çªç®ãš2çªç®ã®å
¥å
// ãã ã®æ¥œãã¿ã®ããã«ããã€ãã®ãªããŒãïŒ
{FreeVerb.ar(SoundIn.ar([0, 1]), mix: 0.5, room: 0.9)}.play;
ã¡ãŒã¿ãŒãŠã£ã³ããŠãéããŠããç¶æ ã§â[ctrl + M]âããããèŠãŠãã ããã
{Out.ar(0, Saw.ar(freq: [440, 570], mul: Line.kr(0, 1, 10)))}.play;
çŽ æŽããã Line.kr UGen ã䜿çšããŠãæ¯å¹ ã10ç§ã§0ãã1ã«å¢å ãããŠããŸããããã¯ãã¡ããšããŠãããããããããã§ã¯ããã«èå³æ·±ãéæ³ãèµ·ãã£ãŠããŸãã2ã€ã®åºåãã£ãã«ïŒå·Šãšå³ïŒãããããšã«æ°ã¥ããŸãããïŒåãã£ã³ãã«ã«ç°ãªãé³ãããããšãèããŸãããïŒãããŠããããã®2ã€ã®é³ç¬Šã¯ãªã¹ãããåŸãããŸãâ [440,570] âããã¯åšæ³¢æ°åŒæ°ãšã㊠Saw.ar ã«æž¡ãããŸããïŒ
ããã¯ãã«ããã£ãã«æ¡åŒµãšåŒã°ããŸãã
David Cottle ã¯ã"ãã«ããã£ãã«æ¡åŒµã¯ããŒãã¥ãŒæã«é£æ¥ãã[ é åã®application ]ã§ãã" *ãšåè«ãèšããŸããããã¯ãSuperCollider ã®æã匷åã§ãŠããŒã¯ãªæ©èœã®1ã€ã§ãããæåã¯äººã ãå°æãããå¯èœæ§ããããŸãã ç°¡åã«èšããšãã©ãã§ã UGen ã®åŒæ°ã®1ã€ãšããŠé åã䜿çšãããšããããå šäœãè€è£œãããŸããäœæãããã³ããŒã®æ°ã¯ãé åå ã®ã¢ã€ãã ã®æ°ã§ãã ãããã®è€è£œããã UGen ã¯ãOut.ar ã®æåã®åŒæ°ãšããŠæå®ããã bus ããéå§ããŠãå¿ èŠãªæ°ã®é£æ¥ bus ã«éä¿¡ãããŸãã
*Cottle, D. âBeginnerâs Tutorial.â The SuperCollider Book, MIT Press, 2011, p. 14
äžèšã®äŸã§ã¯ãOut.ar(0,...) ããããŸããã®ãããæ³¢ã®åšæ³¢æ°ã¯ã[440,570] ã®2ã€ã®é ç®ã®é åã§ããSCã¯äœãããŸããïŒ "ãã«ããã£ãã«æ¡åŒµ"ã«ããããããå šäœã®ã³ããŒã2ã€äœæãããŸããæåã®ã³ããŒã¯ãåšæ³¢æ°440 Hzã®ãã³ã®ãªæ³¢ã§ããã¹0(å·Šãã£ã³ãã«)ã«éä¿¡ãããŸãã2çªç®ã®ã³ããŒã¯ãåšæ³¢æ°570 Hzã®ãã³ã®ãªæ³¢ã§ããã¹1(å³ãã£ã³ãã«)ã«éä¿¡ãããŸãïŒ
ãããèªåã§ç¢ºèªããŠãã ããããããã®2ã€ã®åšæ³¢æ°ãä»»æã®ä»ã®å€ã«å€æŽããŸããçµæãèããŠãã ããã1ã€ã¯å·Šãã£ã³ãã«ã«è¡ãããã1ã€ã¯å³ãã£ã³ãã«ã«è¡ããŸããããã«é²ãã§ããªã¹ãã«3çªç®ã®é »åºŠãè¿œå ããŸã( [440,570,980] ãªã©)ãã¡ãŒã¿ãŒãŠã£ã³ããŠã確èªããŸããæåã®3ã€ã®åºåãç¹ç¯ããŠããããšãããããŸã(ãã ãããã«ããã£ã³ãã«ãµãŠã³ãã«ãŒããæã£ãŠããå Žåã®ã¿ã3çªç®ã®åºåãèãããšãã§ããŸã)ã
ããã«ãåã UGen ã®ä»ã®åŒæ°ããŸãã¯åãã·ã³ã»ã®ä»ã® UGen ã®åŒæ°ã§è¿œå ã®é åã䜿çšã§ããŸããSuperCollider ã¯ããŠã¹ããŒãã³ã°ãè¡ããããã«å¿ããŠãããã®å€ã«åŸãã·ã³ã»ãçæããŸããããšãã°ãçŸåšãäž¡æ¹ã®åšæ³¢æ°[440,570] ã¯10ç§ã§0ãã1ã«ãã§ãŒãã€ã³ããŠããŸãããã ããã³ãŒãã Line.kr(0,1,[1,15]) ã«å€æŽãããšã440 HzããŒã³ããã§ãŒãã€ã³ããã®ã«1ç§ãããã570 HzããŒã³ããã§ãŒãã€ã³ããã®ã«15ç§ããããŸããè©ŠããŠã¿ãŠãã ããã
æŒç¿ïŒå€ãé»è©±ã®"ããžãŒããŒã³"ã®ã·ãã¥ã¬ãŒã·ã§ã³ãèããŠãã ããããã«ããã£ã³ãã«æ¡åŒµã䜿çšããŠããããããç°ãªããã£ã³ãã«ã§ç°ãªãåšæ³¢æ°ãåçãã2ã€ã®æ£åŒŠãªã·ã¬ãŒã¿ãŒãäœæããŸãã
å·Šãã£ãã«ãã«ã¹ã1ç§éã«2åãå³ãã£ãã«ãã«ã¹ã1ç§éã«3åã«ããŸãã7
a = {Out.ar(0, SinOsc.ar(freq: [800, 880], mul: LFPulse.ar(2)))}.play;
a.free;
åã®2ã€ã®ã»ã¯ã·ã§ã³ã§åŠãã ãã¹ãŠã䜿çšããäŸã¯æ¬¡ã®ãšããã§ãããªãŒãã£ãªãã¹ãšãã«ããã£ãã«æ¡åŒµã
// ãããæåã«å®è¡ããŸã("ãªããŒãããªã³ã«ãã"--æåã¯äœãèãããŸãã)
r = {Out.ar(0, FreeVerb.ar(In.ar(55, 2), mix: 0.5, room: 0.9, mul: 0.4))}.play;
// ããã§ãã®2çªç®ãå®è¡ããŸã("ããžãŒããŒã³ããªããŒããã¹ã«feedãã")
a = {Out.ar(55, SinOsc.ar([800, 880], mul: LFPulse.ar(2)))}.play;
a.free;
ãã«ããã£ãã«æ¡åŒµã®ãããã§ãããžãŒããŒã³ã¯2ã€ã®ãã£ãã«ã䜿çšããŸãã (ã·ã³ã»aã§)ããžãŒããŒã³ã bus 55 ã«ã«ãŒãã£ã³ã°ãããšã2ã€ã® bus ãå®éã«äœ¿ãæããããŸããbus 55 ãšãããé£ã® bus 56 ã§ããreverb (synth r) ã§ã¯ãIn.ar(55, 2) 㧠bus 55 ããå§ãŸã2ã€ã®ãã£ã³ãã«ãèªã¿åãããå ŽåïŒ55ãš56ã®äž¡æ¹ã reverb ã«å ¥ããŸããreverb ã®åºåã2ã€ã®ãã£ã³ãã«ã«æ¡åŒµããããããsynth r 㯠bus 0 ãš bus 1 (ãµãŠã³ãã«ãŒãã®å·Šå³ã®ãã£ã³ãã«)ã«ãµãŠã³ããéä¿¡ããŸãã
ä»ããœãŒã¹ã·ã³ã»ããšãã§ã¯ãã·ã³ã»ã«æ¥ç¶ããããã® bus çªå·(55)ã®éžæã¯ä»»æã§ãã: 16ãã127ã®éã®ä»ã®çªå·ã§ãããŸããŸãã( bus 0 ãã15ã¯ãµãŠã³ãã«ãŒãã®åºåãšå ¥åã®ããã«äºçŽãããŠããŸã)ã
bus çªå·ãèªåã§ãã©ããã³ã°ããªããã°ãªããªããšããããã©ãã»ã©äžäŸ¿ã§ããããããããè€éã«ãªã£ããããã«ãæªå€¢ãæ³åããŠãã ããã"ãªããŒãçšã«å床éžæãã bus çªå·ã¯ïŒ59ãŸãã¯95ã§ãããïŒé 延㮠bus çªå·ã¯ã©ãã§ããïŒ27ã ã£ããšæãïŒæãåºããªã..." ãªã©ãªã©ã
SuperCollider ã¯ãBusãªããžã§ã¯ãã䜿çšããŠãããåŠçããŸããäžèšã®äŸã§ã¯ããã¢ã³ã¹ãã¬ãŒã·ã§ã³ã®ããã«æªåé«ã bus 55 ã®ã¿ãæåã§å²ãåœãŠãŸããã SuperCollider ã®æ¥åžžç掻ã§ã¯ãã·ã³ãã«ã« Bus ãªããžã§ã¯ãã䜿çšããã¹ãã§ãã Bus ãªããžã§ã¯ãã¯ãåžžã«äœ¿çšå¯èœãª bus ãéžæããŠäœæ¥ãè¡ããŸãããããããªãã®äœ¿ãæ¹ã§ãïŒ
// ãã¹ãäœæ
~myBus = Bus.audio(s, 2);
// ãªããŒãããªã³ã«ããïŒmyBus(ãœãŒã¹ãµãŠã³ã)ããèªã¿åããŸã
r = {Out.ar(0, FreeVerb.ar(In.ar(~myBus, 2), mix: 0.5, room: 0.9, mul: 0.4))}.play;
// ããžãŒããŒã³ãâŒmyBusã«ãã£ãŒã
b = {Out.ar(~myBus, SinOsc.ar([800, 880], mul: LFPulse.ar(2)))}.play;
// äž¡æ¹ã®ã·ã³ã»ã解æŸ
r.free; b.free;
Bus.audio ã®æåã®åŒæ°ã¯ããµãŒããŒãè¡šãå€æ°sã§ãã2çªç®ã®åŒæ°ã¯ãå¿ èŠãªãã£ãã«ã®æ°ã§ãïŒäŸã§ã¯2ïŒã次ã«ããããæå³ã®ããååã®å€æ°ã«å ¥ããŸãïŒäŸã§ã¯âŒmyBus ã§ãããâŒreverbBusãâŒsourceã~tangerineããŸãã¯ãããã§æå³ã®ãããã®ïŒããã®åŸããã®ãã¹ãåç §ããå¿ èŠããããšãã¯ãã€ã§ããäœæããå€æ°ã䜿çšããŸãã
ãã³ãã³ã°ãšã¯ããªãŒãã£ãªä¿¡å·ãã¹ãã¬ãªãŸãã¯ãã«ããã£ã³ãã«ã®é³å Žã«åºããããšã§ãã以äžã¯ãPan2 ã«ãã£ãŠå·Šå³ã®ãã£ã³ãã«éã§è·³ãè¿ãã¢ãä¿¡å·ã§ãã*
p = {Pan2.ar(in: PinkNoise.ar, pos: SinOsc.kr(2), level: 0.1)}.play;
p.free;
Pan2 ãã«ããã¡ã€ã«ãããåŒæ°pos(äœçœ®)ã-1(å·Š)ãã+1(å³)ã®éã®æ°å€ãæåŸ ãã0ãäžå¿ã§ããããšãããããŸãããã®ãããSinOscãçŽæ¥ãã®åŒæ°ã«äœ¿çšã§ããŸããsine oscillator ã¯ãã€ããŒã© UGenã§ãããããããã©ã«ãã§-1ã+1ã®æ°å€ãåºåããŸãã
*ãã«ããã£ã³ãã«ãã³ãã³ã°ã«ã€ããŠã¯ãPan4 ããã³ PanAz ãã芧ãã ãããäžçŽãŠãŒã¶ãŒã¯ãAmbisonics ã® SuperCollider ãã©ã°ã€ã³ãã芧ãã ããã
以äžã«ããã詳现ãªäŸã瀺ããŸããã®ãããæ³¢ã¯ãéåžžã«éããã³ããã¹ãã£ã«ã¿ãŒãééããŸãïŒrqïŒ0.01ïŒãããŒã«ã«å€æ°ã䜿çšããŠãã³ãŒãã®ããŸããŸãªéšåãã¢ãžã¥ãŒã«åããããšã«æ³šæããŠãã ããã äžèšã®äŸã§ã§ããéãåæããŠç解ããããšããŸãããã次ã«ã以äžã®è³ªåã«çããŠãã ããã
(
x = {
var lfn = LFNoise2.kr(1);
var saw = Saw.ar(
freq: 30,
mul: LFPulse.kr(
freq: LFNoise1.kr(1).range(1, 10),
width: 0.1));
var bpf = BPF.ar(in: saw, freq: lfn.range(500, 2500), rq: 0.01, mul: 20);
Pan2.ar(in: bpf, pos: lfn);
}.play;
)
x.free;
質åïŒ
ïŒaïŒå€æ° lfn ã¯2ã€ã®ç°ãªãå Žæã§äœ¿çšãããŸããã©ãããŠïŒ ïŒçµæã¯ã©ããªããŸããïŒïŒ ïŒbïŒBPFã®mulïŒåŒæ°ã20ãã10ã5ããŸãã¯1ã«å€æŽãããšã©ããªããŸããïŒ ãªã20ãšããé«ãæ°å€ã䜿çšãããã®ã§ããïŒ ïŒcïŒã³ãŒãã®ã©ã®éšåããªãºã ãå¶åŸ¡ããŠããŸããïŒ
åçã¯ãã®ããã¥ã¡ã³ãã®æåŸã«ãããŸãã8
ããã«ã¯ãŒã«ãªããªãã¯ããããŸãããã«ããã£ã³ãã«æ¡åŒµã䜿çšããŠè€éãªãµãŠã³ããçæããããããã¹ãŠ Mix ãŸã㯠Splay ã§ã¢ãã©ã«ãŸãã¯ã¹ãã¬ãªã«ããã¯ã¹ããŠã³ã§ããŸã:
// 5ãã£ãã«åºåïŒã¡ãŒã¿ãŒãŠã£ã³ããŠãèŠãŠãã ããïŒ
a = { SinOsc.ar([100, 300, 500, 700, 900], mul: 0.1) }.play;
a.free;
// monoã«ããã¯ã¹ããŠã³:
b = { Mix(SinOsc.ar([100, 300, 500, 700, 900], mul: 0.1)) }.play;
b.free;
// ã¹ãã¬ãªã«ããã¯ã¹ããŠã³ããŸãïŒå·Šããå³ã«åçã«ïŒ
c = { Splay.ar(SinOsc.ar([100, 300, 500, 700, 900], mul: 0.1)) }.play;
c.free
// Splay ã楜ãã:
(
d = {arg fundamental = 110;
var harmonics = [1, 2, 3, 4, 5, 6, 7, 8, 9];
var snd = BPF.ar(
in: Saw.ar(32, LFPulse.ar(harmonics, width: 0.1)),
freq: harmonics * fundamental,
rq: 0.01,
mul: 20);
Splay.ar(snd);
}.play;
)
d.set(\fundamental, 100); // fundamental ãå€ããŠã¿ãŸã
d.free;
æåŸã® Splay ã®äŸã§ããã«ããã£ã³ãã«æ¡åŒµãæ©èœããŠããã®ãèŠãããšãã§ããŸããïŒ å¯äžã®éãã¯ãUGen ã§äœ¿çšãããåã«ãé åãæåã«å€æ°ïŒharmonicsïŒã«æ ŒçŽãããããšã§ããarray harmonics ã«ã¯9ã€ã®ã¢ã€ãã ããããããã·ã³ã»ã¯9ãã£ã³ãã«ã«æ¡åŒµãããŸãã次ã«ã.play ã®çŽåã«ãSplay ã¯9ã€ã®ãã£ã³ãã«ã®é åãåã蟌ã¿ãã¹ãã¬ãªã«ããã¯ã¹ããŠã³ããŠããã£ã³ãã«ãå·Šããå³ã«åçã«å±éããŸãã*
Mix ã«ã¯ãã1ã€ã®çŽ æŽãããããªãã¯ããããŸãïŒã¡ãœãã fill ã§ããã·ã³ã»ã®é åãäœæãããããäžåºŠã«ã¢ãã©ã«ã«ããã¯ã¹ããŠã³ããŸãã
// ã€ã³ã¹ã¿ã³ãã¯ã©ã¹ã¿ãŒãžã§ãã¬ãŒã¿ãŒ
c = { Mix.fill(16, {SinOsc.ar(rrand(100, 3000), mul: 0.01)}) }.play;
c.free;
// A note with 12 partials of decreasing amplitudes
(
n = { Mix.fill(12, {arg counter;
var partial = counter + 1; // 0ã§ã¯ãªã1ããéå§ããã
SinOsc.ar(partial * 440, mul: 1/partial.squared) * 0.1
})
}.play;
FreqScope.new;
)
n.free;
Mix.fill ã«ã¯ãäœæããé åã®ãµã€ãºãšãé åãåããããã«äœ¿çšãããé¢æ°ïŒäžæ¬åŒ§ïŒã®2ã€ã®ããšãæå®ããŸããäžèšã®æåã®äŸã§ã¯ãMix.fill ã¯é¢æ°ã16åè©äŸ¡ããŸããé¢æ°ã«ã¯å€æ°ãå«ãŸããŠããããšã«æ³šæããŠãã ãããsine ãªã·ã¬ãŒã¿ãŒã®åšæ³¢æ°ã¯ã100ãã3000ã®éã®ä»»æã®ä¹±æ°ã«ããããšãã§ããŸãããããããç°ãªãã©ã³ãã åšæ³¢æ°ãæã€16ã®æ£åŒŠæ³¢ãäœæãããŸãããããã¯ãã¹ãŠã¢ãã©ã«ã«ããã¯ã¹ããŠã³ãããçµæãå·Šãã£ã³ãã«ã§èããããŸãã2çªç®ã®äŸã¯ãé¢æ°ãïŒ Array.fill ã®ããã«ïŒå埩åæ°ã远跡ãã counter åŒæ°ãåãããšãã§ããããšã瀺ããŠããŸãã
12åã® sine ãªã·ã¬ãŒã¿ãŒãããŒã¢ããã¯ã·ãªãŒãºã«ç¶ããŠçæãããã¢ãã©ã«ã§åäžã®ããŒãã«ããã¯ã¹ããŠã³ãããŸãã
*.play ã®åã®æåŸã®è¡ã¯ãOut.ar(0, Splay.ar(snd)) ãšããŠæ瀺çã«èšè¿°ã§ããŸããSuperCollider ãäžå¯§ã«ã®ã£ãããåããããã« Out.ar(0...) ãæå ¥ããŠããããšãå¿ããªãã§ãã ãããããã¯ãã·ã³ã»ããå·Š (bus 0) ãšå³ (bus 1) ã®ãã£ã³ãã«ã§åçããå¿ èŠãããããšãèªèããŠããããšã§ãã
ãŸãããµãŠã³ããã¡ã€ã«ããããã¡ã«ããŒãããå¿ èŠããããŸããBuffer.read ã®2çªç®ã®åŒæ°ã¯ãäºéåŒçšç¬Š "" ã§å²ãŸãããµãŠã³ããã¡ã€ã«ã®ãã¹ã§ããã³ã³ãã¥ãŒã¿äžã®WAVãŸãã¯AIFFãã¡ã€ã«ãæãããã«ãããã«å¿ããŠå€æŽããå¿ èŠããããŸãããããã¡ãããŒããããããPlayBuf UGen ã䜿çšããŠããŸããŸãªæ¹æ³ã§ãããã¡ãåçããŸãã
ãã³ãïŒ |
---|
ã³ã³ãã¥ãŒã¿ãŒã«ä¿åãããŠãããµãŠã³ããã¡ã€ã«ã®æ£ãããã¹ãååŸããç°¡åãªæ¹æ³ã¯ããã¡ã€ã«ã空ã®SuperColliderããã¥ã¡ã³ãã«ãã©ãã°ããããšã§ããSCã¯æ¢ã«äºéåŒçšç¬Šã§å²ãŸããå®å šãªãã¹ãèªåçã«æäŸããŸãïŒ |
// buffersã«ããŒãããŸã:
~buf1 = Buffer.read(s, "/home/Music/wheels-mono.wav"); // 1ã€ã®ãµãŠã³ããã¡ã€ã«
~buf2 = Buffer.read(s, "/home/Music/mussorgsky.wav"); // å¥ã®ãµãŠã³ããã¡ã€ã«
// ãã¬ã€ããã¯:
{PlayBuf.ar(1, ~buf1)}.play; // number of channels and buffer
{PlayBuf.ar(1, ~buf2)}.play;
// ãã¡ã€ã«ã®æ
å ±ãåŸã:
[~buf1.bufnum, ~buf1.numChannels, ~buf1.path, ~buf1.numFrames];
[~buf2.bufnum, ~buf2.numChannels, ~buf2.path, ~buf2.numFrames];
// 'rate'ã«ãã£ãŠãã¬ã€ããã¯ã¹ããŒããå€ãã
{PlayBuf.ar(numChannels: 1, bufnum: ~buf1, rate: 2, loop: 1)}.play;
{PlayBuf.ar(1, ~buf1, 0.5, loop: 1)}.play; // ååã®é床ã§ãã¬ã€ãã
{PlayBuf.ar(1, ~buf1, Line.kr(0.5, 2, 10), loop: 1)}.play; // ã¹ããŒãã¢ãã
{PlayBuf.ar(1, ~buf1, MouseY.kr(0.5, 3), loop: 1)}.play; // ããŠã¹ã³ã³ãããŒã«ã§
// æ¹åãå€ãã(reverse)
{PlayBuf.ar(1, ~buf2, -1, loop: 1)}.play; // éåçreverse sound
{PlayBuf.ar(1, ~buf2, -0.5, loop: 1)}.play; // play ååã®ã¹ããŒãã§éåç
åã® PlayBuf ã®äŸã§ã¯ãåè¡ã®åŸã« [ctrl+.] ãæŒããŠãµãŠã³ããåæ¢ããå¿ èŠããããŸãããä»ã®äŸã§ã¯ãã·ã³ã»ãå€æ°ïŒ x = {WhiteNoise.ar}.playãªã©ïŒã«å²ãåœãŠãŠãx.free ã§çŽæ¥åæ¢ã§ããããã«ããŸããã SuperCollider ã§ã·ã³ã»ãäœæãããã³ã«ãããµãŠã³ããšã³ãžã³ãã§ãããµãŒããŒã§å®è¡ãããããšãããããŸãããµãŒããŒã§å®è¡ãããŠããåã·ã³ã»ã¯ãããŒãã§è¡šãããŸããã³ãã³ã s.plotTree ã䜿çšããŠããã®ããŒãããªãŒãèŠãããšãã§ããŸãããããè©ŠããŠã¿ãŠãã ãããNodeTree ãšããååã®ãŠã£ã³ããŠãéããŸãã
// GUI ããªãŒãã³
s.plotTree;
// ãããã1ã€ãã€å®è¡ãïŒãµãŠã³ããåæ¢ããªãã§ãã ããïŒãããŒãããªãŒãç£èŠããŸã:
w = { SinOsc.ar(60.midicps, 0, 0.1) }.play;
x = { SinOsc.ar(64.midicps, 0, 0.1) }.play;
y = { SinOsc.ar(67.midicps, 0, 0.1) }.play;
z = { SinOsc.ar(71.midicps, 0, 0.1) }.play;
w.free;
x.free;
y.free;
z.free;
ããŒãããªãŒã«è¡šç€ºããããã¹ãŠã®é·æ¹åœ¢ã¯ãã·ã³ã»ããŒãã§ããåã·ã³ã»ã«ã¯äžæçãªååïŒtemp_101ãtemp_102ãªã©ïŒãä»ããããå®è¡äžã¯ããã«ãšã©ãŸããŸãã4ã€ã®ãµã€ã³ãããäžåºŠåçããŠã[ctrl+.] ãæŒããŸãïŒããŒãããªãŒãŠã£ã³ããŠã確èªããŸãïŒãã·ã§ãŒãã«ãã [ctrl+.] ã¯ããµãŒããŒã§å®è¡ãããŠãããã¹ãŠã®ããŒããäžåºŠã«ç¡æ æ²ã«åæ¢ããŸããäžæ¹ã.free ã¡ãœããã䜿çšãããšãããããŸãã«ãç¹å®ã®ããŒãã1ã€ãã€è§£æŸã§ããŸãã
éèŠãªããšã®1ã€ã¯ãç¡é³ã®ã¿ãçæããŠããå Žåã§ããã·ã³ã»ããµãŒããŒã§å®è¡ããããŸãŸã«ãªãå¯èœæ§ãããããšã§ãã以äžã«äŸã瀺ããŸãããã® WhiteNoise UGen ã®æ¯å¹ ã¯ã2ç§ã§0.2ãã0ã«ãªããŸãããã®åŸãäœãèãããŸãããããããã·ã³ã»ããŒãã¯ãŸã ããã«ããã解æŸãããŸã§æ¶ããŸããã
1 // ããŒãããªãŒãŠã£ã³ããŠãæ°ç§éç£èŠãã
2 x = {WhiteNoise.ar(Line.kr(0.2, 0, 2))}.play;
3 x.free;
幞ããªããšã«ãã·ã³ã»ãããã¹ããŒãã«ããæ¹æ³ããããŸããããšãã°ãLine.kr ã«ãžã§ããçµäºãããšãïŒ0.2ãã0ãžã®ã©ã³ãïŒã«éç¥ããããã«Line.kr ã«äŸé Œã§ãããšäŸ¿å©ã§ãããïŒãããªãã°ã·ã³ã»ã¯èªåçã«è§£æŸãããŸããã åŒæ° doneAction: 2 ãå ¥åããŠããã¹ãŠã®åé¡ã解決ããŸãã 以äžã®äŸãåçããdoneAction: 2 ã䜿çšããå Žåãšäœ¿çšããªãå Žåã®åäœãæ¯èŒããŸãã
è¡ãå®è¡ããªããããŒãããªãŒãèŠãŠã¿ãŸãããã
// doneAction: 2 ç¡ãã§
{WhiteNoise.ar(Line.kr(0.2, 0, 2))}.play;
{PlayBuf.ar(1, ~buf1)}.play; // PS. ããã¯ããŸã åã®ã»ã¯ã·ã§ã³ãåŒãç¶ã㧠~buf1 ã«ãµãŠã³ããã¡ã€ã«ãèªã¿èŸŒãŸããŠããããšãåæãšããŠããŸã
// doneAction: 2 ã䜿ããŸã
{WhiteNoise.ar(Line.kr(0.2, 0, 2, doneAction: 2))}.play;
{PlayBuf.ar(1, ~buf1, doneAction: 2)}.play;
doneAction: 2 ã®ã·ã³ã»ã¯ããžã§ããå®äºãããšããã«ïŒã€ãŸããæåã®äŸã§ Line.kr ã©ã³ããçµäºãã2çªç®ã®äŸã®ãµãŠã³ããã¡ã€ã«ã® PlayBuf.ar ãåçãçµäºãããšããã«ïŒèªåçã«è§£æŸãããŸãããã®ç¥èã¯ã次ã®ã»ã¯ã·ã§ã³ããšã³ãããŒããã§éåžžã«åœ¹ç«ã¡ãŸãã
ãããŸã§ã®äŸã®ã»ãšãã©ã¯é£ç¶é³ã§ãããé³ã®æ¯å¹ ãšã³ãããŒãã圢äœãæ¹æ³ãåŠã¶æãæ¥ãŸãããå§ããã®ã«è¯ãäŸã¯ãããŒã«ãã·ã ãšã³ãããŒãã§ãã
ã·ã³ãã«ã®ã¯ã©ãã·ã¥ãæ³åããŠãã ãããé³ãç¡é³ããæ倧æ¯å¹ ã«ãªããŸã§ã«ãããæéã¯éåžžã«çããããããæ°ããªç§ã§ããããã¯ãattack time ãšåŒã°ããŸããã·ã³ãã«ã®é³ãæ倧æ¯å¹ ããç¡é³ïŒãŒãïŒã«æ»ããŸã§ã«ãããæéã¯ãããå°ãé·ããããããæ°ç§ã§ãããã㯠release time ãšåŒã°ããŸãã
æ¯å¹ ãšã³ãããŒãã¯ãåã«é³ãçæãã UGen ã®ä¹æ°ïŒmulïŒãšããŠäœ¿çšãããæéãšãšãã«å€åããæ°å€ãšèããŠãã ããããããã®æ°å€ã¯ãSuperCollider ãæ¯å¹ ãç解ããæ¹æ³ã§ããããã0ïŒç¡é³ïŒãã1ïŒãã«ã¢ã³ãïŒã®éã§ããå¿ èŠããããŸãã
ãããŸã§ã«ãæåŸã®äŸã«ã¯æ¢ã«æ¯å¹ ãšã³ãããŒããå«ãŸããŠããããšã«æ°ä»ãããããããŸããã {WhiteNoise.ar(Line.kr(0.2, 0, 2, doneAction: 2))}.play ã«ãã£ãŠã2ç§éã§ãã¯ã€ããã€ãºã®æ¯å¹ ã0.2ãã0ã«å€æŽããŸãããã ããLine.kr ã¯ãéåžžã«æè»ãªã¿ã€ãã®ãšã³ãããŒãã§ã¯ãããŸããã
Env ã¯ãããããçš®é¡ã®ãšã³ãããŒããå®çŸ©ããããã«åžžã«äœ¿çšãããªããžã§ã¯ãã§ããEnv ã«ã¯å€ãã®äŸ¿å©ãªã¡ãœããããããŸããããã§ã¯å°ãã ãèŠãŸãã詳现ã«ã€ããŠã¯ãEnv ãã«ããã¡ã€ã«ãã芧ãã ããã
Env.perc ã¯ãããŒã«ãã·ããªãšã³ãããŒããååŸãã䟿å©ãªæ¹æ³ã§ããããã¯ãattackTimeãreleaseTimeãlevelãããã³ curve ã®4ã€ã®åŒæ°ãåããŸããã·ã³ã»ä»¥å€ã®å žåçãªã·ã§ã€ããèŠãŠã¿ãŸãããã
Env.perc.plot; // ãã¹ãŠã®ããã©ã«ãåŒæ°ã䜿çš
Env.perc(0.5).plot; // attackTime: 0.5
Env.perc(attackTime: 0.3, releaseTime: 2, level: 0.4).plot;
Env.perc(0.3, 2, 0.4, 0).plot; // äžãšåãããã ããcurveïŒ0ã¯çŽç·ãæå³ããŸã
ããã§ã次ã®ãããªã·ã³ã»ã«ç°¡åã«æ¥ç¶ã§ããŸã:
{PinkNoise.ar(Env.perc.kr(doneAction: 2))}.play; // ããã©ã«ã Env.perc åŒæ°
{PinkNoise.ar(Env.perc(0.5).kr(doneAction: 2))}.play;
{PinkNoise.ar(Env.perc(0.3, 2, 0.4).kr(2))}.play;
{PinkNoise.ar(Env.perc(0.3, 2, 0.4, 0).kr(2))}.play;
Env.perc ã®çŽåŸã« .kr(doneAction: 2) ãè¿œå ããã ãã§ãæºåå®äºã§ããå®éããã®å Žå㯠doneAction ã®æ瀺çãªå®£èšãåé€ããŠãã·ã³ãã«ã« .kr(2) ã䜿çšããããšãã§ããŸãã.kr ã¯ãSCã«ãã®ãšã³ãããŒããã³ã³ãããŒã« ã¬ãŒãã§ãå®è¡ãããããã«äŒããŠããŸãïŒããããåã§èŠãä»ã®ã³ã³ãããŒã« ã¬ãŒãä¿¡å·ãšåæ§ïŒã
Env.triangle ã¯ãduration, level ã®2ã€ã®åŒæ°ã®ã¿ãåããŸãã
äŸïŒ
// ãããèŠãŠ:
Env.triangle.plot;
// ãããèŽããŠ:
{SinOsc.ar([440, 442], mul: Env.triangle.kr(2))}.play;
// ãšããã§ããšã³ãããŒãã¯ã³ãŒãã®ä»»æã®å Žæã§ä¹æ°ã«ããããšãã§ããŸã
{SinOsc.ar([440, 442]) * Env.triangle.kr(2)}.play;
Env.linen ã¯ãã¢ã¿ãã¯ããµã¹ãã€ã³éšåãããã³ãªãªãŒã¹ãå«ãã©ã€ã³ãšã³ãããŒãã«ã€ããŠèª¬æããŠããŸããã¬ãã«ãšæ²ç·ã®çš®é¡ãæå®ã§ããŸãã äŸïŒ
// ãããèŠãŠ:
Env.linen.plot;
// ãããèŽããŠ:
SinOsc.ar([300, 350], mul: Env.linen(0.01, 2, 1,
0.2).kr(2))}.play;
ããã«æè»æ§ãå¿ èŠã§ããïŒ Env.pairs ã䜿çšãããšãä»»æã®åœ¢ç¶ãšæéã®ãšã³ãããŒããäœæã§ããŸãã Env.pairs ã¯ã2ã€ã®åŒæ°ãåããŸãã[time, level] ãã¢ã®é åãããã³æ²ç·ã®ã¿ã€ã(䜿çšå¯èœãªãã¹ãŠã®æ²ç·ã¿ã€ãã«ã€ããŠã¯ãEnv Helpãã¡ã€ã«ãåç §ããŠãã ãã)ã
(
{
var env = Env.pairs([[0, 0], [0.4, 1], [1, 0.2], [1.1, 0.5], [2, 0]], \lin);
env.plot;
SinOsc.ar([440, 442], mul: env.kr(2));
}.play;
)
次ã®ãããªãã¢ã®é åãèªã¿åããŸã:
â At time 0, be at level 0;
â At time 0.4, be at level 1;
â At time 1, be at level 0.2;
â At time 1.1, be at level 0.5;
â At time 2, be at level 0.
ãããã®åãã·ã§ã€ãã䜿çšããŠæ¯å¹ 以å€ã®äœããã³ã³ãããŒã«ããããšã劚ãããã®ã¯äœããããŸããã å¿ èŠãªæ°å€ã®ç¯å²ã«åãããŠã¹ã±ãŒãªã³ã°ããå¿ èŠããããŸãã ããšãã°ããšã³ãããŒããäœæããŠãæéã®çµéã«äŒŽãåšæ³¢æ°ã®å€åãã³ã³ãããŒã«ã§ããŸãã
(
{
var freqEnv = Env.pairs([[0, 100], [0.4, 1000], [0.9, 400], [1.1, 555], [2,
440]], \lin);
SinOsc.ar(freqEnv.kr, mul: 0.2);
}.play;
)
ãšã³ãããŒãã¯ãæéã®çµéãšãšãã«å€åããå¿ èŠãããã·ã³ã»ãã©ã¡ãŒã¿ãŒãã³ã³ãããŒã«ãã匷åãªæ¹æ³ã§ãã
ãããŸã§ã«è¡šç€ºããããã¹ãŠã®ãšã³ãããŒãã«ã¯ã1ã€ã®å ±éç¹ããããŸãããããã¯ãäºåå®çŸ©ãããåºå®ã® duration ãæã£ãŠããŸãããã ãããã®ã¿ã€ãã®ãšã³ãããŒããé©åã§ãªãå ŽåããããŸããããšãã°ãMIDIããŒããŒãã§æŒå¥ããŠãããšããŸããããŒãæŒããšãããŒãã® attack ãããªã¬ãŒãããŸãããªãªãŒã¹ã¯ãããŒããæãé¢ãããšãã§ãããã ããäºåã«ã¯æãããŒæŒããŠããæéã¯ããããŸããããã®å Žåã«å¿ èŠãªã®ã¯ãããããâæç¶ãšã³ãããŒãâã§ãã
ASRïŒã¢ã¿ãã¯ããµã¹ãã€ã³ããªãªãŒã¹ïŒããšã³ãããŒãã«é©åããŸããããäžè¬çãªããªãšãŒã·ã§ã³ã¯ãADSRãšã³ãããŒãïŒ AttackãDecayãSustainãRelease ïŒã§ããäž¡æ¹èŠãŠã¿ãŸãããã
// ASR
// é³ããã¬ã€ ('press key')
// attackTime: 0.5 seconds, sustainLevel: 0.8, releaseTime: 3 seconds
x = {arg gate = 1, freq = 440; SinOsc.ar(freq: freq, mul: Env.asr(0.5, 0.8, 3).kr(
doneAction: 2, gate: gate))}.play;
// é³ãæ¢ãã ('finger off the key' ô activate release stage)
x.set(\gate, 0); // alternatively, x.release
// ADSR (attack, decay, sustain, release)
// é³ããã¬ã€:
(
d = {arg gate = 1;
var snd, env;
env = Env.adsr(0.01, 0.4, 0.7, 2);
snd = Splay.ar(BPF.ar(Saw.ar((32.1, 32.2..33)), LFNoise2.kr(12).range(100,1000), 0.05, 10));
Out.ar(0, snd * env.kr(doneAction: 2, gate: gate));
}.play;
)
// é³ãæ¢ãã:
d.release; // ãã㯠d.set(\gate, 0); åçã§ã
Key concepts:
AttackããŒãïŒç¡é³ïŒããããŒã¯æ¯å¹ ãŸã§ã«ãããæéïŒç§ïŒ
DecayãããŒã¯æ¯å¹ ãããµã¹ãã€ã³æ¯å¹ ãŸã§äžéããã®ã«ãããæéïŒç§ïŒ
Sustainãé³ãä¿æããæ¯å¹ ïŒ0ã1ïŒïŒéèŠïŒããã¯æéãšã¯é¢ä¿ãããŸããïŒ
Releaseããµã¹ãã€ã³ã¬ãã«ãããŒãïŒç¡é³ïŒã«ãªããŸã§ã«ãããæéïŒç§åäœïŒã
æç¶ãšã³ãããŒãã«ã¯äºåã«ããã£ãŠãã total duration ããªãããããã€ã¹ã¿ãŒããã( attack ãããªã¬ãŒãã)ãããã€åæ¢ãã( release ãããªã¬ãŒãã)ããéç¥ããå¿ èŠããããŸãããã®éç¥ã¯ gate ãšåŒã°ããŸããgate ã¯ããšã³ãããŒãã«"éã"(1)ãš"éãã"(0)ãæ瀺ãããã®ã§ãããé³ãéå§ããã³åæ¢ããŸãã
ASRãŸãã¯ADSRãšã³ãããŒããã·ã³ã»ã§æ©èœãããã«ã¯ãgate åŒæ°ã宣èšããå¿ èŠããããŸããéåžžãã·ã³ã»ã®åçãããã«éå§ãããããããã©ã«ã㯠gate = 1 ã§ããã·ã³ã»ãåæ¢ãããå Žåã¯ãåã« .release ãŸã㯠.set(\gate,0) ã¡ãã»ãŒãžãéä¿¡ããŸãããšã³ãããŒãã®ãªãªãŒã¹éšåãããªã¬ãŒãããŸããããšãã°ããªãªãŒã¹æéã3ã®å Žåãã¡ãã»ãŒãž .set(\gate,0) ãéä¿¡ããç¬éããé³ãæ¶ãããŸã§3ç§ããããŸãã
èšé²ã«ã€ããŠã¯ã以äžã®ã³ãŒãã«ç€ºãããã«ããšã³ãããŒããçæããããã«ãã®ã»ã¯ã·ã§ã³ã§åŠãã æ§æã¯ã·ã§ãŒãã«ããïŒççž®ïŒã§ããããšãç¥ã£ãŠããå¿ èŠããããŸãã
// ããã¯:
{ SinOsc.ar * Env.perc.kr(doneAction: 2) }.play;
// ... ããã®ã·ã§ãŒãã«ããã§ã:
{ SinOsc.ar * EnvGen.kr(Env.perc, doneAction: 2) }.play;
EnvGen ã¯ãEnv ã«ãã£ãŠå®çŸ©ããããã¬ãŒã¯ãã€ã³ããšã³ãããŒããå®éã«åçãã UGen ã§ãããã¹ãŠã®å®çšçãªç®çã®ããã«ãã·ã§ãŒãã«ããïŒç瞮圢ïŒãåŒãç¶ã䜿çšã§ããŸãããã ãããã«ããã¡ã€ã«ããã®ä»ã®ãªã³ã©ã€ã³äŸã§ EnvGen ã䜿çšãããŠããããšãããããã®ã§ããããã®è¡šèšã¯åçã§ããããšãç¥ã£ãŠãããšäŸ¿å©ã§ãã
ãããŸã§ãã·ã³ã»ãã·ãŒã ã¬ã¹ã«å®çŸ©ããããã«åçããŠããŸãããããã«ã.set ã¡ãã»ãŒãžã«ãããã·ã³ã»ã³ã³ãããŒã«ããªã¢ã«ã¿ã€ã ã§å€æŽã§ããæè»æ§ãåŸãããŸããããã ããã·ã³ã»ãæåã«å®çŸ©ã(ããã«åçããã«)ãåŸã§ã®ã¿åçãããå ŽåããããŸããã€ãŸããã¬ã·ããæžãçããç¬é(ã·ã³ã»ã®å®çŸ©)ãšã±ãŒããçŒãç¬é(ãµãŠã³ããäœæãã)ãåé¢ããå¿ èŠããããšããããšã§ãã
SynthDef ã¯ãã·ã³ã»ã®"ã¬ã·ããæžã"ããã«äœ¿çšãããã®ã§ãããã®åŸãSynth ã§åçã§ããŸãã以äžã«ç°¡åãªäŸã瀺ããŸãã
// SynthDefãªããžã§ã¯ãã䜿çšããã·ã³ã»å®çŸ©
SynthDef("mySine1", {Out.ar(0, SinOsc.ar(770, 0, 0.1))}).add;
// Synthãªããžã§ã¯ãã§é³ããã¬ã€ãã
x = Synth("mySine1");
x.free;
// åŒæ°ã䜿çšããããå°ãæè»ãªäŸ
// and èªå·±çµäºãšã³ãããŒã (doneAction: 2)
SynthDef("mySine2", {arg freq = 440, amp = 0.1;
var env = Env.perc(level: amp).kr(2);
var snd = SinOsc.ar(freq, 0, env);
Out.ar(0, snd);
}).add;
Synth("mySine2"); // ããã©ã«ãå€ã䜿çšãã
Synth("mySine2", [\freq, 770, \amp, 0.2]);
Synth("mySine2", [\freq, 415, \amp, 0.1]);
Synth("mySine2", [\freq, 346, \amp, 0.3]);
Synth("mySine2", [\freq, rrand(440, 880)]);
SynthDef ã®æåã®åŒæ°ã¯ãã·ã³ã»ã®ãŠãŒã¶ãŒå®çŸ©åã§ãã 2çªç®ã®åŒæ°ã¯ UGen ã°ã©ããæå®ããé¢æ°ã§ãïŒããã UGen ã®çµã¿åãããåŒã³åºãããæ¹æ³ã§ãïŒãOut.ar ãæ瀺çã«äœ¿çšããŠãä¿¡å·ãéä¿¡ãããã¹ãæå®ããå¿ èŠãããããšã«æ³šæããŠãã ãããæåŸã«ãSynthDef ã¯ã¡ãã»ãŒãž .add ãæåŸã«åãåããŸããã€ãŸããSCãèªèããŠããã·ã³ã»ã®ã³ã¬ã¯ã·ã§ã³ã«è¿œå ããããšã«ãªããŸãã
ããã¯ãSuperCollider ãçµäºãããŸã§æå¹ã§ãã SynthDef ã§1ã€ä»¥äžã®ã·ã³ã»å®çŸ©ãäœæããåŸãSynth ã§ããããåçã§ããŸãã
æåã®åŒæ°ã¯äœ¿çšããã·ã³ã»å®çŸ©ã®ååã§ã2çªç®ã®ïŒãªãã·ã§ãã«ïŒåŒæ°ã¯æå®ããããã©ã¡ãŒã¿ãŒïŒ freqãamp ãªã©ïŒãæã€é åã§ãã
ããã¯ãã£ãšé·ãäŸã§ããSynthDef ãè¿œå ããåŸãarray ããªãã¯ã䜿çšããŠãã©ã³ãã ãªããããšæ¯å¹ ã§6é³ã®ã³ãŒããäœæããŸããåã·ã³ã»ã¯ array ã®ã¹ãããã®1ã€ã«æ ŒçŽãããŠãããããåå¥ã«ãªãªãŒã¹ã§ããŸãã
// SynthDefãäœæãã
(
SynthDef("wow", {arg freq = 60, amp = 0.1, gate = 1, wowrelease = 3;
var chorus, source, filtermod, env, snd;
chorus = Lag.kr(freq,2) * LFNoise2.kr([0.4, 0.5, 0.7, 1, 2, 5, 10]).range(1,1.02);
source = LFSaw.ar(chorus) * 0.5;
filtermod = SinOsc.kr(1/16).range(1, 10);
env = Env.asr(1, amp, wowrelease).kr(2, gate);
snd = LPF.ar(in: source, freq: freq * filtermod, mul: env);
Out.ar(0, Splay.ar(snd))
}).add;
)
// ããŒãããªãŒãèŠã
s.plotTree;
// 6é³ã®åé³ãäœæãã
a = Array.fill(6, {Synth("wow", [\freq, rrand(40, 70).midicps, \amp, rrand(0.1, 0.5)
])}); // all in a single line
// 1ã€1ã€é³ããªãªãŒã¹
a[0].set(\gate, 0);
a[1].set(\gate, 0);
a[2].set(\gate, 0);
a[3].set(\gate, 0);
a[4].set(\gate, 0);
a[5].set(\gate, 0);
// ADVANCED: 6é³ã®ã³ãŒããå床å®è¡ããŠããã®è¡ãè©äŸ¡ããŸã.
// äœãèµ·ããŠããã®ãç解ã§ããŸããïŒ
SystemClock.sched(0, {a[5.rand].set(\freq, rrand(40, 70).midicps); rrand(3, 10)});
äžèšã® SynthDef ãç解ããããã«ïŒ
-
çµæãšããŠåŸããããµãŠã³ãã¯ãããŒãã¹ãã£ã«ã¿ãŒãééãã7ã€ã®å³å¯ã«èª¿æŽããããã³ã®ãªæ³¢ãªã·ã¬ãŒã¿ãŒã®åèšã§ãã
-
ãããã®7ã€ã®ãªã·ã¬ãŒã¿ãŒã¯ããã«ããã£ã³ãã«æ¡åŒµã«ããäœæãããŸãã
-
å€æ° chorus ãšã¯äœã§ããïŒ åšæ³¢æ° freq LFNoise2.kr ãæãããã®ã§ãã7é ç®ã®é åã LFNoise2 ã®åŒæ°ãšããŠæå®ãããŠããããããã«ããã£ãã«æ¡åŒµãããããå§ãŸããŸãããã®çµæãLFNoise2 ã®ã³ããŒã7ã€äœæãããåã³ããŒã¯ãªã¹ã [0.4, 0.5, 0.7, 1, 2, 5, 10] ããååŸããç°ãªãé床ã§å®è¡ãããŸããåºåã¯ã1.0ã1.02ã®ç¯å²ã«å¶éãããŸãã
-
è¿œå æ©èœãšããŠãfreq ã Lag.kr ã§å²ãŸããŠããããšã«æ³šæããŠãã ããããã®ã·ã³ã»ã«æ°ããåšæ³¢æ°å€ãå ¥åããããã³ã«ãLag UGenã¯å€ãå€ãšæ°ããå€ã®éã®ramp ãäœæããŸãããã®å Žåããé 延æéãïŒramp ã®æç¶æéïŒã¯2ç§ã§ããããããäŸã®æåŸã®è¡ãå®è¡ããåŸã«èãããã°ãªããµã³ãå¹æã«ãªããŸãã
-
ãœãŒã¹ãµãŠã³ã LFSaw.ar ã¯ãåšæ³¢æ°ãšããŠå€æ° chorus ã䜿çšããŸããå ·äœçãªäŸïŒ60 Hzã®åšæ³¢æ°å€ã®å Žåãå€æ° chorus ã¯æ¬¡ã®ãããªåŒã«ãªããŸã
60 * [1:01; 1:009; 1:0; 1:02; 1:015; 1:004; 1:019]
ãªã¹ãå ã®æ°å€ã¯ãå LFNoise2 ã®é床ã«å¿ããŠåžžã«äžäžã«å€åããŸããæçµçµæã¯ãåžžã« 60ã61.2 ïŒ60 * 1.02ïŒ ã®éã§ã¹ã©ã€ããã7ã€ã®åšæ³¢æ°ã®ãªã¹ãã§ããããã¯ã³ãŒã©ã¹ãšãã§ã¯ããšåŒã°ããŸãããŸãå€æ°åïŒchorusïŒã§ãã
-
å€æ° chorus ã LFSaw.ar ã® freq ãšããŠäœ¿çšãããšããã«ããã£ã³ãã«æ¡åŒµãçºçããŸããããã§ããããã«ç°ãªãåšæ³¢æ°ãæã€7ã€ã®ãã³ã®ãªæ³¢ãã§ããŸããã
-
å€æ° filtermod ã¯ãéåžžã«ãã£ããïŒ16ç§éã«1ãµã€ã¯ã«ïŒåãæ£åŒŠæ³¢ oscillator ã§ãããåºåç¯å²ã¯1ã10ã«ã¹ã±ãŒãªã³ã°ãããŸããããã¯ãããŒãã¹ãã£ã«ã¿ãŒã®ã«ãããªãåšæ³¢æ°ãå€èª¿ããããã«äœ¿çšãããŸãã
-
å€æ° snd ã¯ãããŒãã¹ãã£ã«ã¿ãŒïŒLPFïŒãä¿æããŸããLPF ã¯ãå ¥åãšããŠãœãŒã¹ãååŸããã«ãããªãåšæ³¢æ°ãè¶ ãããã¹ãŠã®åšæ³¢æ°ããã£ã«ã¿ãŒåŠçããŸãããã®ã«ãããªãã¯åºå®å€ã§ã¯ãªããåŒ freq * filtermod ã§ãããããã£ãŠãfreq = 60 ãæ³å®ããäŸã§ã¯ãããã¯60ã600ã®æ°å€ã«ãªããŸããfiltermod ã¯1ã10ã®éã§æ¯åããæ°å€ã§ãããããä¹ç®ã¯ 60 *(1ã10) ã«ãªããŸãã
-
LPF ã¯ããã«ããã£ãã«ã7ã€ã®ã³ããŒã«æ¡åŒµããŸããæ¯å¹ ãšã³ãããŒã env ãããã«é©çšãããŸãã
-
æåŸã«ãSplay ã¯ãã®7ã€ã®ãã£ã³ãã«ã®é åãåããã¹ãã¬ãªã«ããã¯ã¹ããŠã³ããŸãã
æåã« SynthDef ãäœæãïŒäžæã®ååã§ïŒã次㫠aSynth ãåŒã³åºããšãããã®2段éã®ããã»ã¹ã¯ã{SinOsc.ar} .play ã®ãããªåçŽãªã¹ããŒãã¡ã³ããèšè¿°ãããšãã«SCãåžžã«è¡ãããšã§ãã SuperCollider ã¯ããããïŒaïŒäžæç㪠SynthDef ã®äœæãããã³ïŒbïŒå³æåçïŒãããã£ãŠãPost ãŠã£ã³ããŠã«è¡šç€ºããã temp_01ãtemp_02 ãšããååïŒã«è§£åïŒunpacksïŒããŸããããªãã®äŸ¿å®ã®ããã«ããããã¯ãã¹ãŠèå°è£ã§ã
// ããããããšã:
{SinOsc.ar(440)}.play;
// SCããã£ãŠããã®ã¯ãã:
{Out.ar(0, SinOsc.ar(440))}.play;
// å®éã«ã¯ããããããšã§ã:
SynthDef("tempName", {Out.ar(0, SinOsc.ar(440))}).play;
// ãããŠããããã¯ãã¹ãŠããã®2ã¹ãããæäœãžã®ã·ã§ãŒãã«ããã§ã:
SynthDef("tempName", {Out.ar(0, SinOsc.ar(440))}).add; // ã·ã³ã»å®çŸ©ãäœæãã
Synth("tempName"); // play it
SynthDefs ãšããŠã·ã³ã»ãäœæããããšã®çŸããã®1ã€ã¯ãPbind ã䜿çšããŠããããåçã§ããããšã§ãã "wow" SynthDef ããŸã ã¡ã¢ãªã«ããŒããããŠãããšä»®å®ããŠïŒæåŸã®äŸã®åŸã§SCãçµäºããŠå床éããå Žåãé€ãïŒã以äžã® Pbinds ãè©ŠããŠãã ãã:
(
Pbind(
\instrument, "wow",
\degree, Pwhite(-7, 7),
\dur, Prand([0.125, 0.25], inf),
\amp, Pwhite(0.5, 1),
\wowrelease, 1
).play;
)
(
Pbind(
\instrument, "wow",
\scale, Pstutter(8, Pseq([
Scale.lydian,
Scale.major,
Scale.mixolydian,
Scale.minor,
Scale.phrygian], inf)),
\degree, Pseq([0, 1, 2, 3, 4, 5, 6, 7], inf),
\dur, 0.2,
\amp, Pwhite(0.5, 1),
\wowrelease, 4,
\legato, 0.1
).play;
)
Pbind ã䜿çšããŠã«ã¹ã¿ã SynthDef ã®1ã€ãåçãããšãã¯ã次ã®ç¹ã«æ³šæããŠãã ãã:
-
Pbind key\instrumentã䜿çšããŠãããªãã® SynthDef ã®ååã宣èšããŸãã
-
SynthDef ã®ãã¹ãŠã®åŒæ°ã¯ãPbind å éšããã¢ã¯ã»ã¹ããã³å¶åŸ¡ã§ããŸãã ãããã Pbind ããŒãšããŠäœ¿çšããã ãã§ããããšãã°ãäžèšã§äœ¿çšãã \wowrelease ãšããåŒæ°ã«æ³šç®ããŠãã ãããwow ãã㯠Pbind ãç解ããããã©ã«ãã®ããŒã®1ã€ã§ã¯ãªããã·ã³ã»å®çŸ©ã®åºæã®ããŒã§ãïŒå€ãªååã¯æå³çã«éžæãããŠããŸãïŒã
-
Pbind ã®ãã¹ãŠã®ãããå€ææ©èœïŒ \degreeã\noteãããã³ \midinote ã®ããŒïŒã䜿çšããã«ã¯ãSynthDef ã« freq ã®åŒæ°å ¥åãããããšã確èªããŸãïŒãã®ããã«æ£ç¢ºã«å ¥åããå¿ èŠããããŸãïŒãPbind ãèšç®ãè¡ããŸãã
-
Env.adsr ãªã©ãµã¹ãã£ãŒã³ãšã³ãããŒãã䜿çšããå Žåãã·ã³ã»ã«ããã©ã«ãã®åŒæ° gate = 1 ãèšå®ãããŠããããšã確èªããŠãã ããïŒ Pbind ã¯èå°è£ã§é©åãªã¿ã€ãã³ã°ã§ããŒããåæ¢ããããããã®ããã«æ£ç¢ºã«å ¥åããå¿ èŠããããŸãïŒã
-
ãµã¹ãã£ãŒã³ãšã³ãããŒãã䜿çšããŠããªãå ŽåãSynthDef ã«é©å㪠UGen ã« doneActionïŒ2 ãå«ãŸããŠããããšã確èªããŠããµãŒããŒå ã®ã·ã³ã»ããŒããèªåçã«è§£æŸããŸãã
æŒç¿ïŒ1ã€ä»¥äžã® Pbind ãäœæããŠã以äžã«ç€ºã "pluck" SynthDef ãåçããŸããmutedString åŒæ°ã«ã¯ã0.1ã0.9ã®å€ãè©ŠããŠãã ãããPbind ã®1ã€ã«ããã£ããããã³ãŒãã®ã·ãŒã±ã³ã¹ãåçãããŸãã\strum ã§åé³ãã¢ã«ããžãšã€ãããŠã¿ãŠãã ããã
(
SynthDef("pluck", {arg amp = 0.1, freq = 440, decay = 5, mutedString = 0.1;
var env, snd;
env = Env.linen(0, decay, 0).kr(doneAction: 2);
snd = Pluck.ar(
in: WhiteNoise.ar(amp),
trig: Impulse.kr(0),
maxdelaytime: 0.1,
delaytime: freq.reciprocal,
decaytime: decay,
coef: mutedString);
Out.ar(0, [snd, snd]);
}).add;
)
ãã®ãã¥ãŒããªã¢ã«ã®ååã§ããªãŒãã£ãª busïŒã»ã¯ã·ã§ã³30ïŒãšãã¹ãªããžã§ã¯ãïŒã»ã¯ã·ã§ã³33ïŒã«ã€ããŠèª¬æããŸããããªãŒãã£ãªã«ãŒãã£ã³ã°ã®æŠå¿µã«çŠç¹ãåãããããã«ãåœæã®ã³ã³ãããŒã«ãã¹ã®ãããã¯ã¯å¥ãšããŠãããŸããã SuperCollider ã®ã³ã³ãããŒã« bus ã¯ããªãŒãã£ãªã§ã¯ãªãã³ã³ãããŒã«ä¿¡å·ãã«ãŒãã£ã³ã°ããããã®ãã®ã§ãããã®éããé€ããŠããªãŒãã£ãª bus ãšã³ã³ãããŒã« bus ã®éã«å®çšçãŸãã¯æŠå¿µçãªéãã¯ãããŸããã
ã³ã³ãããŒã« bus ã®äœæãšç®¡çã¯ããªãŒãã£ãªãã¹ã§è¡ãã®ãšåãæ¹æ³ã§ã.ar ã®ä»£ããã« .kr ã䜿çšããã ãã§ããSuperCollider ã«ã¯ãããã©ã«ãã§4096åã®ã³ã³ãããŒã« bus ããããŸãã 以äžã®äŸã®æåã®éšåã§ã¯ããã¢ã³ã¹ãã¬ãŒã·ã§ã³ã®ããã ãã«ä»»æã® bus çªå·ã䜿çšããŸãã2çªç®ã®éšåã§ã¯ãbus ã®äœæã«æšå¥šãããBusãªããžã§ã¯ãã䜿çšããŸãã
// ã³ã³ãããŒã« bus 55ã«ã³ã³ãããŒã«ä¿¡å·ãæžã蟌ã
{Out.kr(55, LFNoise0.kr(1))}.play;
// ã³ã³ãããŒã« bus 55ããã³ã³ãããŒã«ä¿¡å·ãèªã¿åã
{In.kr(55).poll}.play;
// Busãªããžã§ã¯ãã®äœ¿çš
~myControlBus = Bus.control(s, 1);
{Out.kr(~myControlBus, LFNoise0.kr(5).range(440, 880))}.play;
{SinOsc.ar(freq: In.kr(~myControlBus))}.play;
次ã®äŸã¯ã2ã€ã®ç°ãªãã·ã³ã»ãåæã«å€èª¿ããããã«äœ¿çšãããåäžã®ã³ã³ãããŒã«ä¿¡å·ã瀺ããŠããŸããBlip ã·ã³ã»ã§ã¯ãå¶åŸ¡ä¿¡å·ã¯1ãã10ãŸã§ã®åé³ã®æ°ãã³ã³ãããŒã«ããããã«åã¹ã±ãŒãªã³ã°ãããŸãã2çªç®ã®ã·ã³ã»ã§ã¯ãåãã³ã³ãããŒã«ä¿¡å·ããã«ã¹ãªã·ã¬ãŒã¿ã®åšæ³¢æ°ãå€èª¿ããããã«åã¹ã±ãŒãªã³ã°ãããŸãã
// ã³ã³ãããŒã« bus ãäœæãã
~myControl = Bus.control(s, 1);
// ã³ã³ãããŒã«ä¿¡å·ã bus ã«éããŸã
c = {Out.kr(~myControl, Pulse.kr(freq: MouseX.kr(1, 10), mul: MouseY.kr(0, 1)))}.play;
// ã³ã³ãããŒã«ãããŠããé³ãåçãã
// ïŒããŠã¹ãåãããŠå€æŽãèãïŒ
(
{
Blip.ar(
freq: LFNoise0.kr([1/2, 1/3]).range(50, 60),
numharm: In.kr(~myControl).range(1, 10),
mul: LFTri.kr([1/4, 1/6]).range(0, 0.1))
}.play;
{
Splay.ar(
Pulse.ar(
freq: LFNoise0.kr([1.4, 1, 1/2, 1/3]).range(100, 1000) * In.kr(~myControl).range(0.9, 1.1),
mul: SinOsc.ar([1/3, 1/2, 1/4, 1/8]).range(0, 0.03))
)
}.play;
)
// æ¯èŒããã³ã³ãããŒã«ä¿¡å·ããªãã«ãã
c.free;
次ã®äŸã§ã¯ãã¡ãœãã asMap ã䜿çšããŠãå¶åŸ¡ãã¹ãå®è¡äžã®ã·ã³ã»ããŒãã«çŽæ¥ãããããŸãããã®æ¹æ³ã§ã¯ãã·ã³ã»ã®å®çŸ©ã« In.kr ãå¿ èŠãããŸããã
// SynthDef ãäœæãã
SynthDef("simple", {arg freq = 440; Out.ar(0, SinOsc.ar(freq, mul: 0.2))}).add;
// ã³ã³ãããŒã« bus ãäœæãã
~oneBus = Bus.control(s, 1);
~anotherBus = Bus.control(s, 1);
// Start controls
{Out.kr(~oneBus, LFSaw.kr(1).range(100, 1000))}.play;
{Out.kr(~anotherBus, LFSaw.kr(2, mul: -1).range(500, 2000))}.play;
// Start a note
x = Synth("simple", [\freq, 800]);
x.set(\freq, ~oneBus.asMap);
x.set(\freq, ~anotherBus.asMap);
x.free;
ã»ã¯ã·ã§ã³30ã§ãªãŒãã£ãªãã¹ã«ã€ããŠè°è«ãããšããå®è¡é åºã®éèŠæ§ã瀺åããŸããã 以äžã®ã³ãŒãã¯ãã»ã¯ã·ã§ã³30ã®ãã£ã«ã¿ãŒåŠçããããã€ãºã®äŸã®æ¡åŒµããŒãžã§ã³ã§ãã以äžã®èª¬æã§ã¯ãå®è¡é åºã®åºæ¬æŠå¿µã説æããå®è¡é åºãéèŠã§ããçç±ã瀺ããŸãã
// audio bus ãã€ãã
~fxBus = Bus.audio(s, 1);
~masterBus = Bus.audio(s, 1);
// SynthDef ãã€ãã
(
SynthDef("noise", {Out.ar(~fxBus, WhiteNoise.ar(0.5))}).add;
SynthDef("filter", {Out.ar(~masterBus, BPF.ar(in: In.ar(~fxBus), freq: MouseY.kr
(1000, 5000), rq: 0.1))}).add;
SynthDef("masterOut", {arg amp = 1; Out.ar(0, In.ar(~masterBus) * Lag.kr(amp, 1))}).
add;
)
// ããŒãããªãŒãŠã£ã³ããŠãéã:
s.plotTree;
// synth ããã¬ã€ïŒããŒãããªãŒãèŠãŸãïŒ
m = Synth("masterOut");
f = Synth("filter");
n = Synth("noise");
// ãã¹ã¿ãŒããªã¥ãŒã
m.set(\amp, 0.1);
æåã«ãå€æ° ~fxbus ããã³ ~masterBus ã«å²ãåœãŠããã2ã€ã®ãªãŒãã£ãª bus ã 次ã«ã3ã€ã® SynthDef ãäœæãããŸã:
-
ããã€ãºãã¯ããã¯ã€ããã€ãºããšãã§ã¯ã bus ã«éä¿¡ãããã€ãºãœãŒã¹ã§ã;
-
ããã£ã«ã¿ãŒãã¯ããšãã§ã¯ã bus ããå ¥åãåãåããåŠçããããµãŠã³ãããã¹ã¿ãŒ bus ã«éä¿¡ãããã³ããã¹ãã£ã«ã¿ãŒã§ã;
-
ãmasterOutãã¯ããã¹ã¿ãŒ bus ããã®ä¿¡å·ãåãåããåçŽãªããªã¥ãŒã ã³ã³ãããŒã«ãé©çšããŠãé³éã調æŽããæçµçãªãµãŠã³ããã¹ããŒã«ãŒã«éä¿¡ããŸã;
ã·ã³ã»ãé çªã«å®è¡ããªããããŒãããªãŒã確èªããŸãã [ããŒãããªãŒ]ãŠã£ã³ããŠã®ã·ã³ã»ããŒãã¯ãäžããäžã«å®è¡ãããŸããããã©ã«ãã§ã¯ãææ°ã®ã·ã³ã»ããããã«è¿œå ãããŸããå³9ã§ã¯ãããã€ãºããäžãããã£ã«ã¿ãŒãã2çªç®ããmasterOutããæåŸã«ãªã£ãŠããŸãããããæ£ããé åºã§ããäžããäžã«é ã«èªã¿ãã¿ããã€ãºãœãŒã¹ã¯ãã£ã«ã¿ãŒã«æµã蟌ã¿ããã£ã«ã¿ãŒã®çµæã¯ãã¹ã¿ãŒãã¹ã«æµã蟌ã¿ãŸãã
Figure 9: Synth nodes in the Node Tree window
ãµã³ãã«ãããäžåºŠå®è¡ããŠãè¡ mãfãããã³ n ãéã®é åºã§è©äŸ¡ããããšãããšãä¿¡å·ãééã£ãé åºã§èšç®ããããããäœãèãããŸããã
æ£ããé åºã§æ£ããè¡ãè©äŸ¡ããããšã¯åé¡ãããŸããããã³ãŒããè€éã«ãªããšã泚æãå¿ èŠã«ãªãå ŽåããããŸãããã® job ãç°¡åã«ããããã«ãSuperCollider ã§ã¯ãããŒãããªãŒã®ã·ã³ã»ãé 眮ããå Žæãæ瀺çã«å®çŸ©ã§ããŸãããã®ããã«ãtarget åŒæ°ãš addAction åŒæ°ã䜿çšããŸãã
n = Synth("noise", addAction: 'addToHead');
m = Synth("masterOut", addAction: 'addToTail');
f = Synth("filter", target: n, addAction: 'addAfter');
ããã§ãäžèšã®è¡ãã©ã®é åºã§å®è¡ããŠããããŒããæ£ããå Žæã«ç¢ºå®ã«åãŸãããã«ãªããŸããããã€ãºãã·ã³ã»ã¯ãããŒãããªãŒã®å é ã«è¿œå ããããã«æ瀺çã«æ瀺ãããŸãããmasterOutããããŒã«ã«è¿œå ãããŸã; ãã£ã«ã¿ã¯ã¿ãŒã²ãã n ã®çŽåŸã«æ瀺çã«è¿œå ãããŸãïŒ103ãã€ãºã·ã³ã»ïŒã
ããããã®ã·ã³ã»ãµã€ã¶ãŒã䜿ãå§ãããããã®ãã¡ã®ããã€ãã¯ãœãŒã¹ãµãŠã³ãçšããã®ä»ã¯ãšãã§ã¯ãçšããŸãã¯å¿ èŠãªãã®ã¯äœã§ããããããã°ã«ãŒãã«ãŸãšããããšããå§ãããŸãããããåºæ¬çãªäŸã§ã:
// NodeTree ã®ãã¹ãŠãç£èŠãç¶ãã
s.plotTree;
// busãã€ãããŸã
~reverbBus = Bus.audio(s, 2);
~masterBus = Bus.audio(s, 2);
// groups ãå®çŸ©
(
~sources = Group.new;
~effects = Group.new(~sources, \addAfter);
~master = Group.new(~effects, \addAfter);
)
// ãã£ããã«ãã¹ãŠã®ã·ã³ã»ãå®è¡
(
// One source sound
{
Out.ar(~reverbBus, SinOsc.ar([800, 890])*LFPulse.ar(2)*0.1)
}.play(target: ~sources);
// Another source sound
{
Out.ar(~reverbBus, WhiteNoise.ar(LFPulse.ar(2, 1/2, width: 0.05)*0.1))
}.play(target: ~sources);
// reverb ã§ã
{
Out.ar(~masterBus, FreeVerb.ar(In.ar(~reverbBus, 2), mix: 0.5, room: 0.9))
}.play(target: ~effects);
// ããŠã¹ã䜿ã£ãæããªãã¹ã¿ãŒããªã¥ãŒã ã³ã³ãããŒã«
{Out.ar(0, In.ar(~masterBus, 2) * MouseY.kr(0, 1))}.play(target: ~master);
)
å®è¡é åºã®è©³çŽ°ã«ã€ããŠã¯ããã«ããã¡ã€ã«ãSynthãããOrder of Executionããããã³ãGroupããåç §ããŠãã ããã
ãããŸã§ã«ãã®ãã¥ãŒããªã¢ã«ã®ãã¹ãŠãèªãã§ç解ããŠããã°ãããªãã¯ãã¯ã SuperCollider ã®åå¿è ã§ã¯ãããŸããïŒ ç§ãã¡ã¯å€ãã®åéãã«ããŒããŸãããããããã¯ãå人ãããžã§ã¯ãã®éçºãéå§ããç¬åã§åŠç¿ãç¶ããããã«å¿ èŠãªãã¹ãŠã®åºæ¬çãªããŒã«ãæã«å ¥ããŸããã以äžã®ã»ã¯ã·ã§ã³ã§ã¯ãããã€ãã®äžè¬çãªäžçŽã¬ãã«ã®ãããã¯ã«ã€ããŠç°¡åã«çŽ¹ä»ããŸããæåŸã®ã»ã¯ã·ã§ã³ã§ã¯ãä»ã®ãã¥ãŒããªã¢ã«ãšåŠç¿ãªãœãŒã¹ã®ç°¡æœãªãªã¹ãã瀺ããŸãã
MIDIã®æ¡åŒµãã¬ãŒã³ããŒã·ã§ã³ã³ã³ã»ãããæã¯ããã®ãã¥ãŒããªã¢ã«ã®ç¯å²å€ã§ãã以äžã®äŸã¯ãMIDIããã€ã¹ã«ããçšåºŠç²ŸéããŠããããšãåæãšããŠãã¹ã¿ãŒãããããã«æäŸãããŠããŸãã
// å©çšå¯èœãªãã¹ãŠã®ããã€ã¹ãSCã«æ¥ç¶ããç°¡åãªæ¹æ³
MIDIIn.connectAll;
// ãã¹ãŠã®åä¿¡MIDIã¡ãã»ãŒãžããã°ãã衚瀺ããæ¹æ³
MIDIFunc.trace(true);
MIDIFunc.trace(false); // stop it
// ãã¹ãŠã®CCå
¥åããã°ããæ€æ»ããæ¹æ³
MIDIdef.cc(\someCC, {arg a, b; [a, b].postln});
// CC 7ããã£ã³ãã«0ããã®ã¿å
¥åãååŸ
MIDIdef.cc(\someSpecificControl, {arg a, b; [a, b].postln}, ccNum: 7, chan: 0);
// ç°¡åãªãã¹ãã®ããã® SynthDef
SynthDef("quick", {arg freq, amp; Out.ar(0, SinOsc.ar(freq) * Env.perc(level: amp).
kr(2))}).add;
// ããŒããŒããŸãã¯ãã©ã ãããããåçãã
(
MIDIdef.noteOn(\someKeyboard, { arg vel, note;
Synth("quick", [\freq, note.midicps, \amp, vel.linlin(0, 127, 0, 1)]);
});
)
// ãã¿ãŒã³ãäœæããããŒããŒãããåçããŸã
(
a = Pbind(
\instrument, "quick",
\degree, Pwhite(0, 10, 5),
\amp, Pwhite(0.05, 0.2),
\dur, 0.1
);
)
// test
a.play;
// pad ã keyboard 㧠Trigger pattern
MIDIdef.noteOn(\quneo, {arg vel, note; a.play});
ãããã質åã¯ãæç¶ããŒãã®ããŒããªã³ããã³ããŒããªãã¡ãã»ãŒãžã®ç®¡çæ¹æ³ã§ããã€ãŸããADSRãšã³ãããŒãã䜿çšããå ŽåãããŒãæŒãããŠããéããåããŒããæç¶ãããå¿ èŠããããŸãããªãªãŒã¹ã¯ãæã察å¿ããããŒããå€ããå Žåã«ã®ã¿è¡ãããŸãïŒå¿ èŠã«å¿ããŠãADSRãšã³ãããŒãã®ã»ã¯ã·ã§ã³ãã¬ãŽã¥ãŒïŒã
ãã®ããã«ã¯ãSuperCollider ã¯åã«åããŒã«å¯Ÿå¿ããã·ã³ã»ããŒãã远跡ããå¿ èŠããããŸãã次ã®äŸã«ç€ºãããã«ããã®ããã«é åã䜿çšã§ããŸãã
// A SynthDef with ADSR envelope
SynthDef("quick2", {arg freq = 440, amp = 0.1, gate = 1;
var snd, env;
env = Env.adsr(0.01, 0.1, 0.3, 2, amp).kr(2, gate);
snd = Saw.ar([freq, freq*1.5], env);
Out.ar(0, snd)
}).add;
// MIDI keyboardãã§ãã¬ã€ãã
(
var noteArray = Array.newClear(128); // é
åã«ã¯MIDIããŒãããšã«1ã€ã®ã¹ãããããããŸã
MIDIdef.noteOn(\myKeyDown, {arg vel, note;
noteArray[note] = Synth("quick2", [\freq, note.midicps, \amp, vel.linlin(0,127, 0, 1)]);
["NOTE ON", note].postln;
});
MIDIdef.noteOff(\myKeyUp, {arg vel, note;
noteArray[note].set(\gate, 0);
["NOTE OFF", note].postln;
});
)
// PS. SC MIDIæ¥ç¶ãè¡ãããŠããããšã確èªããŠãã ãã(MIDIIn.connectAll)
äžèšã®ã³ãŒããç解ããããã«ïŒ
-
SynthDef "quick2"ã¯ADSRãšã³ãããŒãã䜿çšããŸããgate åŒæ°ã¯ãããŒãããªã³ãŸãã¯ãªãã«ãã圹å²ãæãããŸãã
-
ãnoteArrayããšåŒã°ããé åãäœæãããåçãããŠããããŒãã远跡ããŸããé åã®ã€ã³ããã¯ã¹ã¯ãåçäžã®MIDIããŒãçªå·ã«å¯Ÿå¿ããããšãæå³ããŠããŸãã
-
ããŒããŒãã§ããŒãæŒããããã³ã«ãã·ã³ã»ã®åçãéå§ããïŒã·ã³ã»ããŒãããµãŒããŒã«äœæãããŸãïŒããã®ã·ã³ã»ããŒããžã®åç §ã¯é åã®äžæã®ã¹ãããã«ä¿åãããŸããé åã€ã³ããã¯ã¹ã¯ãåã«MIDIããŒãçªå·ãã®ãã®ã§ãã
-
ããŒããªãªãŒã¹ããããã³ã«ãã¡ãã»ãŒãž .set(\gate,0) ãé©åãªã·ã³ã»ããŒãã«éä¿¡ãããããŒãçªå·ã«ãã£ãŠé åããååŸãããŸãã
ãã®çãMIDIãã¢ã§ã¯ãSuperCollider ãžã®MIDIã®å°å ¥ã«ã€ããŠã®ã¿èª¬æããŸãããSuperColliderããMIDIã¡ãã»ãŒãžãååŸããã«ã¯ãMIDIOut ãã«ããã¡ã€ã«ãã芧ãã ããã
OSCïŒOpen Sound ControlïŒã¯ããããã¯ãŒã¯ãä»ããŠç°ãªãã¢ããªã±ãŒã·ã§ã³éãŸãã¯ç°ãªãã³ã³ãã¥ãŒã¿ãŒéã§ããããçš®é¡ã®ã¡ãã»ãŒãžãéä¿¡ããããã®åªããæ¹æ³ã§ããå€ãã®å ŽåãMIDIã¡ãã»ãŒãžãããã¯ããã«æè»ãªä»£æ¿æ段ã§ããããã§è©³çŽ°ã«èª¬æããã¹ããŒã¹ã¯ãããŸãããã次ã®äŸãåºçºç¹ãšããŠé©åã§ãã
ãã¢ã®ç®æšã¯ãOSCã¡ãã»ãŒãžãã¹ããŒããã©ã³ããã³ã³ãã¥ãŒã¿ãŒããŸãã¯ã³ã³ãã¥ãŒã¿ãŒããã³ã³ãã¥ãŒã¿ãŒã«éä¿¡ããããšã§ãã åä¿¡åŽã³ã³ãã¥ãŒã¿ãŒã§ã次ã®ç°¡åãªã³ãŒãã¹ãããããè©äŸ¡ããŸã:
(
OSCdef(
key: \whatever,
func: {arg ...args; args.postln},
path: '/stuff')
)
æ³šïŒ [ctrl+.] ãæŒããš OSCdef ãäžæããããã以äžã¡ãã»ãŒãžãåä¿¡ããªããªããŸãã
ããã¯ãäž¡æ¹ã®ã³ã³ãã¥ãŒã¿ãŒã SuperCollider ãå®è¡ãããããã¯ãŒã¯ã«æ¥ç¶ãããŠããããšãåæãšããŠããŸããåä¿¡åŽã³ã³ãã¥ãŒã¿ãŒã®IPã¢ãã¬ã¹ãèŠã€ããéä¿¡åŽã³ã³ãã¥ãŒã¿ãŒã§æ¬¡ã®è¡ãè©äŸ¡ããŸã:
// ã¡ãã»ãŒãžãéä¿¡ãããã·ã³ã§ããã䜿çšããŸã
~destination = NetAddr("127.0.0.1", 57120); // å®å
ã®æ£ããIPã¢ãã¬ã¹ã䜿çšãã
computer
~destination.sendMsg("/stuff", "heelloooo");
- ç¡æã®OSCã¢ããªãé»è©±ã«ã€ã³ã¹ããŒã«ããŸãïŒããšãã°ãgyrosc ïŒã
- åä¿¡åŽã³ã³ãã¥ãŒã¿ãŒã®IPã¢ãã¬ã¹ãOSCã¢ããªã«ïŒãtargetããšããŠïŒå ¥åããŸãã
- SuperCollider ã®åä¿¡ããŒãã OSC ã¢ããªã«å ¥åããŸãïŒéåžž57120ïŒã
- ã¢ããªã OSC ã®éä¿¡ã«äœ¿çšããæ£ç¢ºãªã¡ãã»ãŒãžãã¹ã確èªããããã«å¿ã㊠OSCdef ãå€æŽããŸãã
- é»è©±æ©ããããã¯ãŒã¯ã«æ¥ç¶ãããŠããããšã確èªããŠãã ããã é»è©±æ©ãé©åãªãã¹ã«ã¡ãã»ãŒãžãéä¿¡ããŠããéããã¡ãã»ãŒãžãã³ã³ãã¥ãŒã¿ãŒã«å±ãã®ã確èªã§ããŸãã
ä»ã®ãŠãŒã¶ãŒãäœæããã¯ã©ã¹ãš UGen ãè¿œå ããããšã«ãããSuperCollider ã®æ©èœãæ¡åŒµã§ããŸããQuark 㯠SuperCollider ã¯ã©ã¹ã®ããã±ãŒãžã§ãããSuperCollider èšèªã§ã§ããããšãæ¡åŒµããŠããŸããUGen ãã©ã°ã€ã³ã¯ãSuperCollider ãªãŒãã£ãªåæãµãŒããŒã®æ¡åŒµæ©èœã§ãã
SuperColliderã€ã³ã¹ããŒã«ã«ãã©ã°ã€ã³ãš Quark ãè¿œå ããæ¹æ³ã®ãç¥ãã«ã¯ãhttpïŒ//supercollider.sourceforge.net/ ã«ã¢ã¯ã»ã¹ããŠãã ããããUsing Quarksããã«ããã¡ã€ã«ãåºçºç¹ãšããŠé©åã§ããhttp://doc.sccode.org/Guides/UsingQuarks.html
SuperCollider ããã¥ã¡ã³ããããQuarks.gui ãè©äŸ¡ããŠã䜿çšå¯èœãªãã¹ãŠã®ã¯ã©ãŒã¯ã®ãªã¹ãã衚瀺ã§ããŸãïŒæ°ãããŠã£ã³ããŠã§éããŸãïŒã
ããã§ãSuperCollider ã®çŽ¹ä»ã¯çµããã§ããããã€ãã®è¿œå åŠç¿ãªãœãŒã¹ã以äžã«ãªã¹ãããŸããEnjoy!
-
Eli Fieldsteel ã«ããåªããYouTubeãã¥ãŒããªã¢ã«ã·ãªãŒãºãhttp://www.youtube.com/playlist?list=PLPYzvS8A_rTaNDweXe6PX4CXSGq4iEWYC.
-
Scott Wilson ãš James Harkins ã«ããæšæºã®SCéå§ãã¥ãŒããªã¢ã«ã¯ããªã³ã©ã€ã³ããã³çµã¿èŸŒã¿ã®ãã«ããã¡ã€ã«ã§å©çšã§ããŸããhttp://doc.sccode.org/Tutorials/Getting-Started/00-Getting-Started-With-SC.html
-
Nick Collins ã®ãªã³ã©ã€ã³ãã¥ãŒããªã¢ã«: http://composerprogrammer.com/teaching/supercollider/ sctutorial/tutorial.html
-
å ¬åŒã® SuperCollider ã¡ãŒãªã³ã°ãªã¹ãã¯ãå€æ°ã®ãŠãŒã¶ãŒããå奜çãªå©ããåŸãããã®æè¯ã®æ¹æ³ã§ããåå¿è ã®æ¹ã¯ãã®ãªã¹ãã®è³ªåãæè¿ããŸãããã¡ããããµã€ã³ã¢ããã§ããŸããhttp://www.birmingham.ac.uk/facilities/BEAST/research/supercollider/mailinglist.aspx
-
ããªãã®è¡ã§ SuperCollider ããŒãã¢ããã°ã«ãŒããèŠã€ããŠãã ãããå ¬åŒã® sc-usersïŒã¹ãŒããŒã³ã©ã€ããŒãŠãŒã¶ãŒãºïŒã¡ãŒãªã³ã°ãªã¹ãã¯ãããªããäœãã§ããå Žæããããã©ãããç¥ãæè¯ã®æ¹æ³ã§ãããäœãŸãã®å°åã«ããŒãã¢ããã°ã«ãŒãããªãå Žåã¯ãã°ã«ãŒããå§ããŠãã ããïŒ
-
ããããã®èå³æ·±ãã³ãŒãã¹ãããããããã«ãããŸãã
http://sccode.org/ ã¢ã«ãŠã³ãã«ãµã€ã³ã¢ããããŠãã³ãŒããå ±æããŠãã ããã
-
SuperCollider ã®ãã€ãŒããèããããšããããŸããïŒ http://supercollider.github.io/community/sc140.html
-
æåã®è³ªåïŒ2çªç®ã® Pseq ã®ç¹°ãè¿ãåŒæ°ãšã㊠inf ã®ä»£ããã«æ°å€1ã䜿çšãããšãPbind ã¯6ã€ã®ããŒããæŒå¥ãããåŸïŒã€ãŸãããã¥ã¬ãŒã·ã§ã³å€ã®å®å šãªã·ãŒã±ã³ã¹ãå®è¡ãããåŸïŒã«åæ¢ããŸãã2çªç®ã®è³ªåïŒPbind ãæ°žé ã«ãã¬ã€ããã«ã¯ããã¹ãŠã®å éšãã¿ãŒã³ã®ç¹°ãè¿ãå€ãšã㊠inf ã䜿çšããŸãã
-
â aïŒPwhite(0, 10) ã¯ã0ãã10ãŸã§ã®ä»»æã®æ°ãçæããŸããPrand([0, 4, 1, 5, 9, 10, 2, 3], inf) ã¯ãããã€ãã®æ°ãæã€ãªã¹ãããã®ã¿éžæããŸã 0ãã10ã®éã§ããããã¹ãŠã§ã¯ãããŸããïŒ6ã7ã8ãååšããªãããããã®Prandã«ã¯çºçããŸããïŒã
â bïŒæè¡çã«ã¯ã0ãã100ãŸã§ã®ãã¹ãŠã®æ°åã®ãªã¹ããæäŸããå ŽåãPrand ã䜿çšã§ããŸããããã®ã¿ã¹ã¯ã« Pwhite ã䜿çšããæ¹ãåççã§ãïŒPwhite(0, 100)ã
â cïŒPrand([0, 1, 2, 3], inf) ã¯ããªã¹ãããã¢ã€ãã ãã©ã³ãã ã«éžæããŸããPwhite(0, 3) ã¯ãç°ãªãæ¹æ³ã§åãçš®é¡ã®åºåã«å°éããŸãã0ã3ã®æŽæ°ã®ä¹±æ°ãçæããŸããããã¯ãäžã® Prand ãšåããªãã·ã§ã³ã®ããŒã«ã«ãªããŸãããã ããPwhite(0, 3.0) ãèšè¿°ãããšãåºåãç°ãªããŸãã Pwhiteã®å ¥ååŒæ°ã®1ã€ã¯float(3.0)ãšããŠæžã蟌ãŸããããã0.154ã1.0ã1.45ã2.999ãªã©ã1ã3ã®æµ®åå°æ°ç¹æ°ãåºåããããã«ãªããŸããã
â dïŒæåã® Pbind ã¯32é³ïŒ8é³ã®ã·ãŒã±ã³ã¹ã®4åïŒãæŒå¥ããŸãã2çªç®ã® Pbind ã¯4ã€ã®ããŒãã®ã¿ãåçããŸãïŒãªã¹ãããéžæããã4ã€ã®ã©ã³ãã ãªéžæè¢ïŒ Pseq ãšã¯ç°ãªããPrand ã¯ãªã¹ããããã¹ãŠã®ããŒããåçãã矩åãè² ããªãããšãæãåºããŠãã ããã3çªç®ãšæåŸã® Pbind ã¯ãæåãšåæ§ã«32é³ãæŒå¥ããŸãã
-
æåã®è¡ïŒé å [1, 2, 3, "wow"] ã¯åä¿¡ãªããžã§ã¯ãã§ããã¡ãã»ãŒãžã¯éã§ãã2è¡ç®ïŒæååãhelloãã¯åä¿¡ãªããžã§ã¯ãã§ããdup ã¯ã¡ãã»ãŒãžã§ãã4㯠dup ã®åŒæ°ã§ãã3è¡ç®ïŒ3.1415ã¯åä¿¡ãªããžã§ã¯ãã§ããround ã¯ã¡ãã»ãŒãžã§ãã0.1ã¯äžžãã®åŒæ°ã§ãã4è¡ç®ïŒ100ã¯ã¬ã·ãŒããªããžã§ã¯ãã§ãã randã¯ã¡ãã»ãŒãžã§ããæçµè¡ïŒ100.0ã¯ã¡ãã»ãŒãžrandã®åä¿¡è ã§ããããã®çµæã¯0ãã100ã®éã®ä¹±æ°ã§ãããã®æ°å€ã¯åŒæ°0.01ã§ã¡ãã»ãŒãž round ã®åä¿¡è ã«ãªããããä¹±æ°ã¯2ã€ã®10é²æ°ã®å Žåã«äžžããããŸãã次ã«ããã®çµæãã¡ãã»ãŒãžã®åä¿¡ãªããžã§ã¯ãã«ãªããŸã åŒæ°4ã® dup ã¯ããã®çªå·ã®4ã€ã®éè€ãæã€ãªã¹ããäœæããŸãã
-
é¢æ°è¡šèšã®ã¿ã䜿çšããæžãæãïŒ
dup(round(rand(100.0)ã0.01),4);
-
ããã: a) 24 b) [5; 5:123] [æ°åãšæ¬åŒ§ã®äž¡æ¹) c) LFSaw ã©ã€ã³å šäœ d) Only one e) 0.4 f) 1 ãš 0.3
-
SinOsc ã¯ã-1ã+1ã®æ°å€ãåºåããããããã€ããŒã©ã§ããLFPulse ã¯åºåç¯å²ã0-1ã§ããããããŠãããŒã©ã§ãïŒå®éãLFPulse ã¯ç¹ã«0ãŸãã¯1ã®ã¿ãåºåãããã®éã«ã¯äœããããŸããïŒ
-
ãœãªã¥ãŒã·ã§ã³:
a = {Out.ar(0, SinOsc.ar(freq: [800, 880], mul: LFPulse.ar([2, 3])))}.play;
-
â (a) å€æ° lfn ã¯ãåã« LFNoise2 ãä¿æããŸããLFNoise2 ã®åœ¹å²ã¯ãæ¯ç§ïŒ-1ãã+1ãŸã§ïŒæ°ããä¹±æ°ãçæããåã®ä¹±æ°ããã¹ã©ã€ããããŠïŒããã«æ°ããçªå·ã«ãžã£ã³ããã LFNoise0 ãšã¯ç°ãªããŸãïŒããããšã§ãããã®å€æ° lfn ã®æåã®äœ¿çšã¯ãBPFã® freq åŒæ°ã«ãããŸãïŒlfn.range(500, 2500) ãããã¯ã-1ãã+1ãŸã§ã®æ°å€ãåãããããã500ã2500ã®ç¯å²ã«ã¹ã±ãŒãªã³ã°ããŸãããããã®æ°å€ã¯ããã£ã«ã¿ãŒã®äžå¿åšæ³¢æ°ãšããŠäœ¿çšãããŸãããããã®åšæ³¢æ°ã¯ãäžäžã«ã¹ã©ã€ãããé³ã§ããæåŸã«ãå床 lfn ã䜿çšããŠãpanner Pan2 ã®äœçœ®ãå¶åŸ¡ããŸããæ°å€ã¯æ¢ã«å¿ èŠãªç¯å²ïŒ-1ã+1ïŒã«ãããããïŒ .range ã¡ãã»ãŒãžãªãã§ïŒçŽæ¥äœ¿çšãããŸããããã®è¯ãçµæã¯ãåšæ³¢æ°ã®å€åãäœçœ®ã®å€åãšçµã³ã€ããããšã§ããã©ããã£ãŠïŒ LFNoise2 ã¯1ç§ããšã«æ°ããä¹±æ°ã«åãã£ãŠã¹ã©ã€ããå§ããããããã£ã«ã¿ãŒã®åšæ³¢æ°ãšãã³äœçœ®ã®åæããå€åã«ãªããŸããåå Žæã«2ã€ã®ç°ãªã LFNoise2 ãããå Žåãå€æŽã¯ç¡çžé¢ã«ãªããŸãïŒãããåé¡ãªããããããŸããããç°ãªãèŽèŠã®çµæã§ãïŒã
â (b) mul: of 1ã¯ãããŸãã«ããœãããããŸãããã£ã«ã¿ãŒã¯éåžžã«ã·ã£ãŒãã§ãããããå ã®ä¿¡å·ããéåžžã«å€ããåãå»ããæ¯å¹ ãå€§å¹ ã«äœäžããŸããä¿¡å·ãé©åºŠã«èãããç¯å²ã«æ»ãå¿ èŠããããããBPFã©ã€ã³ã®æåŸã« mul: 20 ããããŸãã
â (c) ãªãºã ã¯ãsawã®mul: åŒæ°ã§ãã LFPulse ã«ãã£ãŠé§åãããŸããLFPulse åšæ³¢æ°ïŒ1ç§ãããã®ãã«ã¹æ°ïŒã¯ã1ã10ã®æ°å€ãçæãã LFNoise1 ã«ãã£ãŠã³ã³ãããŒã«ãããŸãïŒãããã®éãè£éããŸãïŒããããã®æ°å€ã¯ããã®ãããã®ã1ç§ãããã®ããŒãæ°ãã§ãã