import java.util.*; import java.util.zip.*; import java.util.List; import java.util.regex.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; import java.util.concurrent.locks.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.text.*; import javax.swing.table.*; import java.io.*; import java.net.*; import java.lang.reflect.*; import java.lang.ref.*; import java.lang.management.*; import java.security.*; import java.security.spec.*; import java.awt.*; import java.awt.event.*; import java.awt.image.*; import javax.imageio.*; import java.math.*; // Calculate how many percent a frequency changes when a vibrato of a certain "cent" (of a semitone - that's the technical term they use) is applied. // From: https://en.wikipedia.org/wiki/Vibrato // "The extent of vibrato for solo singers is usually less than a semitone (100 cents) either side of the note" // => cent = 100 // "while singers in a choir typically use narrower vibrato with an extent of less than a tenth of a semitone (10 cents) either side" // => cent = 10 // "Wind and bowed instruments generally use vibratos with an extent of less than half a semitone either side." // => cent = 50 class main { static double vibratoCentToFrequencyPercentage(double cent) { return (plusOneSemitone()-1)*cent; } static double plusOneSemitone() { return nthRoot(12, 2); } static double plusOneSemitone(double frequency) { return plusOneSemitone()*frequency; } static double nthRoot(int n, double x) { return Math.pow(x, 1.0/n); } }