ãã¥ã¼ãã³ã·ã¼ã±ã³ãµã¼ãä½ã£ã¦ã¿ã
ãããã¯ãã®ã½ããã®æ¸ãæ¹ãã¡ãã£ã¨ã ãåãã£ã¦ããã®ã§ã¾ãä¸åã½ããä½ã£ã¦ã¿ã¾ããã
åããä¸åº¦ä½ã£ã¦ã¿ããã£ã身ä½ã使ã£ã楽å¨ã§ããYAMAHAããã®TENORI-ONã¨ãã楽å¨ã身ä½å
¨ä½ã§ãã£ã¦ãã¾ããã¨ãããã¸ãããªæ¥½å¨ã§ãã
ãã·ã¹ãã ã¯ä¸å³ã®ãããªæãã§ããKinectã§èªèãã人ã®ã·ã«ã¨ãããPC(Processing)ã§å¦çãã¦MIDIãã¼ã¿ã«å¤æãMIDIããã¤ã¹ã«éä¿¡ãã¦é³ãåºåãã¦ãã¾ããMIDIããã¤ã¹ã¯ä½ã§ãããã®ã§ãããããã§ã¯ææã¡ã®microKorg XLã使ã£ã¦ãã¾ããMIDIéä¿¡ãMacã«MIDIãã¼ããªãã¦ãªãã®ã§ãå®éã¯ç©ç層ã¯USBã§æ¥ç¶ããã¦ãã¾ãï¼éä¿¡ã®ãããã³ã«ãMIDIãªã ãï¼ã
ãåç»ãçµæ§ç²ãã楽å¨ã§ããããããªãã®ãã®ãã§ãã¾ãããæ°äººã§éã¶ã¨æ¥½ããããããªãããªã¨æãã¾ããåå è
åéä¸ã
ã¹ã±ã¼ã«ã¯Cãã¤ãã¼ã®ãã³ã¿ãããã¯ã§ããã¡ãã£ã¨å¼ãã°ããããªã¹ã±ã¼ã«ã§éã¹ãã¨æãã¾ãã
é¢é£è¨äº
ãMac+Kinect+Processingで遊んでみるã
ãProcessingで動画をドット絵ムービーに変換するソフトを作ってみましたã
åèãªã³ã¯
ãProcessingの学習ノートã
ããããåããã®ã«ã³ã¼ãåèã«ãã¾ãããæ¬å½ã¯åèªåãä½ã£ããã¤ãã¼ã¹ã«ããã¤ããã ã£ãã®ã§ããããã£ã¡ã®æ¹ãã¨ã¬ã¬ã³ãã ã£ãã®ã§ãããåã®é¨åã¯ã©ã¡ããã¨ããã¨ãã¡ãããã¼ã¹ã§ãã
ãサウンド&モーション&映像をリアルタイムに同期! 2台のKinectを使ったプロジェクション作品「The V Motion Project」 ã
ãKinect2å°ä½¿ã£ãã¨ã¢æ¥½å¨ãä»åã®æ¥½å¨ã¯ããã¤ã«ã¤ã³ã¹ãã¤ã¢ããã¦ãã¾ãããã1å°Kinectè²·ã£ãããããã£ã¦ã¿ãããªã
ã½ã¼ã¹ã³ã¼ãã¨ä½¿ãæ¹
ãã½ã¼ã¹ã³ã¼ãã¯é·ãã®ã§ãè¦ãã人ã ãç¶ããèªãã§ä¸ããããããããããããªãã§ãã
ä»åã¯çããClassã¨ã使ã£ã¦ã¾ããæ¹å¿ãã¾ããã
ã使ãã¨ãã¯Kinectã®ç°å¢æºåã®ä»ã«ãPromidiã¨OpenCVã®ã©ã¤ãã©ãªãå¿
è¦ã§ãã
使ãæ¹ã¯èµ·åããã ããã¹ãã¼ã¹ãã¼æ¼ãã°åç»ãçæããã親åè¨è¨ãã¹ãã¼ããå¤ãããã¨ãã¯ãcount_waitã®æ°åãå¤ãã¦ä¸ããã
import promidi.*; import SimpleOpenNI.*; import hypermedia.video.*; import processing.video.*; MidiIO midiIO; MidiOut midiOut; SimpleOpenNI context; OpenCV opencv; MovieMaker mm; int fps = 30; int d_circle = 15; int cont = 0; int dot_line = 0; int count_wait = 4; int h_max; int w_max; DotSound[] DotSounds; class DotSound{ int x, y, d; int note; color c; DotSound(int x, int y, int note, color c, int d){ this.x = x; this.y = y; this.note = note; this.c = c; this.d = d; } int getX(){ return this.x; } int getY(){ return this.y; } void soundOut(int x){ if(this.x == x){ if (red(c) == green(c) & green(c) == blue(c)){ }else{ midiOut.sendNote(new Note(note, 10, 3)); } } } void setColor(int c){ this.c = c; } void drawCircle(int x){ if(this.x == x){ // invert color if (red(c) == green(c) & green(c) == blue(c)){ fill(255, 255, 255); }else{ fill(255-red(c), 255-green(c), 255-blue(c)); } }else{ fill(c); } ellipse(this.x*d + d/2, this.y*d + d/2, d, d); } void SetPentaScale(){ int tmp = 0 ; // C if(y%5 == 0){ tmp = y/5*12; } // D# if(y%5 == 1){ tmp = y/5*12 + 3; } // F if(y%5 == 2){ tmp = y/5*12 + 5; } // G if(y%5 == 3){ tmp = y/5*12 + 7; } // A# if(y%5 == 4){ tmp = y/5*12 + 10; } tmp += 60; if(tmp > 127){ tmp -= 128; } this.note = tmp; } } void setup(){ InitKinect(); InitMIDI(); size(context.depthWidth() , context.depthHeight()); InitDotSound(); mm = new MovieMaker(this, context.depthWidth(), context.depthHeight(), "DotMusic.mov", fps, MovieMaker.VIDEO, MovieMaker.LOSSLESS); frameRate(fps); } void InitKinect(){ context = new SimpleOpenNI(this); if(context.enableDepth() == false) { println("Can't open the depthMap, maybe the camera is not connected!"); exit(); return; } if(context.enableRGB() == false) { println("Can't open the rgbMap, maybe the camera is not connected or there is no rgbSensor!"); exit(); return; } context.enableScene(); // matching depth map with rgb map context.alternativeViewPointDepthToImage(); } void InitMIDI(){ midiIO = MidiIO.getInstance(); midiIO.printDevices(); midiOut = midiIO.getMidiOut(0,1); } void InitDotSound(){ h_max = height / d_circle; w_max = width / d_circle; DotSounds = new DotSound[w_max * h_max]; for(int y = 0; y < h_max; y += 1) { for(int x = 0; x < w_max; x += 1) { DotSounds[x + y*w_max] = new DotSound(x, y, 0, 0, d_circle); DotSounds[x + y*w_max].SetPentaScale(); } } } void draw(){ context.update(); // PImage TargetImg = context.rgbImage(); PImage TargetImg = context.sceneImage(); TargetImg.loadPixels(); for(int y = 0; y < h_max; y += 1) { for(int x = 0; x < w_max; x += 1) { DotSounds[x+y*w_max].setColor(TargetImg.pixels[y*width*d_circle + d_circle/2 + x*d_circle+d_circle/2]); DotSounds[x+y*w_max].drawCircle(dot_line); if(cont == 0){ DotSounds[x+y*w_max].soundOut(dot_line); } } } if(cont < count_wait){ cont++; }else{ dot_line++; if(dot_line > w_max){ dot_line = 0; } cont = 0; } mm.addFrame(); } void keyPressed() { if (key == ' ') { mm.finish(); println("save movie."); exit(); } }