Minim BeatDetect
in
Core Library Questions
•
1 year ago
Hello!
I’m working on a sound visualisation programme and I’m having a few problems getting to work it nicely.
I started using the BeatDetect class in the frequency energy mode because I thought it would be neat to use isKick(), isSnare(), isHat() to draw my shapes. As you can see at the bottom I more or less copied the code from the library example.
Since I’m using the programme for electronic music I figured out that the beats/kicks are most important to display the music, but I’m not really satisfied with how it works.
Consequently I tried to use isOnset() and isRange() but honestly I have now idea how many frequency bands are there and what they stand for. The problem is that I’m coming from a visual background and hardly know what buffer size and sampling rate means.
All I want to do is to capture the song’s beat in the most accurate way, kind of like tapping your feet to a song.
I would be very thankful for any kind of help!
import ddf.minim.*;
import ddf.minim.analysis.*;
Minim minim;
AudioInput song;
BeatDetect beat;
BeatListener bl;
int i=0;
...
minim = new Minim(this);
song = minim.getLineIn(Minim.STEREO, 512);
beat = new BeatDetect(song.bufferSize(), song.sampleRate());
beat.setSensitivity(10);
bl = new BeatListener(beat, song);
...
if ( beat.isKick() ) { etc.
I’m working on a sound visualisation programme and I’m having a few problems getting to work it nicely.
I started using the BeatDetect class in the frequency energy mode because I thought it would be neat to use isKick(), isSnare(), isHat() to draw my shapes. As you can see at the bottom I more or less copied the code from the library example.
Since I’m using the programme for electronic music I figured out that the beats/kicks are most important to display the music, but I’m not really satisfied with how it works.
Consequently I tried to use isOnset() and isRange() but honestly I have now idea how many frequency bands are there and what they stand for. The problem is that I’m coming from a visual background and hardly know what buffer size and sampling rate means.
All I want to do is to capture the song’s beat in the most accurate way, kind of like tapping your feet to a song.
I would be very thankful for any kind of help!
import ddf.minim.*;
import ddf.minim.analysis.*;
Minim minim;
AudioInput song;
BeatDetect beat;
BeatListener bl;
int i=0;
...
minim = new Minim(this);
song = minim.getLineIn(Minim.STEREO, 512);
beat = new BeatDetect(song.bufferSize(), song.sampleRate());
beat.setSensitivity(10);
bl = new BeatListener(beat, song);
...
if ( beat.isKick() ) { etc.
1