LoginSignup
7
8

More than 5 years have passed since last update.

プロセシングで、音楽に合わせてpointを動かす

Last updated at Posted at 2016-08-30

音の波形を円状にして表示します。
音の波形の参考にさせてもらったサイトとpointを円状に作るために参考にさせてもらったサイトが次の2つです。

サウンドの基本(minimライブラリの使用)
http://r-dimension.xsrv.jp/classes_j/minim/

アニメーション(その2) 振動と回転
http://www.cp.cmc.osaka-u.ac.jp/~kikuchi/kougi/simulation2009/processing8.html

import ddf.minim.*;

Minim minim = new Minim(this);
AudioPlayer Player;

int wave = 100;

//cercle
float theta = 100; 
float x, y;
float r;

void setup(){
  size(400,400);
  Player = minim.loadFile("groove.mp3", 512);
  Player.play();

}

void draw(){
  background(255);
  translate(width/2, height/2);

  for(int i= 0; i < Player.left.size()-1; i++){
  //theta += 0.1 ;
  r = Player.left.get(i)*1000;
  x = r*cos(i*10);
  y = r*sin(i*10);
  point(x,y);  
  //line(0,0, x,y);
   }
}

void stop()
{
  Player.close(); 
  minim.stop();
  super.stop();
}
7
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
8