Compare commits

...

3 Commits

Author SHA1 Message Date
fde4a597c7 Released 0.2.2 2020-01-10 20:23:43 +00:00
e69ae52f50 Updated example filters 2020-01-10 18:55:46 +00:00
8bdb06749f Improvements to LFO 2020-01-10 18:29:22 +00:00
18 changed files with 125 additions and 43 deletions

View File

@@ -1,7 +1,4 @@
<effect name="Alien">
<biquad type="notch" fc="28" q="20" gain="-50" />
<biquad type="notch" fc="91" q="20" gain="-50" />
<biquad type="notch" fc="120" q="20" gain="-50" />
<biquad type="lowpass" fc="10000" q="1" gain="-10" />
<lfo frequency="100" depth="0.5" />
<!--biquad type="lowpass" fc="10000" q="1" gain="-10" /-->
<lfo frequency="50" depth="1.0" waveform="triangle" mode="replace"/>
</effect>

View File

@@ -1,7 +1,4 @@
<effect name="Big Echo">
<biquad type="notch" fc="28" q="20" gain="-50" />
<biquad type="notch" fc="91" q="20" gain="-50" />
<biquad type="notch" fc="120" q="20" gain="-50" />
<delayline>
<delay samples="22000" gain="0.2" pan="-0.3">
<biquad type="highpass" fc="300" q="1" gain="0" />

View File

@@ -3,5 +3,5 @@
<biquad type="notch" fc="91" q="20" gain="-50" />
<biquad type="notch" fc="120" q="20" gain="-50" />
<biquad type="lowpass" fc="10000" q="1" gain="-10" />
<agc ceiling="0.666" limit="1" attack="0.1" decay="0.01" />
<agc ceiling="0.666" limit="1.5" attack="0.08" decay="0.01" />
</effect>

View File

@@ -0,0 +1,15 @@
<effect name="Cut Computer Hum (with AGC and Stereo)">
<biquad type="notch" fc="28" q="20" gain="-50" />
<biquad type="notch" fc="91" q="20" gain="-50" />
<biquad type="notch" fc="120" q="20" gain="-50" />
<biquad type="lowpass" fc="10000" q="1" gain="-10" />
<delayline wetonly="false">
<delay samples="-100" gain="0.1" pan="-1.0">
<biquad type="highpass" fc="300" q="1" gain="0" />
</delay>
<delay samples="100" gain="0.1" pan="1.0">
<biquad type="highpass" fc="300" q="1" gain="0" />
</delay>
</delayline>
<agc ceiling="0.666" limit="1.5" attack="0.1" decay="0.01" />
</effect>

View File

@@ -1,7 +1,4 @@
<effect name="Ethereal Voice">
<biquad type="notch" fc="28" q="20" gain="-50" />
<biquad type="notch" fc="91" q="20" gain="-50" />
<biquad type="notch" fc="120" q="20" gain="-50" />
<amplifier gain="0.1" />
<delayline>
<delay samples="2000" gain="1.0" pan="-0.3">

View File

@@ -1,7 +1,4 @@
<effect name="Large Room (quiet)">
<biquad type="notch" fc="28" q="20" gain="-50" />
<biquad type="notch" fc="91" q="20" gain="-50" />
<biquad type="notch" fc="120" q="20" gain="-50" />
<biquad type="lowpass" fc="10000" q="1" gain="-10" />
<delayline>
<delay samples="5500" gain="0.2" pan="-0.3">

View File

@@ -1,7 +1,4 @@
<effect name="Large Room (loud)">
<biquad type="notch" fc="28" q="20" gain="-50" />
<biquad type="notch" fc="91" q="20" gain="-50" />
<biquad type="notch" fc="120" q="20" gain="-50" />
<biquad type="lowpass" fc="10000" q="1" gain="-10" />
<delayline>
<delay samples="5500" gain="0.2" pan="-0.3">

View File

@@ -0,0 +1,3 @@
<effect name="Pan Left">
<pan pan="-0.4" />
</effect>

View File

@@ -0,0 +1,3 @@
<effect name="Pan Right">
<pan pan="0.4" />
</effect>

View File

@@ -1,7 +1,4 @@
<effect name="Telephone">
<biquad type="notch" fc="28" q="20" gain="-50" />
<biquad type="notch" fc="91" q="20" gain="-50" />
<biquad type="notch" fc="120" q="20" gain="-50" />
<biquad type="lowshelf" fc="400" q="10" gain="-20" />
<biquad type="highshelf" fc="8000" q="10" gain="-20" />
<delayline>

View File

@@ -1,14 +1,12 @@
<effect name="Radio">
<biquad type="notch" fc="28" q="20" gain="-50" />
<biquad type="notch" fc="91" q="20" gain="-50" />
<biquad type="notch" fc="120" q="20" gain="-50" />
<amplifier gain="0.1" />
<biquad type="peak" fc="1000" q="10" gain="45" />
<lfo frequency="5000" depth="0.3" />
<clipping clip="0.3" />
<amplifier gain="0.5" />
<biquad type="peak" fc="1000" q="10" gain="25" />
<lfo frequency="3000" depth="0.3" waveform="sine" mode="add" />
<clipping clip="0.9" />
<biquad type="highshelf" fc="8000" q="1" gain="-20" />
<delayline>
<delay samples="100" gain="0.7" />
<delay samples="200" gain="0.5" />
</delayline>
<amplifier gain="0.3" />
</effect>

View File

