Skip to content

fixed typo in the source code. freuquency -> frequency #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/processing/sound/Amplitude.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ Processing Sound (c) 2013-2015 Wilm Thoben
*/

public class Amplitude {

PApplet parent;
private Engine m_engine;
private long ptr;

public Amplitude(PApplet theParent) {
this.parent = theParent;
parent.registerMethod("dispose", this);
Expand All @@ -51,25 +51,25 @@ public Amplitude(PApplet theParent) {
public void input(SoundObject input){
ptr = m_engine.amplitude(input.returnId());
}

/**
* Queries a value from the analyzer and returns a float between 0. and 1.
* @webref sound
* Queries a value from the analyzer and returns a float between 0. and 1.
* @webref sound
* @return amp An amplitude value between 0-1.
**/

public float analyze(){
return m_engine.poll_amplitude(ptr);
}

// public void stop(){
// m_engine.synthStop(m_nodeId);
// m_engine.synthStop(m_nodeId);
// }

// public int returnId(){
// return m_nodeId;
// }

public void dispose() {
m_engine.destroy_amplitude(ptr);
//m_engine.synthStop(m_nodeId);
Expand Down
56 changes: 28 additions & 28 deletions src/processing/sound/SawOsc.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,77 +19,77 @@ Processing Sound (c) 2013-2015 Wilm Thoben
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
*/

package processing.sound;
import processing.core.PApplet;

/**
* This is a simple Saw Wave Oscillator
* This is a simple Saw Wave Oscillator
* @webref sound
* @param parent PApplet: typically use "this"
**/

public class SawOsc implements Oscillator{

PApplet parent;
private Engine m_engine;
private int[] m_nodeId = {-1,-1};

private int[] m_freqId = {-1,-1};
private int[] m_ampId = {-1,-1};
private int[] m_addId = {-1,-1};
private int[] m_posId = {-1,-1};

private float m_freq = 440;
private float m_amp = 0.5f;
private float m_add = 0;
private float m_pos = 0;
private int m_panBusId;
private int m_panBusId;

public SawOsc(PApplet theParent) {
this.parent = theParent;
parent.registerMethod("dispose", this);
m_engine.setPreferences(theParent, 512, 44100);
m_engine.start();
m_panBusId = m_engine.busConstructMono();
m_engine.start();
m_panBusId = m_engine.busConstructMono();
}

public void play(float freq, float amp, float add, float pos){
m_freq=freq; m_amp=amp; m_add=add; m_pos=pos;
m_nodeId = m_engine.sawPlay(m_freq, m_amp, m_add, m_pos, m_panBusId);
}

public void play(float freq, float amp, float add){
m_freq=freq; m_amp=amp; m_add=add;
m_nodeId = m_engine.sawPlay(m_freq, m_amp, m_add, m_pos, m_panBusId);
}

public void play(float freq, float amp){
m_freq=freq; m_amp=amp;
m_nodeId = m_engine.sawPlay(m_freq, m_amp, m_add, m_pos, m_panBusId);
}

/**
* Starts the oscillator
* @webref sound
**/

public void play(){
m_nodeId = m_engine.sawPlay(m_freq, m_amp, m_add, m_pos, m_panBusId);
}

private void set(){
if(m_nodeId[0] != -1 ) {
m_engine.oscSet(m_freq, m_amp, m_add, m_pos, m_nodeId);
}
}
}

private void audioSet(){
if(m_nodeId[0] != -1 ) {
m_engine.oscAudioSet(m_freqId, m_ampId, m_addId, m_posId, m_nodeId);
}
}
}

/**
* Set multiple parameters at once
* @webref sound
Expand All @@ -103,9 +103,9 @@ public void set(float freq, float amp, float add, float pos){
m_freq=freq; m_amp=amp; m_add=add; m_pos=pos;
this.set();
}

/**
* Set the freuquency of the oscillator in Hz.
* Set the frequency of the oscillator in Hz.
* @webref sound
* @param freq A floating point value of the oscillator in Hz.
**/
Expand All @@ -118,7 +118,7 @@ public void freq(float freq){
public void freq(SoundObject freq){
m_freqId=freq.returnId();
this.audioSet();
}
}

/**
* Set the amplitude/volume of the oscillator
Expand All @@ -134,35 +134,35 @@ public void amp(float amp){
public void amp(SoundObject amp){
m_ampId=amp.returnId();
this.audioSet();
}
}

/**
* Offset the output of the oscillator by given value
* @webref sound
* @param add A value for modulating other audio signals.
**/
**/

public void add(float add){
m_add=add;
this.set();
}

public void add(SoundObject add){
m_addId=add.returnId();
this.audioSet();
}
}

/**
* Move the sound in a stereo panorama
* @webref sound
* @param pos The panoramic position of the oscillator as a float from -1.0 to 1.0.
**/
**/

public void pan(float pos){
m_pos=pos;
this.set();
}

public void pan(SoundObject pos){
m_posId=pos.returnId();
this.audioSet();
Expand All @@ -181,7 +181,7 @@ public void stop(){
}
}
}

public int[] returnId(){
return m_nodeId;
}
Expand Down
44 changes: 22 additions & 22 deletions src/processing/sound/SinOsc.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,46 +24,46 @@ Processing Sound (c) 2013-2015 Wilm Thoben
import processing.core.PApplet;

/**
* This is a simple Sine Wave Oscillator
* This is a simple Sine Wave Oscillator
* @webref sound
* @param parent PApplet: typically use "this"
**/

public class SinOsc implements Oscillator {

PApplet parent;
private Engine m_engine;
private int[] m_nodeId = {-1,-1};
private float m_freq = 440;
private float m_amp = 0.5f;
private float m_add = 0;
private float m_pos = 0;
private int m_panBusId;
private int m_panBusId;

public SinOsc(PApplet theParent) {
this.parent = theParent;
parent.registerMethod("dispose", this);
m_engine.setPreferences(theParent, 512, 44100);
m_engine.start();
m_engine.start();
m_panBusId = m_engine.busConstructMono();

}

public void play(float freq, float amp, float add, float pos){
m_freq=freq; m_amp=amp; m_add=add; m_pos=pos;
this.play();
}

public void play(float freq, float amp, float add){
m_freq=freq; m_amp=amp; m_add=add;
this.play();
}

public void play(float freq, float amp){
m_freq=freq; m_amp=amp;
this.play();
}

/**
* Starts the oscillator
* @webref sound
Expand All @@ -72,11 +72,11 @@ public void play(float freq, float amp){
public void play(){
m_nodeId = m_engine.sinePlay(m_freq, m_amp, m_add, m_pos, m_panBusId);
}

private void set(){
if(m_nodeId[0] != -1 ) {
m_engine.oscSet(m_freq, m_amp, m_add, m_pos, m_nodeId);
}
}
}

/**
Expand All @@ -87,14 +87,14 @@ private void set(){
* @param add A value for modulating other audio signals.
* @param pos The panoramic position of the oscillator as a float from -1.0 to 1.0.
**/

public void set(float freq, float amp, float add, float pos){
m_freq=freq; m_amp=amp; m_add=add; m_pos=pos;
this.set();
}

/**
* Set the freuquency of the oscillator in Hz.
* Set the frequency of the oscillator in Hz.
* @webref sound
* @param freq A floating point value of the oscillator in Hz.
**/
Expand All @@ -114,34 +114,34 @@ public void amp(float amp){
m_amp=amp;
this.set();
}

/**
* Offset the output of the oscillator by given value
* @webref sound
* @param add A value for modulating other audio signals.
**/
**/

public void add(float add){
m_add=add;
this.set();
}

/**
* Move the sound in a stereo panorama
* @webref sound
* @param pos The panoramic position of the oscillator as a float from -1.0 to 1.0.
**/
**/

public void pan(float pos){
m_pos=pos;
this.set();
}

/**
* Stop the oscillator.
* @webref sound
**/

public void stop(){
if(m_nodeId[0] != -1 ) {
m_engine.synthStop(m_nodeId);
Expand All @@ -150,7 +150,7 @@ public void stop(){
}
}
}

public int[] returnId(){
return m_nodeId;
}
Expand Down
Loading