You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there are only two built-in types of analysis available in the Sound library: Amplitude for 'loudness', and FFT for frequency spectrum analysis. You can derive more complex audio features like 'tempo' or 'key/pitch' from amplitude and FFT, but that's actually quite a complex task.
All analysis classes in the Sound library work in the same way: you choose which sound you want to analyse by calling:
analysisObject.input(soundObject);
So the example above analyses the amplitude of the sound coming out of an AudioIn object, i.e. the microphone or line-in. If you want to analyse the amplitude of a file that's being played back instead just use the following lines during setup():
SoundFile file = new SoundFile(this, .....);
file.play();
Amplitude amp = new Amplitude(this);
amp.input(file);
395a5dc added a BeatDetector class which allows you to detect beats, which is not quite the 'tempo' of a track, but as close as you might get in a non-specialized piece of audio software. The other existing Analyzers are now more well-documented and presented in the new website reference, which means the only thing missing from the picture is a built-in pitch/frequency detection class. This should be pretty straightforward to implement by simply wrapping the JSyn PitchDetector class. It might look something like this:
publicclassPitchDetectorextendsAnalyzer {
privatefinalcom.jsyn.unitgen.PitchDetectordetector;
privatefloatminimumConfidence = 0.5;
publicPitchDetector(PAppletparent) {
super(parent);
}
publicPitchDetector(PAppletparent, floatminimumConfidence) {
super(parent);
this.minimumConfidence = minimumConfidence;
}
// return the current frequency of the input signal if the confidence is at least as high// as this detector's minimumConfidence, 0 otherwisefloatanalyze() {
...
}
// return the current frequency of the input signal if the confidence is at least as high// as the given minimumConfidence, 0 otherwisefloatanalyze(floatminimumConfidence) {
...
}
}
changed the title [-]Is it possible to get various information about an audio file such as current tempo, loudness, key/pitch etc?[/-][+]Implement pitch detector class[/+]on Sep 18, 2023
Activity
kevinstadler commentedon Jul 30, 2020
Currently there are only two built-in types of analysis available in the Sound library:
Amplitudefor 'loudness', andFFTfor frequency spectrum analysis. You can derive more complex audio features like 'tempo' or 'key/pitch' from amplitude and FFT, but that's actually quite a complex task.All analysis classes in the Sound library work in the same way: you choose which sound you want to analyse by calling:
So the example above analyses the amplitude of the sound coming out of an
AudioInobject, i.e. the microphone or line-in. If you want to analyse the amplitude of a file that's being played back instead just use the following lines duringsetup():There's not a lot of user traffic over here on Github normally, if you have more questions or need coding help it's probably best to ask them over here at the Processing Discourse board: https://discourse.processing.org/c/processing/processing-libraries/19
Joe23232 commentedon Jul 30, 2020
THanks for your help :)
Joe23232 commentedon Jul 30, 2020
I did ask the community this but they didn't know the answer.
So in regards to tempo, how would I specifically get it if you happen to know?
kevinstadler commentedon Sep 18, 2023
395a5dc added a
BeatDetectorclass which allows you to detect beats, which is not quite the 'tempo' of a track, but as close as you might get in a non-specialized piece of audio software. The other existing Analyzers are now more well-documented and presented in the new website reference, which means the only thing missing from the picture is a built-in pitch/frequency detection class. This should be pretty straightforward to implement by simply wrapping the JSynPitchDetectorclass. It might look something like this:[-]Is it possible to get various information about an audio file such as current tempo, loudness, key/pitch etc?[/-][+]Implement pitch detector class[/+]