@@ -1,7 +1,4 @@
<effect name="Robotic">
<biquad type="notch" fc="28" q="20" gain="-50" />
<biquad type="notch" fc="91" q="20" gain="-50" />
<biquad type="notch" fc="120" q="20" gain="-50" />
<biquad type="lowshelf" fc="100" q="2" gain="-20" />
<delayline>
<delay samples="400" gain="1" pan="-0.3" />

View File

@@ -0,0 +1,10 @@
<effect name="Stereo Chorus">
<delayline>
<delay samples="2000" gain="0.1" pan="-0.3">
<biquad type="highpass" fc="300" q="1" gain="0" />
</delay>
<delay samples="4000" gain="0.1" pan="0.3">
<biquad type="highpass" fc="300" q="1" gain="0" />
</delay>
</delayline>
</effect>

View File

@@ -1 +1 @@
version=0.2.1
version=0.2.2

View File

@@ -3227,7 +3227,40 @@ public class AudiobookRecorder extends JFrame {
double f = Utils.s2d(root.getAttribute("frequency"));
double d = Utils.s2d(root.getAttribute("depth"));
double p = Utils.s2d(root.getAttribute("phase"));
return new LFO(f, d, p);
double dty = Math.PI;
String waveform = root.getAttribute("waveform");
if (waveform == null) {
waveform = "sine";
}
int w = LFO.SINE;
switch (waveform.toLowerCase()) {
case "sine": w = LFO.SINE; break;
case "cosine": w = LFO.COSINE; break;
case "square": w = LFO.SQUARE; break;
case "triangle": w = LFO.TRIANGLE; break;
case "sawtooth": w = LFO.SAWTOOTH; break;
}
int m = LFO.ADD;
String mode = root.getAttribute("mode");
if (mode == null) {
mode = "add";
}
switch (mode.toLowerCase()) {
case "add": m = LFO.ADD; break;
case "replace": m = LFO.REPLACE; break;
}
if (root.getAttribute("duty") != null) {
int di = Utils.s2i(root.getAttribute("duty")); // 0-100;
dty = (Math.PI * 2) * ((double)di / 100d);
}
return new LFO(f, d, p, w, dty, m);
}
public AGC loadAGC(Element root) {

View File

@@ -34,6 +34,10 @@ public class BookTreeRenderer extends DefaultTreeCellRenderer {
icn.add(Overlays.important, OverlayIcon.TOP_RIGHT);
}
if (s.getEndOffset() == s.getSampleSize() - 1) {
icn.add(Overlays.important, OverlayIcon.TOP_RIGHT);
}
if (s.getEffectChain() != null) {
if (!s.getEffectChain().equals("none")) {
icn.add(Overlays.filter, OverlayIcon.BOTTOM_RIGHT);

View File

@@ -9,37 +9,73 @@ public class LFO implements Effect {
double depth;
double sampleRate;
double sampleStep;
int waveform;
double duty;
int mode;
public static final int SINE = 0;
public static final int COSINE = 1;
public static final int SQUARE = 2;
public static final int TRIANGLE = 3;
public static final int SAWTOOTH = 4;
public static final int ADD = 0;
public static final int REPLACE = 1;
public LFO(double f, double d) {
frequency = f;
depth = d;
phase = 0;
this(f, d, 0, SINE, Math.PI, REPLACE);
}
public LFO(double f, double d, double p) {
this(f, d, p, SINE, Math.PI, REPLACE);
}
public LFO(double f, double d, double p, int w) {
this(f, d, p, w, Math.PI, REPLACE);
}
public LFO(double f, double d, double p, int w, double dty) {
this(f, d, p, w, dty, REPLACE);
}
public LFO(double f, double d, double p, int w, double dty, int m) {
frequency = f;
depth = d;
phase = p;
waveform = w;
duty = dty;
mode = m;
}
public void process(double[][] samples) {
for (double[] sample : samples) {
double v = Math.sin(phase);
double v = 0;
switch (waveform) {
case SINE: v = Math.sin(phase); break;
case COSINE: v = Math.cos(phase); break;
case SQUARE: v = (phase > duty) ? 1d : 0d; break;
case TRIANGLE: v = (phase < Math.PI) ? (phase / Math.PI) : (1d - ((phase - Math.PI) / Math.PI)); break;
case SAWTOOTH: v = (phase / (Math.PI*2d)); break;
}
phase += sampleStep;
if (phase > (Math.PI * 2d)) {
phase -= (Math.PI * 2d);
}
// // Make it between 0 and 1.
// v = 1d + v;
// v /= 2d;
// Multiply it by the gain factor
v *= depth;
// Apply it to the sample
sample[Sentence.LEFT] += (sample[Sentence.LEFT] * v);
sample[Sentence.RIGHT] += (sample[Sentence.RIGHT] * v);
switch (mode) {
case REPLACE:
sample[Sentence.LEFT] = (sample[Sentence.LEFT] * v);
sample[Sentence.RIGHT] = (sample[Sentence.RIGHT] * v);
break;
case ADD:
sample[Sentence.LEFT] += (sample[Sentence.LEFT] * v);
sample[Sentence.RIGHT] += (sample[Sentence.RIGHT] * v);
break;
}
}
}

View File

@@ -97,6 +97,7 @@ public class Waveform extends JPanel implements MouseListener, MouseMotionListen
double lmax = 0;
for (int o = 0; o < step; o++) {
if (offset + (n * step) + o >= samples.length) break;
double sample = (samples[offset + (n * step) + o][Sentence.LEFT] + samples[offset + (n * step) + o][Sentence.RIGHT]) / 2d;
if (sample >= 0) {
have += sample;