| Author |
Message |
kijjaz

Joined: Sep 20, 2004 Posts: 463 Location: bangkok, thailand
Audio files: 2
|
|
|
Back to top
|
|
 |
kijjaz

Joined: Sep 20, 2004 Posts: 463 Location: bangkok, thailand
Audio files: 2
|
|
|
Back to top
|
|
 |
kijjaz

Joined: Sep 20, 2004 Posts: 463 Location: bangkok, thailand
Audio files: 2
|
|
|
Back to top
|
|
 |
kijjaz

Joined: Sep 20, 2004 Posts: 463 Location: bangkok, thailand
Audio files: 2
|
Posted: Sun Mar 09, 2008 10:53 am Post subject:
|
 |
|
Just to update more:
I've been improving and trying to make an interesting control code..
but I usually get a lot of feedback going on..
today, I've got many takes that is feedbacking a lot all the time,
so I feed the signal into a limiter then an overdrive (that also do the limiting)
after that, I reverse the sound, and it happens to be quite enjoyable.
You can visit www.myspace.com/kijjaz to have a listen. the name of the track is What Vibraphone. |
|
|
Back to top
|
|
 |
kijjaz

Joined: Sep 20, 2004 Posts: 463 Location: bangkok, thailand
Audio files: 2
|
Posted: Thu Mar 27, 2008 8:36 pm Post subject:
|
 |
|
I have just extracted the main model of the oscillation from the above model.
and try to test if it can play with musical frequencies.
now this model has worked well enough.
before really releasing, I decided to share the code with you all to test out.
This is from my attempt to create a sine wave oscillator without any help from chuck's basic oscillator.
this is mainly from Step (for setting constant parameters) and Gains (for sustaining / transfering of values)
| Code: | // kijjaz's mass-spring oscillator model version 0.1 testing
// note: from the original idea of Gain p=>p; Gain v=>v; v=>p; Gain a=>v; idea
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
Impulse p_kick => Gain p => Gain p_smoothness => p; // a particle stays at the same position
Impulse v_kick => Gain v => Gain v_smoothness => v; // and has a steady velocity
v => Gain v_mult => p; // a particle move with velocity
// (for musical reason)
Gain a => Gain a_mult => v; // the velocity changes with accelleration
Step m; // mass of the particle
1 => m.next;
Step resolution; // simulation resolution (default = sample rate)
second / samp => resolution.next;
samp / second => v_kick.gain;
// calculate a = -p/(m x resolution)
p => a;
m => a;
resolution => a;
a.op(4);
a.gain(-1);
// - - - test code
p => Dyno master => dac; // use p as the oscillator
master.gain(1); // set master gain and limit the output
master.limit();
master.thresh(.9);
master.ratio(10000);
1 => m.next; // reset mass to 1 as default
1.0 - 1.0/8000 => v_smoothness.gain; // decay of sound
for(int i; i < 24 + 1; i++)
{
Math.pow(Std.mtof(i), 2) => v_mult.gain; // setting actual freq by pow with 2
v_kick.next(2); // kick the velocity
.5::second => now;
} |
|
|
|
Back to top
|
|
 |
Inventor

Joined: Oct 13, 2007 Posts: 1318 Location: Florida, USA
Audio files: 50
|
Posted: Fri Mar 28, 2008 10:25 am Post subject:
|
 |
|
I don't follow what you're doing there, kij, but it sure sounds good to me! _________________ @(ºoº)@ ><}}}º> ~(^.^) <:3 )~ |
|
|
Back to top
|
|
 |
Inventor

Joined: Oct 13, 2007 Posts: 1318 Location: Florida, USA
Audio files: 50
|
Posted: Fri Mar 28, 2008 8:14 pm Post subject:
|
 |
|
Yes, I follow your code better now that I have had a chance to study it, kijjaz. It helped me to realize that I can do the same thing with a neural net. The weights are gains, and the activation functions are dyno limiters. A feedforward neural net is straightforward to construct this way and would execute quickly in ChucK. I will have to code this up... _________________ @(ºoº)@ ><}}}º> ~(^.^) <:3 )~ |
|
|
Back to top
|
|
 |
kijjaz

Joined: Sep 20, 2004 Posts: 463 Location: bangkok, thailand
Audio files: 2
|
Posted: Sun Mar 30, 2008 6:18 am Post subject:
|
 |
|
Wow thanks Inventor.
I'll try to expand the code more.
It'd become a handy experimental tool i hope.
(and so great it's CPU-efficient)
connecting this kind of unit would already produce FM and PM from sine wave already.
I still can't figure out how to make it vibrate at a specified frequency.
Who can tell me how? hahhhahha
I need to go back and read about simple harmonic and calculus from highschool -_-"
those would help me out. |
|
|
Back to top
|
|
 |
Frostburn

Joined: Dec 12, 2007 Posts: 229 Location: Finland
Audio files: 7
|
Posted: Sun Mar 30, 2008 8:44 am Post subject:
|
 |
|
Have you read the Wikipedia article ?
I think it covers most of it.
Of course when we're dealing with sampling rates some corrections need to be made on high frequencies but that depends on the implementation of the differential equation in question.
ChucK's BiQuad with a resonance is actually a model for a stiff spring with a mass and it makes that correction with sampling rates automatically. _________________ To boldly go where no man has bothered to go before. |
|
|
Back to top
|
|
 |
|