Sign in
|
Join
Search
A Portion of Buff
Everybody else had one, so...
Home
About
RSS
Atom
Comments RSS
Recent Posts
Noise 0.3 released
The subdued garbage collector
Noise 0.2 source released
On microbenchmarks and red faces
Keeping it real-time (3)
Tags
Managed DirectX
Navigation
Home
Blogs
Managed DirectX
My First Spinning Cube
(Probably Not) The World's Smallest Video Player
Archives
April 2005 (2)
March 2005 (5)
February 2005 (1)
October 2004 (1)
September 2004 (1)
August 2004 (4)
July 2004 (2)
February 2004 (1)
January 2004 (2)
December 2003 (1)
June 2003 (1)
May 2003 (4)
April 2003 (6)
March 2003 (3)
February 2003 (3)
Keeping it real-time (3)
These late nights are going to catch up with me, but until then...
I've kicked off
Noise
, an open source project for this managed VST plugin thing I'm working on:
(Last year I was working on an abortive software synthesizer called "Noise!", so it seemed appropriate to recycle the name).
It's obviously quite rough at the moment, but please, if you use any VST-compatible audio software (Cubase, SoundForge, FruityLoops etc), download it, give it a try, and let me know if you had any problems (positive feedback is nice too). If you don't have a VST host, there's a free one included, so you can still play around if you're interested.
So far I've got delay, lo/hi-pass filter, gain and reverb plug-ins - the latter being the most fun to do and the most difficult to get my head around. One thing that struck me tonight was just how incredibly fast computers are. I know I should be accustomed to that, being a developer, but when you're writing code which applies 12 different filters to 44,100 stereo samples per second, in parallel to a software synthesizer which is generating those 44,100 stereo samples per second with its own oscillators, filters and envelopes, on top of a host application routing all these samples from the synth, through your plugin (via layers of C, Managed C++ and C#) and out to a sound card, and it only takes 3% of available CPU time, it kind of brings it home.
Here's a stereo comb filter:
public class CombFilter
{
float feedback;
float damp1;
float damp2;
float lastLeftValue;
float lastRightValue;
int leftIndex;
int rightIndex;
float[] leftBuffer;
float[] rightBuffer;
public CombFilter(int leftTuning, int rightTuning, float damp, float feedback)
{
this.feedback = feedback;
this.damp1 = damp;
this.damp2 = (1 - damp);
this.leftBuffer = new float[leftTuning];
this.rightBuffer = new float[rightTuning];
}
public float ProcessLeft(float input)
{
lastLeftValue = (leftBuffer[leftIndex] * damp2) + (lastLeftValue * damp1);
leftBuffer[leftIndex] = input + (lastLeftValue * feedback);
if (++leftIndex >= leftBuffer.Length)
{
leftIndex = 0;
}
return leftBuffer[leftIndex];
}
public float ProcessRight(float input)
{
lastRightValue = (rightBuffer[rightIndex] * damp2) + (lastRightValue * damp1);
rightBuffer[rightIndex] = input + (lastRightValue * feedback);
if (++rightIndex >= rightBuffer.Length)
{
rightIndex = 0;
}
return rightBuffer[rightIndex];
}
}
Posted:
Mar 22 2005, 01:03 AM
by
jimski3000
| with
2 comment(s)
Comments
Dustin
said:
Holy crap. This stuff WAILS!
#
March 22, 2005 2:18 PM
Huge dude said:
You know it, cupcake
#
March 22, 2005 4:06 PM
Leave a Comment
Title
(required)
Name
(required)
Your URL
(optional
)
Comments
(required)
Remember Me?