ãã®èšäºã¯åå¿è ã察象ãšããŠããŸã-å¿ èŠãªãã®ã¯ãã¹ãŠã¢ã¯ã»ã¹ããããæ¹æ³ã§èª¬æãããŠããŸããããé«åºŠãªãã®ã¯ãã®å®è£ æ¹æ³ã«ç°¡åã«æ £ããããšãã§ããããããã¢ãŒãã€ã³ã¹ã¿ã¬ãŒã·ã§ã³ã®äœæã«äœ¿çšããããåçãªç §æå¶åŸ¡ã«äœ¿çšãããã§ããŸãã ããã°ã©ãã³ã°èšèªãç¥ãããšã¯ãªãã·ã§ã³ã§ãã
ç®æ¬¡
- èŠèŠã¢ãã«
- ã³ã³ããŒãã³ã
- LEDã©ã€ã
- LEDãæäœããããã®ã©ã€ãã©ãª
- MIDIãšãã¥ã¬ãŒã¿ãŒãšã·ãŒã±ã³ãµãŒ
- Arduino Communications-MIDIã³ã³ãããŒã©ãŒ
- MIDIã³ã³ãããŒã©ãŒ
- ãã¬ããããŒã
- ãªãã¬ã¯ã¿ãŒ
- ãœãããŠã§ã¢éš
- ãªãã³ã¢ãã¡ãŒã·ã§ã³ã®äŸ
- çµè«
- ãã¢ãããª
- ãã¡ã€ã«
MIDI Wavyã¯æ¬¡ã®ãã®ã§æ§æãããŸãã
- 4ã€ã®èªå®¶è£œLEDã©ã€ãã
- éä¿¡LED <->ãã€ã¯ãã³ã³ãããŒã©ãŒçšã®ç°ãªãé·ãïŒ50ããã³30 cmïŒã®4ã€ã®3ãã³ã³ãã¯ã¿ã
- ãã€ã¯ãã³ã³ãããŒã©ãŒïŒäŸïŒarduinoïŒã
- ãã¬ããããŒãïŒååã«å°ããïŒ
- ä»»æã®MIDIã³ã³ãããŒã©ãŒ
- ãšãã¥ã¬ãŒã¿ïŒã€ãŸã-Ableton Live + loopBe1ïŒ
§1.èŠèŠã¢ãã«
ããŒãæŒããŠããLEDãç¹ç¯ãããŸã§ã®ãã¹ïŒ
MIDIã³ã³ãããŒã©ãŒ â Ableton LiveïŒwith ASIOïŒ â LoopBe1 â Hairless MIDI <-> Serial Bridge â Arduino â LED Flashlight
MIDIã³ã³ãããŒã©ãŒã®ä»£ããã«ãã·ãŒã±ã³ãµãŒã§ã³ã³ãã¥ãŒã¿ãŒã®ããŒããŒãã䜿çšã§ããŸãã
§2.ã³ã³ããŒãã³ã
§2.1ã LEDã©ã€ã
æäžé»ç¯ã¯ãWS2811ããããåãã5050 LEDã¹ããªãããæäžé»ç¯ããã5åã®ãã€ãªãŒãã§æ§æãããŠããŸãã WS2811ã§ã¯ãåLEDãåå¥ã«å¶åŸ¡ã§ããŸããããã«ãã³ã³ãã³ãµãŒä»ãããŒãã¯å·¥å Žã§æ¢ã«ã¯ãã ä»ããããŠãããåºåã«ã¯3ãã³DIN ã 5V ã GNDããããŸãã ä¿è·ãªããšéæãªã·ãªã³ã³ä¿è·ã±ãŒã¹ä»ãã§è²©å£²ãããŠããŸãã ããã€ã¹ã®èŠæ ããè¯ãããã«ã¯ã3ãã³ã³ãã¯ã¿ã䜿çšããã®ãæé©ã§ãã ãããã¯äœ¿ãããããã·ã¹ãã ããã®LEDã®åãå€ããç°¡çŽ åããŸãã
ïŒããšãã°ãã15 cm JR 3pinãµãŒãçšå»¶é·ã³ãŒããã奜ã¿ã®é·ããéžæããŸãïŒ
§2.2ã LEDãæäœããããã®ã©ã€ãã©ãª
Arduinoã®ã¹ã±ããã§ã¯ã FastLEDã©ã€ãã©ãªãæ¥ç¶ããŸãã ã«ã©ãŒã³ãŒãããã®ä»ã®æçšãªæ å ±ãèŠã€ããããšãã§ããèå³æ·±ãããã¥ã¡ã³ãã«æ £ããããšããå§ãããŸãã
ã¯ãããŠã以äžã«ç€ºããããªãã®ãåŸãŸããã ãã¹ãŠã®ã©ã€ããã¯ãã ä»ãããäœæ¥ã®ããã«ããããããã§ãã¯ããå¿ èŠããããŸãã
LEDãã¹ãã®Arduinoã¹ã±ããã衚瀺ãã
#include "FastLED.h" #define NUM_LEDS 5 // 5 #define DATA_PIN 6 // 6- DIN ( ) // CRGB leds[NUM_LEDS]; void setup() { FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS); // } void loop() { FastLED.showColor(CHSV(190,255,255)); // }
ïŒããã¯éæ³ã®ã³ãã¯ã¿ã®ãªãæäžé»ç¯ã®å€ãããŒãžã§ã³ã§ãArduinoã»ããã®ã¯ã€ã€ãŒãã¯ãã ä»ãããã ãã§ãããæå³ã¯ããããå€ãããŸããïŒ
§2.3ã MIDIãšãã¥ã¬ãŒã¿ãŒãšã·ãŒã±ã³ãµãŒ
ã·ãŒã±ã³ãµãŒïŒAbleton Liveãèš±å¯ããïŒãã«ã©ãŒãã¥ãŒãžãã¯ã«æ¥ç¶ããŠããªã¢ã«ã¿ã€ã ã§æããç»åã®å€åãå¶åŸ¡ããããèšé²ãããå€åãåçãããããå Žåã¯ããšãã¥ã¬ãŒã¿ãŒãå¿ èŠã§ãã 誰ã§ãã§ããŸãããç§ã¯LoopBe1ïŒhttp://www.nerds.de/en/loopbe1.htmlïŒã䜿ããŸãã ã ã·ãŒã±ã³ãµãŒãã€ã³ã¹ããŒã«ãåèµ·åãéããŸãã ã·ãŒã±ã³ãµãŒãã»ããã¢ããããããšã®æ¬è³ªã¯ãã·ãŒã±ã³ãµãŒããã®åºåãä»®æ³MIDIãã£ã³ãã«ã«ããããšã§ããããã«ãããåŸã§ãã®ãã£ã³ãã«ãArduinoã«æ¥ç¶ã§ããŸãã
Ableton Liveã®èšå®ããŸãã¯ãã®ä»ã®èšå®ã«å ¥ããMIDIãšãã¥ã¬ãŒã¿ãžã®MIDI-OUTPUTåºåãèšå®ããŸãã
ã·ãŒã±ã³ãµãŒèšå®ã衚瀺ãã
ã·ãŒã±ã³ãµãŒã§ã¯ã2ã€ã®MIDIãã©ãã¯ãäœæããŸãã æåã«-ã·ã³ã»ãµã€ã¶ãŒãé 眮ããŸãïŒããŒããŒã ãç°¡åã«èšå®ã§ããã®ã§Drum Rackããå§ãããŸããããã«ãããããããã¹ãŠãç°¡åã«ããã²ãŒãã§ããããã«ãªããŸãïŒããã®åŸãMUTEãå®è¡ããŸãïŒãã®ãã©ãã¯ã§çŽæ¥äœæ¥ããå¿ èŠã¯ãããŸããïŒ ã2çªç®ã空ã®ãŸãŸã«ããŠã次ã®èšå®ãè¡ããŸãã
I / Oãã¿ã³ãã¢ã¯ãã£ãã«ãïŒå³ã®ã¹ããã2ïŒã2çªç®ã®ãã©ãã¯èšå®ãèšå®ããŸãïŒã¹ããã1ïŒã
CTRLãã¿ã³ãæŒããªãããäž¡æ¹ã®ãã©ãã¯ãã¢ã¯ãã£ãã«ããŸãïŒå³ã®ãã€ã³ã3ïŒã ã§ãã å³ã®ãã€ã³ã4ã«æ³šæããŠãã ãããããã¯ãŸãã«ç§ã話ããããšã§ãããããã§äœæ¥ãããšäŸ¿å©ã§ãã ããšãã°ãããŒããšãã£ã¿ãŒã䜿çšããŸãã
äžã®å³ã§ã¯ããšãªã¢4ã«ç€ºãããŠããã®ãšåãçš®é¡ã®ããŒããããã次ã®ããã«å®çŸã§ããŸããä»»æã®ãªãŒãã£ãªãã¡ã€ã«ããã©ã ã©ãã¯ã»ã«ã«ãããããïŒkick.wavã䜿çšïŒãå³ã¯ãªãã¯ããŠãååãå€æŽãïŒãŸãã¯CTRL + RïŒã
ããã¯ãµãŠã³ãã«ãŒããšãã¥ã¬ãŒã¿ãŒã§ãããŒãæŒããŠããä¿¡å·åŠççµæãŸã§ã®éã«éåžžã«å°ããªé 延ãåŸãããšãã§ããŸãïŒæ¯èŒã®ããã«ãã·ãŒã±ã³ãµãŒã®åºæ¬èšå®ã§ãããŒãé »ç¹ã«ãã°ããåãæ¿ãããšãããŒãæŒããŠããLEDãåäœãããŸã§ã«é 延ãçºçããŸãïŒ ã
ãããªãã¯ãã¡ã€ã³ã®å ¬åŒWebãµã€ãã§èŠã€ããããšãã§ããŸãã
ã·ãŒã±ã³ãµãŒã§ã¯ã2ã€ã®MIDIãã©ãã¯ãäœæããŸãã æåã«-ã·ã³ã»ãµã€ã¶ãŒãé 眮ããŸãïŒããŒããŒã ãç°¡åã«èšå®ã§ããã®ã§Drum Rackããå§ãããŸããããã«ãããããããã¹ãŠãç°¡åã«ããã²ãŒãã§ããããã«ãªããŸãïŒããã®åŸãMUTEãå®è¡ããŸãïŒãã®ãã©ãã¯ã§çŽæ¥äœæ¥ããå¿ èŠã¯ãããŸããïŒ ã2çªç®ã空ã®ãŸãŸã«ããŠã次ã®èšå®ãè¡ããŸãã
I / Oãã¿ã³ãã¢ã¯ãã£ãã«ãïŒå³ã®ã¹ããã2ïŒã2çªç®ã®ãã©ãã¯èšå®ãèšå®ããŸãïŒã¹ããã1ïŒã
- MIDI FromïŒ 1-Drum RackïŒæåã®ãã©ãã¯ãããä¿¡å·ãåãåããå Žæãæå®ããŸãïŒã
- Pre FX ïŒä»»æã®å€ãå¯èœã§ãããPre FXã䜿çšããŠãæåã®dorkããã®ãšãã§ã¯ãã2çªç®ã®dorkãšåæã«è¡ãããããã«ããŸãããã®ã¿ã¹ã¯ã§ã¯ãã€ã³ã¿ãŒãããã§è©³çŽ°ãèªãæ¹ãè¯ãã§ãïŒ
- ã¢ãã¿ãŒïŒèªå
- MIDI ToïŒ LoopBe Internal MIDIïŒMIDIãšãã¥ã¬ãŒã¿ãŒã®ååãéžæïŒ
- ChïŒ 1.ïŒããã©ã«ãã§ã¯ã1ïŒæåã®ïŒãã£ã³ãã«ã䜿çšãããŸããåèš16ãã£ã³ãã«ãã€ãŸãæ倧16å±€ã®MIDIã¡ãã»ãŒãžïŒæ³šïŒã䜿çšå¯èœã§ããããè€éãªLEDå¶åŸ¡ã·ã¹ãã ãäœæããå Žåãç°ãªããã£ã³ãã«ã䜿çšãããšäŸ¿å©ã§ãïŒã
CTRLãã¿ã³ãæŒããªãããäž¡æ¹ã®ãã©ãã¯ãã¢ã¯ãã£ãã«ããŸãïŒå³ã®ãã€ã³ã3ïŒã ã§ãã å³ã®ãã€ã³ã4ã«æ³šæããŠãã ãããããã¯ãŸãã«ç§ã話ããããšã§ãããããã§äœæ¥ãããšäŸ¿å©ã§ãã ããšãã°ãããŒããšãã£ã¿ãŒã䜿çšããŸãã
äžã®å³ã§ã¯ããšãªã¢4ã«ç€ºãããŠããã®ãšåãçš®é¡ã®ããŒããããã次ã®ããã«å®çŸã§ããŸããä»»æã®ãªãŒãã£ãªãã¡ã€ã«ããã©ã ã©ãã¯ã»ã«ã«ãããããïŒkick.wavã䜿çšïŒãå³ã¯ãªãã¯ããŠãååãå€æŽãïŒãŸãã¯CTRL + RïŒã
ãªãã·ã§ã³ïŒ ASIOãã©ã€ããŒ
ããã¯ãµãŠã³ãã«ãŒããšãã¥ã¬ãŒã¿ãŒã§ãããŒãæŒããŠããä¿¡å·åŠççµæãŸã§ã®éã«éåžžã«å°ããªé 延ãåŸãããšãã§ããŸãïŒæ¯èŒã®ããã«ãã·ãŒã±ã³ãµãŒã®åºæ¬èšå®ã§ãããŒãé »ç¹ã«ãã°ããåãæ¿ãããšãããŒãæŒããŠããLEDãåäœãããŸã§ã«é 延ãçºçããŸãïŒ ã
ãããªãã¯ãã¡ã€ã³ã®å ¬åŒWebãµã€ãã§èŠã€ããããšãã§ããŸãã
MIDIãã©ãã¯ã®äœæ
âã¢ã¬ã³ãžã¡ã³ãã¢ãŒãã«åãæ¿ããŸããããå³ã®ãã€ã³ã2ã®[ãªã]ãªãã·ã§ã³ã¯ãããé«äŸ¡ãªLEDäžã«ãªããã°ãªããŸãããããããªããšãMIDIã¯ãªãããäœæã§ããŸããã ãŸãŒã³ãéžæããŠãæ°ããã¯ãªãããäœæããŸãã
âã¡ã¢ãè¿œå ããŸãã ããšãã°ãäžã®å³ã¯ãLEFT_LONGããŒãäžã®LEDã®ä»£æ¿ã¢ã¯ãã£ãåã瀺ããŠããŸãã ããŒããçµäºãããšããã«ãLEDã¯ããã«ãªãã«ãªããŸãã ããŒããäžæ¹åã«éãã¡ãã€ããŸãã
âããŒãã䌞ã°ããšãã«ãŒããäœæã§ããŸããããã¯ãäœæ¥LEDã亀äºã«å€æŽãããããç®ã§èŠãŠå¿«é©ã§ãã
1åãããã®ããŒãã®å€ãå€æŽããããšã«ããããã©ãã¯ã®é床ãå€æŽã§ããŸãã
é³æ¥œãäœæããå Žåã¯ãå¿ èŠã«å¿ããŠãªãŒãã£ãªãã¡ã€ã«ã«ãªãŒãã£ãªãã©ãã¯ãè¿œå ããŸãïŒäœæ¥é åã«ãã©ãã°ããŠïŒã å ãé³æ¥œãšåæããŠé²ãããã«ãã¯ãŒããµãŠã³ãã¯ãªãããäœæããŸãã 詳现ã
âã¢ã¬ã³ãžã¡ã³ãã¢ãŒãã«åãæ¿ããŸããããå³ã®ãã€ã³ã2ã®[ãªã]ãªãã·ã§ã³ã¯ãããé«äŸ¡ãªLEDäžã«ãªããã°ãªããŸãããããããªããšãMIDIã¯ãªãããäœæã§ããŸããã ãŸãŒã³ãéžæããŠãæ°ããã¯ãªãããäœæããŸãã
âã¡ã¢ãè¿œå ããŸãã ããšãã°ãäžã®å³ã¯ãLEFT_LONGããŒãäžã®LEDã®ä»£æ¿ã¢ã¯ãã£ãåã瀺ããŠããŸãã ããŒããçµäºãããšããã«ãLEDã¯ããã«ãªãã«ãªããŸãã ããŒããäžæ¹åã«éãã¡ãã€ããŸãã
âããŒãã䌞ã°ããšãã«ãŒããäœæã§ããŸããããã¯ãäœæ¥LEDã亀äºã«å€æŽãããããç®ã§èŠãŠå¿«é©ã§ãã
1åãããã®ããŒãã®å€ãå€æŽããããšã«ããããã©ãã¯ã®é床ãå€æŽã§ããŸãã
é³æ¥œãäœæããå Žåã¯ãå¿ èŠã«å¿ããŠãªãŒãã£ãªãã¡ã€ã«ã«ãªãŒãã£ãªãã©ãã¯ãè¿œå ããŸãïŒäœæ¥é åã«ãã©ãã°ããŠïŒã å ãé³æ¥œãšåæããŠé²ãããã«ãã¯ãŒããµãŠã³ãã¯ãªãããäœæããŸãã 詳现ã
Arduino Communications-MIDIã³ã³ãããŒã©ãŒ
hairless-midiserialããã°ã©ã ïŒhttp://projectgus.github.io/hairless-midiserial/ïŒã䜿çšããŠãã·ãªã¢ã«<-> MIDIããªããžãäœæããŸãïŒãšãã¥ã¬ãŒã¿ãŒ/ã³ã³ãããŒã©ãŒããã®å€ã¯ã·ãªã¢ã«ããŒããä»ããŠéä¿¡ãããŸãïŒïŒ
ã芧ã®ãšãããMIDI Inã¯ããªããžãžã®å ¥ãå£ãSerialããŒãã¯ããªããžããarduinoãžã®åºå£ã§ãã ãã®èšå®ã§ã¯ãMIDIããŒããŒããªã©ã®MIDIã³ã³ãããŒã©ãŒãçŽæ¥æ¥ç¶ã§ããŸãããæ£çŽãªãšãããããŒããŒããçŽæ¥æäœããããªãã£ãã®ã§ãç¹å¥ãªãã®ãå¿ èŠãªããã§ãã ã¢ããªã±ãŒã·ã§ã³ã§ã¯ãã§ããã ãæ©ããããåŠçããŸãããMIDI +ã·ãŒã±ã³ãµãŒãä»ããŠã©ã€ããå¶åŸ¡ããæ¹ã䟿å©ã§ãã ãã€ãã¹ã®ç¹-ã·ãŒã±ã³ãµãŒããã°ã©ã ã¯éåžžã«ãã£ãããšããŒãã§ããŸãã
§2.4ã MIDIã³ã³ãããŒã©ãŒ
ãã¥ãŒãžãã¯ã¹ãã¢ã§è³Œå ¥ã§ããããŸãã¯èªåã§çµã¿ç«ãŠãããšãã§ããïŒãã¡ãããã¿ã¹ã¯ã«å¿ããŠïŒã³ã³ãããŒã©ãŒã¯ïŒã€ã³ã¿ãŒãããäžã§ãããè¡ãæ¹æ³ã«ã€ããŠã®æ瀺ããããŸãïŒè¡ããŸãã ãããŠãããªããé»åé³æ¥œãæžããªããããããããªãã¯ãã®ãããªããŒããŒããæã£ãŠããã§ãããã ãã€ã¹ããšããŒèªäœã®äž¡æ¹ã䜿çšã§ããŸãã åããŒïŒæ³šïŒã¯ãç¹å®ã®ã³ãã³ãã®å®è¡ãããã³ã°ããããŸãã ãã®äŸã§ã¯ã3ã€ã®ãã€ã¹ãïŒãã¹ã¿ãŒãã«ã©ãŒããã£ã¬ã€ã§è¡šç€ºïŒãš4ãªã¯ã¿ãŒãã®ããŒãã䜿çšãããŠããŸãã
AbletonãFL Studioãªã©ã§ MIDIã³ã³ãããŒã©ãŒããªããŠãã§ããŸãã ãããã®ããã°ã©ã ã§ã¯ããã¢ãã®ãããªéåžžã®PCããŒããŒãã䜿çšã§ããŸãã
§2.5ã ãã¬ããããŒã
ãããã¿ã€ãããã€ã¹ã®å Žåããã¹ãŠã1ã€ã®å°ããªãã¬ããããŒãã«æ¥ç¶ããã ãã§ååã§ãã å°æ¥çã«ã¯ããã¬ããããŒããããªã³ãåè·¯åºæ¿ã«äº€æããããšã¯é£ãããããŸããïŒå¿ èŠãªãã®ãã¹ãŠãã¯ãã ä»ãããŸã-èœã¡ãŸããïŒã ããã€ã¹ã®ã±ãŒã¹ã¯ããµã€ãºã«å¿ããŠã¢ã«ãã¥ã€ããŸãã¯ç¡ç·æ©åšãã¢ã«ãããŠã ãçŽ300
ç¡ã¯ãã ãã¬ããããŒãSYB-170 10x17ç©Ž60
§3.ãªãã¬ã¯ã¿ãŒ
LEDã®æŸå°æ¹åã¯ãä»»æã®ã¿ã€ãã®ãªãã¬ã¯ã¿ãŒã䜿çšããŠèšå®ã§ããŸãã å¿ èŠã«å¿ããŠãå¯èœãªãªãã¬ã¯ã¿ãŒããã蟌ãããšãã§ããŸãã ç§ã¯å£ã®ããã«ãã©ã¹ããã¯ã®è§ãåããŸãã-ããã¯ãããã§ãçœããããç §ããããŠããŸãã äžæ¹ã®å åŽïŒäžåŽïŒãã¢ã«ãããŠã ããŒãïŒãŸãã¯äœããã®ãã©ãŒïŒã§æ¥çããããäžæ¹ãæ®ããŸãã æŸå°ç·ãæ¥çãããŠããªãåŽã«åããåå°æ¿ã®ã€ãæ¶ãã®èŒããåŸãŠãå¶éããŸãïŒã€ãŸããåå°æ¿ã®é·ããšããŒãã®é·ãã®æ¯çã«å¿ããŠãåå°æ¿ã®ãã¹ãŠãŸãã¯äžéšãç¹ç¯ããŠããããã«èŠããŸãïŒã ç²çããŒãã貌ãå¿ èŠã¯ãããŸããããåå°ä¿æ°ã¯å°ãããªããŸãã éã«ããªãã¬ã¯ã¿ãŒã®ãã¹ãŠã®é åã«è²Œãä»ããããšãã§ããŸãã
æŸå°ã®åœ¢ç¶ã«åœ±é¿ããããŸããŸãªãã¯ã¹ãã£ã®åå°åšããããŸããããããã¯èæ ®ããŸããã
§4.ãœãããŠã§ã¢éšå
Arduinoã®ã¹ã±ãããåæããŸããã
æåã«ãå¿ èŠãªã©ã€ãã©ãªãæ¥ç¶ãããã€ãã¿ã€ãããã¹ãŠã®å€æ°ã«èšå®ããŸãïŒ0ã255ã®ã¹ãã¢ãå€ãå¿ èŠãªã ãã§ãæ®ãã¯äœ¿çšããŸããïŒã
ã³ãŒãã衚瀺ãããŒã1
// MIDI Wavy // JVLNS.ORG 2014 // #include "FastLED.h" // , #define LEFT_LONG 7 #define LEFT_SHORT 6 #define RIGHT_SHORT 5 #define RIGHT_LONG 4 #define NUM_STRIPS 4 // #define NUM_LEDS_PER_STRIP 5 // 1 // CRGB leds[NUM_STRIPS][NUM_LEDS_PER_STRIP]; // , byte colors[] = {0, 32, 64, 96, 128, 160, 192, 224, 239 }; // Master () - byte ColorBasic = 0; byte Master = 255; byte commandByte; // MIDI-, (noteOn, noteOff, Controller) byte noteByte; // ( ) byte velocityByte; // â ( noteOn/Off velocity (https://www.ableton.com/en/manual/editing-midi-notes-and-velocities), Controller â ). byte velocityByte1; // map() 0-127 0-255 byte noteOn = 144; // byte noteOff = 128; // byte faza = 0; // delay(faza)
ã©ã³ãã®æå®ïŒ
ïŒæ³šïŒ0ã1ã2ã3-é åå ã®ã»ã«çªå·ïŒ
ã³ãŒããããŒã2ã ã»ããã¢ããïŒïŒé¢æ°ãèšå®ããŸã ã
void setup() { // Serial- 256000 Serial.begin(256000); FastLED.addLeds<NEOPIXEL, LEFT_LONG>(leds[0], NUM_LEDS_PER_STRIP); FastLED.addLeds<NEOPIXEL, LEFT_SHORT>(leds[1], NUM_LEDS_PER_STRIP); FastLED.addLeds<NEOPIXEL, RIGHT_SHORT>(leds[2], NUM_LEDS_PER_STRIP); FastLED.addLeds<NEOPIXEL, RIGHT_LONG>(leds[3], NUM_LEDS_PER_STRIP); }
LEDã¹ããªãããæå®ãããã®æ¹æ³ã¯ãåã¹ããªãããåæã«ç¬ç«ããŠå¶åŸ¡ããããã«å¿ èŠã§ãã 詳现ã«ã€ããŠã¯ãFastLEDã©ã€ãã©ãªã®ããã¥ã¡ã³ãããŒãžãã芧ãã ãã ã
å®éã8ãããã³ã³ãããŒã©ãŒã¯ãã«ãã¹ã¬ããããµããŒãããŠããªããããã³ãŒãã¯é 次å®è¡ãããŸãã ã³ãŒãã®å±±ã¯å®è¡ãé ãããŸãã LEDãæ¥ç¶ããŠæäœãããã®æ¹æ³ïŒåŸã§æ€èšããŸãïŒã¯ããã®åé¡ã解決ããããã°ã©ã ã®é床ãäœäžããããšã¯ãªãããããã£ãŠãåããŒã¹ãããŒã¯ãèæ ®ãããŸãïŒçµéšããã以åã«å¥ã®æ¹æ³ã§ãã£ããšèšããããŒããæŒãããšã§å€ãã®åŠšå®³ããããŸããé 延ãŸãã¯èšç®ã®æµ ãã«ããïŒã ããã«ãLEDã®ç¹æ§ãå€æŽããããšã¯ããã®æ¹æ³ã§ã¯ããã«äŸ¿å©ã§ãã
ãã€ã¯ãã³ã³ãããŒã©ãŒãã³ã³ãã¥ãŒã¿ãŒãšéä¿¡ããããã®ã·ãªã¢ã«ããŒããèµ·åããŸãã 256000ãæå®ããŸããHairlessBridgeèšå®ã§ã¯ãåãé床ãæå®ããŸãã
ç¹å®ã®èšå®ã§LEDããªã³/ãªãããé¢æ°ãããã€ãäœæããŠã¿ãŸãããã
ã³ãŒãã衚瀺ãããŒã3
// pointer() // num_strip = ( 0 3, [ ]) // num_led = num_strip // master = // color = void pointer(byte num_strip, byte num_led, byte master, byte color) { leds[num_strip][num_led] = CHSV(color, 255, master); FastLED.show(); } // blackout() void blackout(byte num_strip, byte num_led) { leds[num_strip][num_led] = CHSV(0, 0, 0); FastLED.show(); }
MIDIã³ãã³ããæäœããæ©èœãå®çŸ©ããŸãã
ã³ãŒãã衚瀺ãããŒã4
void checkMIDI(){ do{ // 3 if (Serial.available()){ commandByte = Serial.read();//read first byte noteByte = Serial.read();//read next byte velocityByte1 = Serial.read();//read final byte velocityByte = map(velocityByte1, 0, 127, 0, 255); Master = velocityByte; // Master Velocity // if(noteByte == 96) ColorBasic = colors[0]; if(noteByte == 97) ColorBasic = colors[1]; if(noteByte == 98) ColorBasic = colors[2]; if(noteByte == 99) ColorBasic = colors[3]; if(noteByte == 100) ColorBasic = colors[4]; if(noteByte == 101) ColorBasic = colors[5]; if(noteByte == 102) ColorBasic = colors[6]; if(noteByte == 103) ColorBasic = colors[7]; if(noteByte == 104) ColorBasic = colors[8]; // if (commandByte == 176 && noteByte == 22)ColorBasic = velocityByte; // Color if(commandByte == 176 && noteByte == 21) Master = velocityByte; // Master if(commandByte == 176 && noteByte == 23) faza = velocityByte; // Velocity // LEFT_LONG if(noteByte == 36) { //C1 if(commandByte == noteOn) pointer(0, 0, Master, ColorBasic); else if(commandByte == noteOff) blackout(0, 0); } if(noteByte == 38) { if(commandByte == noteOn) pointer(0, 1, Master, ColorBasic); else if(commandByte == noteOff) blackout(0, 1); } if(noteByte == 40) { if(commandByte == noteOn) pointer(0, 2, Master, ColorBasic); else if(commandByte == noteOff) blackout(0, 2); } if(noteByte == 41) { if(commandByte == noteOn) pointer(0, 3, Master, ColorBasic); else if(commandByte == noteOff) blackout(0, 3); } if(noteByte == 43) { if(commandByte == noteOn) pointer(0, 4, Master, ColorBasic); else if(commandByte == noteOff) blackout(0, 4); } // end left_long // LEFT_SHORT if(noteByte == 45) { if(commandByte == noteOn) pointer(1, 0, Master, ColorBasic); else if(commandByte == noteOff) blackout(1, 0); } if(noteByte == 47) { if(commandByte == noteOn) pointer(1, 1, Master, ColorBasic); else if(commandByte == noteOff) blackout(1, 1); } if(noteByte == 48) { if(commandByte == noteOn) pointer(1, 2, Master, ColorBasic); else if(commandByte == noteOff) blackout(1, 2); } if(noteByte == 50) { if(commandByte == noteOn) pointer(1, 3, Master, ColorBasic); else if(commandByte == noteOff) blackout(1, 3); } if(noteByte == 52) { if(commandByte == noteOn) pointer(1, 4, Master, ColorBasic); else if(commandByte == noteOff) blackout(1, 4); } // end left_short // RIGHT_SHORT if(noteByte == 53) { if(commandByte == noteOn) pointer(2, 0, Master, ColorBasic); else if(commandByte == noteOff) blackout(2, 0); } if(noteByte == 55) { if(commandByte == noteOn) pointer(2, 1, Master, ColorBasic); else if(commandByte == noteOff) blackout(2, 1); } if(noteByte == 57) { if(commandByte == noteOn) pointer(2, 2, Master, ColorBasic); else if(commandByte == noteOff) blackout(2, 2); } if(noteByte == 59) { if(commandByte == noteOn) pointer(2, 3, Master, ColorBasic); else if(commandByte == noteOff) blackout(2, 3); } if(noteByte == 60) { if(commandByte == noteOn) pointer(2, 4, Master, ColorBasic); else if(commandByte == noteOff) blackout(2, 4); } // end right_short // RIGHT_LONG if(noteByte == 62) if(commandByte == noteOn) pointer(3, 0, Master, ColorBasic); else if(commandByte == noteOff) blackout(3, 0); } if(noteByte == 64) { if(commandByte == noteOn) pointer(3, 1, Master, ColorBasic); else if(commandByte == noteOff) blackout(3, 1); } if(noteByte == 65) { if(commandByte == noteOn) pointer(3, 2, Master, ColorBasic); else if(commandByte == noteOff) blackout(3, 2); } if(noteByte == 67) { if(commandByte == noteOn) pointer(3, 3, Master, ColorBasic); else if(commandByte == noteOff) blackout(3, 3); } if(noteByte == 69) { if(commandByte == noteOn) pointer(3, 4, Master, ColorBasic); else if(commandByte == noteOff) blackout(3, 4); } // end right_long if(noteByte == 72) { // C4, LEFT_LONG if(commandByte == noteOn) { for(byte i = 0; i < NUM_LEDS_PER_STRIP; i++) pointer(0, i, Master, ColorBasic); } else if(commandByte == noteOff) { // â for(byte i = 0; i < NUM_LEDS_PER_STRIP; i++) blackout(0, i); } } if(noteByte == 74) { // LEFT_SHORT if(commandByte == noteOn) { for(byte i = 0; i < NUM_LEDS_PER_STRIP; i++) pointer(1, i, Master, ColorBasic); } else if(commandByte == noteOff) { for(byte i = 0; i < NUM_LEDS_PER_STRIP; i++) blackout(1, i); } } if(noteByte == 76) { // RIGHT_SHORT if(commandByte == noteOn) { for(byte i = 0; i < NUM_LEDS_PER_STRIP; i++) pointer(2, i, Master, ColorBasic); } else if(commandByte == noteOff) { for(byte i = 0; i < NUM_LEDS_PER_STRIP; i++) blackout(2, i); } } if(noteByte == 77) { // RIGHT_LONG if(commandByte == noteOn) { for(byte i = 0; i < NUM_LEDS_PER_STRIP; i++) pointer(3, i, Master, ColorBasic); } else if(commandByte == noteOff) { for(byte i = 0; i < NUM_LEDS_PER_STRIP; i++) blackout(3, i); } } // , if(noteByte == 37) { for(byte x = 0; x < NUM_STRIPS; x++) { // This inner loop will go over each led in the current strip, one at a time for(byte i = 0; i < NUM_LEDS_PER_STRIP; i++) { leds[x][i] = CRGB::Black; FastLED.show(); } } } // if(noteByte == 73){ if(commandByte == noteOn) { for(byte x = 0; x < NUM_STRIPS; x++) { for(byte i = 0; i < NUM_LEDS_PER_STRIP; i++) { leds[x][i] = CHSV(ColorBasic, 255, 255); FastLED.show(); leds[x][i] = CRGB::Black; delay(faza); // Delay } } } // end Note ON else if(commandByte == noteOff) { for(byte i = 0; i < NUM_LEDS_PER_STRIP; i++) blackout(3, i); } }// end note On // end noteByte 73 // faza , i . if(noteByte == 75 && commandByte == noteOn) { faza = map(faza, 0, 200, 0, 3); for(byte i = 255; i > 0; i--) { FastLED.showColor(CHSV(ColorBasic, 255, i)); delay(faza); } } }// end if }// end do while (Serial.available() > 2);// 3 }
ã³ãŒãã«é¢ããã³ã¡ã³ãïŒãæ°ã¥ãã®ãšãããããŒãæŒããããšç¹å®ã®LEDãç¹ç¯ããåæã«å®çŸ©ãããããã€ãã®ããŒã¯ãããŒãæŸããããŸã§ãããšãã°ããŒãã®1ã€ã«ãã£ãããšå ããŸãã ããã«ããã1ã€ã®LEDããå¥ã®LEDãžã®ã¹ã ãŒãºãªç§»è¡ãäœæããã«ãŒããäœæã§ããŸãã
ããã¯ãããŒã37ããªã»ããããã¹ãŠã®LEDããªãã«ãããã«å²ãåœãŠããããLEDããã³ã°ããŠãªãã«ãªããªãããšããããŸãã
MIDIã³ãã³ãã®å€ã¯ãããïŒhttp://www.midi.org/techspecs/midimessages.phpïŒããååŸãããã hairless-midiserialã§æŒãããããŒãçŽæ¥è¿œè·¡ã§ããŸãã
ïŒå¿ ãããããã§ã¯ãããŸãããïŒå¥ã®æ©èœãè¿œå ã§ããŸã-ãã¹ãŠã®LEDãã«ã©ãŒã§ç°¡åã«èŒžè¡ããŸãã 次ã«ãããã€ã¹ãåžžå€ç¯ãšããŠäœ¿çšã§ããŸãã
void Rainbow(int delay_time) { for(int hue = 0; hue < 255; hue++) { FastLED.showColor(CHSV(hue,255,255)); delay(delay_time); } }
ã³ãŒããããŒã5ãæåŸã®ä»äžããšããŠã loopïŒïŒé¢æ°ãèšå®ããŸã ã
void loop(){ // MIDI checkMIDI(); // . , . - , , . delay(50); }
§5.ããŒãã¢ãã¡ãŒã·ã§ã³ã®äŸ
æ³¢
æŒããã貌ãä»ãããããããŒãããé·ããã»ã©ããŽãŒã¹ãå¹æã«ããç»åããŒãããŸãã
äŸãèããŠã¿ãŸãããã
é³ç¬Šãæ°åè€è£œããæ¯åVelocityé³ç¬Šãç¹å®ã®ã¬ãã«ãããšãã°25ïŒ ãŸã§äžããŸãã ãã®å ŽåãããŒã«ãããæ£ç¢ºã«æå®ã§ããŸãã
§6.çµè«
§6.1ã äŸ¡æ Œã®åé¡
- ãã®ãããªLEDã®1ã€ã¯çŽ17ã«ãŒãã«ã§ããããã®ãã¡20ãå¿
èŠã§ã=> 340R
ã - ArduinoïŒæãå®ããã®ã®1ã€ãéžæïŒ400
R. - ã³ãã¯ã¿4å-ç§ã¯æ£ç¢ºã«èŠããŠããªããçŽ100
PãåºãŠããŸããã - éçºããŒã-60
R. - åèšïŒ908
PïŒArduinoã»ããã®ã¯ã€ã€ãé€ãïŒ
æãé«äŸ¡ãªã®ã¯LEDãšãã€ã¯ãã³ã³ãããŒã©ãŒã§ãã äžè¬çã«ãããªããäž»é¡ã«ããå Žåãarduinoã®èŠ³ç¹ããã¯ãããå®äŸ¡ãªãã®ã䜿çšã§ããŸãã
§6.2ã å¿çšåé
åºæ¬çã«ãããã¯ã€ã³ã¹ã¿ã¬ãŒã·ã§ã³ãã³ã³ãµãŒããæ§é ãªã©ã®ç §æèšèšã§ãã ãã¡ã³ã¿ãžãŒã®å¶éã ããšãã°ãMIDI Wavyã䜿çšããŠãã©ãã¯ãç §æããŸãã LEDã¯ç¹å¥ãªé°å²æ°ãäžããé³æ¥œããã©ã€ãããã®ã«åœ¹ç«ã¡ãŸãããèŠãŠãã ãã-ãŠãããã§äººã殺ããªãã§ãã ããã ç ã§äœ¿çšããããšããå§ãããŸãããããããšãæŸå°ãã¿ãŒã³ã¯ã¯ããã«åŒ·åã§æ¶ŒããèŠããŸãã
ç§ã¯èªè»¢è»ã®ããã¯ã©ã€ãã«MIDIã³ã³ãããŒã©ãŒãªãã§åçŽåãããå¶åŸ¡ãªãã·ã§ã³ã䜿çšããŠããŸãããããã«ã€ããŠã¯åŸã§è©³ãã説æããŸãã
ãã¢ãã匟ãããšãåŠã¶ããã«ãã®ã±ãŒã¹ãã²ãã£ãããåäŸã®ããã°ã©ãã³ã°ãè²ä»ãããããèšæ¶ãæ¹åãããããããšãã§ããŸãïŒãã®ãããªããã¡ãã¯åºé ã§è²©å£²ãããã¯ããã«ã³ã³ãã¯ãã§ãããç°¡åãªæ¹æ³ã¯æ¢ããŠããŸããïŒã
èå³ããæã¡ã®æ¹ã¯ãé 匵ã£ãŠãã ããïŒ å¿ ãããªãã®äœåãžã®ãªã³ã¯ãéã£ãŠãã ããã
§7.ãã¢ãããª
§8.ãªã³ã¯ãšãã¡ã€ã«
- ã¹ã±ããArduinoãããŠã³ããŒã
- Abletonã§ãããžã§ã¯ããããŠã³ããŒããã
- MIDIãã¡ã€ã«ãããŠã³ããŒã
- Midiã¡ãã»ãŒãž
- FastLEDã©ã€ãã©ãª
- ãããWS2811ã®ããŒã¿ã·ãŒã
- Arduinoã§MIDIã³ã³ãããŒã©ãŒãäœæããïŒè±èªïŒ
- MIDIããŒã¿ãArduinoããã³ã³ãã¥ãŒã¿ãŒã«è»¢éãã
- ArduinoãšMIDIã«ã€ããŠã®åœ¹ç«ã€èªæžïŒè±èªã®äŸ¿å©ãªèšäºïŒ
- ãããªã®é³æ¥œ