mirror of
https://github.com/processing/processing4.git
synced 2026-01-29 11:21:06 +01:00
repaired Filter + took out res + introduced Bandwidth for BPass. fixed some public/private bugs
This commit is contained in:
@@ -6,7 +6,7 @@ In this example it is started and stopped by clicking into the renderer window.
|
||||
import processing.sound.*;
|
||||
|
||||
WhiteNoise noise;
|
||||
BandPass bPass;
|
||||
BandPass bandPass;
|
||||
|
||||
float amp=0.0;
|
||||
|
||||
@@ -16,14 +16,15 @@ void setup() {
|
||||
|
||||
// Create the noise generator + Filter
|
||||
noise = new WhiteNoise(this);
|
||||
bPass = new BandPass(this);
|
||||
bandPass = new BandPass(this);
|
||||
|
||||
noise.play(0.5);
|
||||
bPass.process(noise, 100);
|
||||
bandPass.process(noise, 100);
|
||||
}
|
||||
|
||||
void draw() {
|
||||
|
||||
bPass.freq(map(mouseX, 0, 350, 20, 10000));
|
||||
bandPass.freq(map(mouseX, 0, width, 20, 10000));
|
||||
|
||||
bPass.res(map(mouseY, 0, 350, 0.05, 1.0));
|
||||
bandPass.bw(map(mouseY, 0, height, 100, 1000));
|
||||
}
|
||||
|
||||
@@ -17,10 +17,11 @@ void setup() {
|
||||
// Create the noise generator + filter
|
||||
noise = new WhiteNoise(this);
|
||||
highPass = new HighPass(this);
|
||||
|
||||
noise.play(0.5);
|
||||
highPass.process(noise, 100);
|
||||
}
|
||||
|
||||
void draw() {
|
||||
highPass.freq(map(mouseX, 0, 350, 20, 10000));
|
||||
highPass.freq(map(mouseX, 0, width, 80, 10000));
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ In this example it is started and stopped by clicking into the renderer window.
|
||||
import processing.sound.*;
|
||||
|
||||
WhiteNoise noise;
|
||||
LowPass lPass;
|
||||
LowPass lowPass;
|
||||
|
||||
float amp=0.0;
|
||||
|
||||
@@ -16,11 +16,11 @@ void setup() {
|
||||
|
||||
// Create the noise generator + filter
|
||||
noise = new WhiteNoise(this);
|
||||
lPass = new LowPass(this);
|
||||
lowPass = new LowPass(this);
|
||||
noise.play(0.2);
|
||||
lPass.process(noise, 800);
|
||||
lowPass.process(noise, 800);
|
||||
}
|
||||
|
||||
void draw() {
|
||||
lPass.freq(map(mouseX, 0, 350, 800, 10000));
|
||||
lowPass.freq(map(mouseX, 0, width, 80, 10000));
|
||||
}
|
||||
|
||||
@@ -8,3 +8,4 @@ clean:
|
||||
|
||||
install:
|
||||
cp libMethClaInterface.jnilib ../../library/macosx
|
||||
cp libMethClaInterface.jnilib /Users/wirsing/Documents/Processing/libraries/sound/library/macosx/
|
||||
|
||||
25
java/libraries/sound/src/cpp/include/methcla/plugins/bpf.h
Normal file
25
java/libraries/sound/src/cpp/include/methcla/plugins/bpf.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
Copyright 2012-2013 Samplecount S.L.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef METHCLA_PLUGINS_BPF_H_INCLUDED
|
||||
#define METHCLA_PLUGINS_BPF_H_INCLUDED
|
||||
|
||||
#include <methcla/plugin.h>
|
||||
|
||||
METHCLA_EXPORT const Methcla_Library* methcla_plugins_bpf(const Methcla_Host*, const char*);
|
||||
#define METHCLA_PLUGINS_BPF_URI METHCLA_PLUGINS_URI "/bpf"
|
||||
|
||||
#endif /* METHCLA_PLUGINS_BPF_H_INCLUDED */
|
||||
@@ -234,18 +234,18 @@ JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_doneAfter
|
||||
/*
|
||||
* Class: processing_sound_MethClaInterface
|
||||
* Method: highPassPlay
|
||||
* Signature: ([IFF)[I
|
||||
* Signature: ([IF)[I
|
||||
*/
|
||||
JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_highPassPlay
|
||||
(JNIEnv *, jobject, jintArray, jfloat, jfloat);
|
||||
(JNIEnv *, jobject, jintArray, jfloat);
|
||||
|
||||
/*
|
||||
* Class: processing_sound_MethClaInterface
|
||||
* Method: lowPassPlay
|
||||
* Signature: ([IFF)[I
|
||||
* Signature: ([IF)[I
|
||||
*/
|
||||
JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_lowPassPlay
|
||||
(JNIEnv *, jobject, jintArray, jfloat, jfloat);
|
||||
(JNIEnv *, jobject, jintArray, jfloat);
|
||||
|
||||
/*
|
||||
* Class: processing_sound_MethClaInterface
|
||||
@@ -258,9 +258,17 @@ JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_bandPassPlay
|
||||
/*
|
||||
* Class: processing_sound_MethClaInterface
|
||||
* Method: filterSet
|
||||
* Signature: (FFI)V
|
||||
* Signature: (FI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_filterSet
|
||||
(JNIEnv *, jobject, jfloat, jint);
|
||||
|
||||
/*
|
||||
* Class: processing_sound_MethClaInterface
|
||||
* Method: filterBwSet
|
||||
* Signature: (FFI)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_filterBwSet
|
||||
(JNIEnv *, jobject, jfloat, jfloat, jint);
|
||||
|
||||
/*
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "methcla/plugins/fft.h"
|
||||
#include "methcla/plugins/hpf.h"
|
||||
#include "methcla/plugins/lpf.h"
|
||||
#include "methcla/plugins/bpf.h"
|
||||
#include "methcla/plugins/delay.h"
|
||||
#include "methcla/plugins/reverb.h"
|
||||
#include "methcla/plugins/audio_in.h"
|
||||
@@ -50,9 +51,7 @@ struct ServerValue{
|
||||
ServerValue() :
|
||||
amp(0),
|
||||
id(-1)
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
float amp;
|
||||
int id;
|
||||
};
|
||||
@@ -62,9 +61,7 @@ struct ServerArray{
|
||||
fftSize(512),
|
||||
fft(fftSize),
|
||||
id(-1)
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
int fftSize;
|
||||
std::vector<float> fft;
|
||||
int id;
|
||||
@@ -93,7 +90,8 @@ JNIEXPORT jint JNICALL Java_processing_sound_MethClaInterface_engineNew (JNIEnv
|
||||
.addLibrary(methcla_plugins_pan2)
|
||||
.addLibrary(methcla_plugins_amplitude_follower)
|
||||
.addLibrary(methcla_plugins_hpf)
|
||||
.addLibrary(methcla_plugins_lpf)
|
||||
.addLibrary(methcla_plugins_lpf)
|
||||
.addLibrary(methcla_plugins_bpf)
|
||||
.addLibrary(methcla_plugins_delay)
|
||||
.addLibrary(methcla_plugins_reverb)
|
||||
.addLibrary(methcla_plugins_fft)
|
||||
@@ -170,8 +168,8 @@ JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_oscAudioSet(JNIEnv
|
||||
if (m_freq[0] != -1)
|
||||
{
|
||||
Methcla::AudioBusId freq_bus = m_engine->audioBusId().alloc();
|
||||
request.set(m_nodeId[0], 0 , 0);
|
||||
request.free(m_freq[1]);
|
||||
//request.set(m_nodeId[0], 0 , 0);
|
||||
//request.free(m_freq[1]);
|
||||
request.mapOutput(m_freq[0], 0, freq_bus);
|
||||
request.mapInput(m_nodeId[0], 0, freq_bus);
|
||||
|
||||
@@ -179,15 +177,12 @@ JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_oscAudioSet(JNIEnv
|
||||
}
|
||||
|
||||
if (m_amp[0] != -1)
|
||||
{
|
||||
{
|
||||
|
||||
Methcla::AudioBusId amp_bus = m_engine->audioBusId().alloc();
|
||||
//request.set(m_nodeId[0], 1 , 0);
|
||||
//request.free(m_amp[1]);
|
||||
request.mapOutput(m_amp[0], 0, amp_bus);
|
||||
std::cout << m_amp[0] << std::endl;
|
||||
request.set(m_amp[0], 0, 200);
|
||||
|
||||
request.mapInput(m_nodeId[0], 1, amp_bus);
|
||||
|
||||
std::cout << "amp" << std::endl;
|
||||
@@ -272,7 +267,6 @@ JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_sinePlay(JNIE
|
||||
};
|
||||
|
||||
JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_sawPlay(JNIEnv *env, jobject object, jfloat freq, jfloat amp, jfloat add, jfloat pos){
|
||||
|
||||
jintArray nodeId = env->NewIntArray(2);
|
||||
jint *m_nodeId = env->GetIntArrayElements(nodeId, NULL);
|
||||
|
||||
@@ -293,6 +287,9 @@ JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_sawPlay(JNIEn
|
||||
{Methcla::Value(1.f)}
|
||||
);
|
||||
|
||||
engine().addNotificationHandler(engine().freeNodeIdHandler(synth.id()));
|
||||
engine().addNotificationHandler(engine().freeNodeIdHandler(pan.id()));
|
||||
|
||||
request.mapOutput(synth.id(), 0, bus);
|
||||
request.mapInput(pan.id(), 0, bus);
|
||||
request.mapOutput(pan.id(), 0, Methcla::AudioBusId(0), Methcla::kBusMappingExternal);
|
||||
@@ -910,7 +907,7 @@ JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_envelopePlay(
|
||||
return returnId;
|
||||
};
|
||||
|
||||
JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_highPassPlay(JNIEnv *env, jobject object, jintArray nodeId, jfloat freq, jfloat res){
|
||||
JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_highPassPlay(JNIEnv *env, jobject object, jintArray nodeId, jfloat freq){
|
||||
|
||||
jint* m_nodeId = env->GetIntArrayElements(nodeId, 0);
|
||||
jintArray returnId = env->NewIntArray(2);
|
||||
@@ -924,7 +921,7 @@ JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_highPassPlay(
|
||||
auto synth = request.synth(
|
||||
METHCLA_PLUGINS_HPF_URI,
|
||||
Methcla::NodePlacement::after(m_nodeId[0]),
|
||||
{freq, res},
|
||||
{freq},
|
||||
{}
|
||||
);
|
||||
|
||||
@@ -947,7 +944,7 @@ JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_highPassPlay(
|
||||
return returnId;
|
||||
};
|
||||
|
||||
JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_lowPassPlay(JNIEnv *env, jobject object, jintArray nodeId, jfloat freq, jfloat res){
|
||||
JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_lowPassPlay(JNIEnv *env, jobject object, jintArray nodeId, jfloat freq){
|
||||
|
||||
jint* m_nodeId = env->GetIntArrayElements(nodeId, 0);
|
||||
jintArray returnId = env->NewIntArray(2);
|
||||
@@ -961,7 +958,7 @@ JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_lowPassPlay(J
|
||||
auto synth = request.synth(
|
||||
METHCLA_PLUGINS_LPF_URI,
|
||||
Methcla::NodePlacement::after(m_nodeId[0]),
|
||||
{freq, res},
|
||||
{freq},
|
||||
{}
|
||||
);
|
||||
|
||||
@@ -984,7 +981,7 @@ JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_lowPassPlay(J
|
||||
return returnId;
|
||||
};
|
||||
|
||||
JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_bandPassPlay(JNIEnv *env, jobject object, jintArray nodeId, jfloat freq, jfloat res){
|
||||
JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_bandPassPlay(JNIEnv *env, jobject object, jintArray nodeId, jfloat freq, jfloat bw){
|
||||
|
||||
jint* m_nodeId = env->GetIntArrayElements(nodeId, 0);
|
||||
jintArray returnId = env->NewIntArray(2);
|
||||
@@ -996,9 +993,9 @@ JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_bandPassPlay(
|
||||
Methcla::Request request(engine());
|
||||
request.openBundle(Methcla::immediately);
|
||||
auto synth = request.synth(
|
||||
METHCLA_PLUGINS_HPF_URI,
|
||||
METHCLA_PLUGINS_BPF_URI,
|
||||
Methcla::NodePlacement::after(m_nodeId[0]),
|
||||
{freq, res},
|
||||
{freq, bw},
|
||||
{}
|
||||
);
|
||||
|
||||
@@ -1021,12 +1018,21 @@ JNIEXPORT jintArray JNICALL Java_processing_sound_MethClaInterface_bandPassPlay(
|
||||
return returnId;
|
||||
};
|
||||
|
||||
JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_filterSet(JNIEnv *env, jobject object, jfloat freq, jfloat res, jint nodeId){
|
||||
JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_filterSet(JNIEnv *env, jobject object, jfloat freq, jint nodeId){
|
||||
|
||||
Methcla::Request request(engine());
|
||||
request.openBundle(Methcla::immediately);
|
||||
request.set(nodeId, 0, freq);
|
||||
request.set(nodeId, 1, res);
|
||||
request.closeBundle();
|
||||
request.send();
|
||||
};
|
||||
|
||||
JNIEXPORT void JNICALL Java_processing_sound_MethClaInterface_filterBwSet(JNIEnv *env, jobject object, jfloat freq, jfloat bw, jint nodeId){
|
||||
|
||||
Methcla::Request request(engine());
|
||||
request.openBundle(Methcla::immediately);
|
||||
request.set(nodeId, 0, freq);
|
||||
request.set(nodeId, 1, bw);
|
||||
request.closeBundle();
|
||||
request.send();
|
||||
};
|
||||
|
||||
@@ -7,8 +7,8 @@ public class BandPass implements SoundObject{
|
||||
PApplet parent;
|
||||
private Engine m_engine;
|
||||
private int[] m_nodeId = {-1,-1};
|
||||
private float m_freq = 100;
|
||||
private float m_res = 1;
|
||||
private float m_freq = 4000;
|
||||
private float m_bw = 1000;
|
||||
|
||||
public BandPass(PApplet theParent) {
|
||||
this.parent = theParent;
|
||||
@@ -17,22 +17,26 @@ public class BandPass implements SoundObject{
|
||||
m_engine.start();
|
||||
}
|
||||
|
||||
public void process(SoundObject input, float freq, float res){
|
||||
m_freq=freq; m_res=res;
|
||||
m_nodeId = m_engine.bandPassPlay(input.returnId(), m_freq, m_res);
|
||||
public void process(SoundObject input, float freq, float bw){
|
||||
m_freq=freq; m_bw=bw;
|
||||
m_nodeId = m_engine.bandPassPlay(input.returnId(), m_freq, m_bw);
|
||||
}
|
||||
|
||||
public void process(SoundObject input, float freq){
|
||||
m_freq=freq;
|
||||
m_nodeId = m_engine.bandPassPlay(input.returnId(), m_freq, m_res);
|
||||
m_nodeId = m_engine.bandPassPlay(input.returnId(), m_freq, m_bw);
|
||||
}
|
||||
|
||||
public void process(SoundObject input){
|
||||
m_nodeId = m_engine.bandPassPlay(input.returnId(), m_freq, m_bw);
|
||||
}
|
||||
|
||||
private void set(){
|
||||
m_engine.filterSet(m_freq, m_res, m_nodeId[0]);
|
||||
m_engine.filterBwSet(m_freq, m_bw, m_nodeId[0]);
|
||||
}
|
||||
|
||||
public void set(float freq, float res){
|
||||
m_freq=freq; m_res=res;
|
||||
public void set(float freq, float bw){
|
||||
m_freq=freq; m_bw=bw;
|
||||
this.set();
|
||||
}
|
||||
|
||||
@@ -41,8 +45,8 @@ public class BandPass implements SoundObject{
|
||||
this.set();
|
||||
}
|
||||
|
||||
public void res(float res){
|
||||
m_res=res;
|
||||
public void bw(float bw){
|
||||
m_bw=bw;
|
||||
this.set();
|
||||
}
|
||||
|
||||
|
||||
@@ -177,20 +177,24 @@ public class Engine {
|
||||
|
||||
// Filters
|
||||
|
||||
public static int[] highPassPlay(int[] input, float freq, float res){
|
||||
return methCla.highPassPlay(input, freq, res);
|
||||
public static int[] highPassPlay(int[] input, float freq){
|
||||
return methCla.highPassPlay(input, freq);
|
||||
};
|
||||
|
||||
public static int[] lowPassPlay(int[] input, float freq, float res){
|
||||
return methCla.lowPassPlay(input, freq, res);
|
||||
public static int[] lowPassPlay(int[] input, float freq){
|
||||
return methCla.lowPassPlay(input, freq);
|
||||
};
|
||||
|
||||
public static int[] bandPassPlay(int[] input, float freq, float res){
|
||||
return methCla.bandPassPlay(input, freq, res);
|
||||
public static int[] bandPassPlay(int[] input, float freq, float bw){
|
||||
return methCla.bandPassPlay(input, freq, bw);
|
||||
};
|
||||
|
||||
public static void filterSet(float freq, float res, int nodeId){
|
||||
methCla.filterSet(freq, res, nodeId);
|
||||
public static void filterSet(float freq, int nodeId){
|
||||
methCla.filterSet(freq, nodeId);
|
||||
};
|
||||
|
||||
public static void filterBwSet(float freq, float bw, int nodeId){
|
||||
methCla.filterBwSet(freq, bw, nodeId);
|
||||
};
|
||||
|
||||
// Delay
|
||||
|
||||
@@ -8,7 +8,6 @@ public class HighPass implements SoundObject{
|
||||
private Engine m_engine;
|
||||
private int[] m_nodeId = {-1,-1};
|
||||
private float m_freq = 100;
|
||||
private float m_res = 1;
|
||||
|
||||
public HighPass(PApplet theParent) {
|
||||
this.parent = theParent;
|
||||
@@ -17,22 +16,21 @@ public class HighPass implements SoundObject{
|
||||
m_engine.start();
|
||||
}
|
||||
|
||||
public void process(SoundObject input, float freq, float res){
|
||||
m_freq=freq; m_res=res;
|
||||
m_nodeId = m_engine.highPassPlay(input.returnId(), m_freq, m_res);
|
||||
}
|
||||
|
||||
public void process(SoundObject input, float freq){
|
||||
m_freq=freq;
|
||||
m_nodeId = m_engine.highPassPlay(input.returnId(), m_freq, m_res);
|
||||
m_nodeId = m_engine.highPassPlay(input.returnId(), m_freq);
|
||||
}
|
||||
|
||||
public void process(SoundObject input){
|
||||
m_nodeId = m_engine.highPassPlay(input.returnId(), m_freq);
|
||||
}
|
||||
|
||||
private void set(){
|
||||
m_engine.filterSet(m_freq, m_res, m_nodeId[0]);
|
||||
m_engine.filterSet(m_freq, m_nodeId[0]);
|
||||
}
|
||||
|
||||
public void set(float freq, float res){
|
||||
m_freq=freq; m_res=res;
|
||||
public void set(float freq){
|
||||
m_freq=freq;
|
||||
this.set();
|
||||
}
|
||||
|
||||
@@ -40,11 +38,6 @@ public class HighPass implements SoundObject{
|
||||
m_freq=freq;
|
||||
this.set();
|
||||
}
|
||||
|
||||
public void res(float res){
|
||||
m_res=res;
|
||||
this.set();
|
||||
}
|
||||
|
||||
public int[] returnId(){
|
||||
return m_nodeId;
|
||||
|
||||
@@ -8,7 +8,6 @@ public class LowPass implements SoundObject{
|
||||
private Engine m_engine;
|
||||
private int[] m_nodeId = {-1, -1};
|
||||
private float m_freq = 100;
|
||||
private float m_res = 1;
|
||||
|
||||
public LowPass(PApplet theParent) {
|
||||
this.parent = theParent;
|
||||
@@ -17,22 +16,21 @@ public class LowPass implements SoundObject{
|
||||
m_engine.start();
|
||||
}
|
||||
|
||||
public void process(SoundObject input, float freq, float res){
|
||||
m_freq=freq; m_res=res;
|
||||
m_nodeId = m_engine.lowPassPlay(input.returnId(), m_freq, m_res);
|
||||
}
|
||||
|
||||
public void process(SoundObject input, float freq){
|
||||
m_freq=freq;
|
||||
m_nodeId = m_engine.lowPassPlay(input.returnId(), m_freq, m_res);
|
||||
m_nodeId = m_engine.lowPassPlay(input.returnId(), m_freq);
|
||||
}
|
||||
|
||||
public void process(SoundObject input){
|
||||
m_nodeId = m_engine.lowPassPlay(input.returnId(), m_freq);
|
||||
}
|
||||
|
||||
private void set(){
|
||||
m_engine.filterSet(m_freq, m_res, m_nodeId[0]);
|
||||
m_engine.filterSet(m_freq, m_nodeId[0]);
|
||||
}
|
||||
|
||||
public void set(float freq, float res){
|
||||
m_freq=freq; m_res=res;
|
||||
public void set(float freq){
|
||||
m_freq=freq;
|
||||
this.set();
|
||||
}
|
||||
|
||||
@@ -41,11 +39,6 @@ public class LowPass implements SoundObject{
|
||||
this.set();
|
||||
}
|
||||
|
||||
public void res(float res){
|
||||
m_res=res;
|
||||
this.set();
|
||||
}
|
||||
|
||||
public int[] returnId(){
|
||||
return m_nodeId;
|
||||
}
|
||||
|
||||
@@ -94,13 +94,16 @@ public class MethClaInterface
|
||||
|
||||
// Filters
|
||||
|
||||
public native int[] highPassPlay(int[] input, float freq, float res);
|
||||
public native int[] highPassPlay(int[] input, float freq);
|
||||
|
||||
public native int[] lowPassPlay(int[] input, float freq, float res);
|
||||
public native int[] lowPassPlay(int[] input, float freq);
|
||||
|
||||
public native int[] bandPassPlay(int[] input, float freq, float res);
|
||||
public native int[] bandPassPlay(int[] input, float freq, float bw);
|
||||
|
||||
public native void filterSet(float freq, int nodeId);
|
||||
|
||||
public native void filterBwSet(float freq, float bw, int nodeId);
|
||||
|
||||
public native void filterSet(float freq, float res, int nodeId);
|
||||
|
||||
// Delay
|
||||
|
||||
|
||||
42
java/libraries/sound/src/processing/sound/Mix.java
Normal file
42
java/libraries/sound/src/processing/sound/Mix.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package processing.sound;
|
||||
|
||||
import processing.core.PApplet;
|
||||
|
||||
public class Mix implements SoundObject{
|
||||
|
||||
PApplet parent;
|
||||
private Engine m_engine;
|
||||
private int m_nodeId[] = {-1,-1};
|
||||
private int[] m_nodeInIds;
|
||||
private float[] m_amps;
|
||||
|
||||
public Mix(PApplet theParent) {
|
||||
this.parent = theParent;
|
||||
parent.registerMethod("dispose", this);
|
||||
m_engine.setPreferences(theParent, 512, 44100);
|
||||
m_engine.start();
|
||||
}
|
||||
|
||||
public void play(SoundObject[] input, float[] amps){
|
||||
m_amps=amps;
|
||||
for (int i=0; i<input.length; i++) {
|
||||
int[] returnId = input[i].returnId();
|
||||
m_nodeInIds[i*2]=returnId[0];
|
||||
m_nodeInIds[(i*2)+1]=returnId[1];
|
||||
}
|
||||
//m_nodeId = m_engine.mixPlay(input.length, m_nodeInIds, amps);
|
||||
}
|
||||
|
||||
|
||||
public int[] returnId(){
|
||||
return m_nodeId;
|
||||
}
|
||||
|
||||
public void stop(){
|
||||
m_engine.synthStop(m_nodeId);
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
m_engine.synthStop(m_nodeId);
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,6 @@ interface Noise extends SoundObject {
|
||||
public void amp(float amp);
|
||||
public void add(float add);
|
||||
public void pan(float pos);
|
||||
public void set();
|
||||
public void set(float amp, float add, float pan);
|
||||
public void stop();
|
||||
public void dispose();
|
||||
|
||||
@@ -11,7 +11,6 @@ interface Oscillator extends SoundObject {
|
||||
public void amp(float amp);
|
||||
public void add(float add);
|
||||
public void pan(float pos);
|
||||
public void set();
|
||||
public void set(float freq, float amp, float add, float pan);
|
||||
public void stop();
|
||||
public void dispose();
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
|
||||
Bugs (GSoC):
|
||||
+ Fix FFT Crash
|
||||
- Fix Low Pass Distortion
|
||||
+ Fix Low Pass Distortion
|
||||
+ Review Filter Algorithms, exclude Resonance, introduce Bandwith for BPass
|
||||
+ Fix problem of passing effects to Analyzers
|
||||
+ Make audio input work
|
||||
- Use Patch Cables for signal splitting for effects
|
||||
@@ -19,9 +20,13 @@
|
||||
- Bandlimit oscillators
|
||||
- Introduce wet/dry for Delay
|
||||
- Interpolate control signals
|
||||
- Overload Filter Functions
|
||||
+ Overload Filter Functions
|
||||
- If you loop a sample and use jump make it play from the beginning
|
||||
|
||||
|
||||
Documentation:
|
||||
- Write reference for Sound for Processing website
|
||||
- Review Processing Book
|
||||
|
||||
NICE
|
||||
- Pitchtracker (GSoC optional)
|
||||
- isPlaying method for Synths
|
||||
|
||||
Reference in New Issue
Block a user