<div>Hello All.<br>My name is Edward. I'm a synthesis buff from Melbourne.<br>I've been using Chuck for about a week now, and I'm really loving it. I haven't really learnt to use a sporking language before. I used to program in Borland Turbo C
2.0 back in the early 90s, and also did a lot of QuickBasic, but, I never really caught up to the modern age so to speak. I'm only 29, so I thought, there's no time to learn like now! I think I've got this all sporked off in a reasonably sensible way, but, I could probably do more. I am totally open to people sending me suggestions (on or off list). I'm not "precious" about my program in any way.
</div>
<div> </div>
<div> I hope some of you get some use from this example. I don't think it is by any means "distro example" quality, but, I hope that with some work, and the addition of some more features not present in examples currently in distro, that one day it might be!
</div>
<div> </div>
<div> I have tried looking around for a model for sympathetic strings, and have had no luck. If anyone has any advice, please advise.</div>
<div> </div>
<div>best wishes to all;</div>
<div>-Edward r Jones<br> </div>
<div> </div>
<div>// <a href="http://Tambura-with-sporking.ck">Tambura-with-sporking.ck</a></div>
<div>//<br>// Tambura with Sporking<br>//<br>// by Edward r Jones (<a href="mailto:loscha@gmail.com">loscha@gmail.com</a>)<br>//<br>// This is my emulation of an electronic tambura device.<br>// By Tambura, I mean the Indian classical instrument.
<br>// A Tambura has 4 to 6 strings, which are plucked in a repeating pattern to accompany Indian classical music<br>// It has a resonating cavity, and resonant sympathetic strings, like a Sitar, but, no frets.<br>// Please Help! This Model Needs!
<br>//<br>// = Sympathetic Strings. I've tried setting up a series of 8 delay lines <br>// tuned to the resonant frequencies I desire), but, they didn't give me the results I wanted at all.<br>// I am new to coding Physical Modelling, and if anyone has some advice on this matter I'd love to hear from you.
<br>//<br>// A Resonant Cavity.<br>// I've goen with using LPF and HPF to limit the output frequency range to give the sort of timbre I want, but,<br>// I know that this could be better acheived.<br>//<br>// At the moment, it sounds more like a Koto.
<br>// I found the stk Sitar instrument to sound nothing like a Sitar or a Tambura,<br>// Buuut, this is because of the reasons I listed above -- Sympathetic Strings & real Resonant Cavity.<br>//<br>// In closing, I want to thank:
<br>// The ChucK community, I love this language (and you all!) so much,<br>// and I hope to be able to contribute to it's development in the future<br>// My wonderful partner, Michelle, who doesn't mind me staying up until 3am working on this stuff!
<br>// All my local friends in synthesis; Bill Harrison aka James Earthenware, Paul Perry, Robin Whittle & Jaymz<br>// \=> Clae, All the Melbourne Dorkbot community, and all the other hardcore synthesists in Melbourne, Victoria, Australia!
<br>// All my online friends, Matrixsynth, Sealed, SynthDiy and all my LiveJournal Buddies.<br>// The Founding Fathers of this craft that I love so much. John Chowning, Max V Matthews, Steve Reich, Paul Lansky & Stockhausen,
<br>//<br>// Enuff! On to the Code!<br><br><br><br>[ 1, 0, 0, 1, 1, 0] @=> int beats[]; // 1 means play, 0 means skip<br>[ 00, 00, 00, 12, 09, 04] @=> int notes[]; // Note pitch, relative to noteoffset<br>30 => int noteoffset; // this is the transpose, to make scales easier
<br>float variance[beats.cap()]; // this is for randomization of string pitches to achieve "thickness"<br> // They are calculated once at startup, to simulate real string tuning
<br>.05 => float waver; // range for variance in NOTES<br>72 => float tempo;<br><br>float click;<br>30000 / tempo => click;<br><<<"Click length", click,"">>>;
<br>int numsteps;<br>beats.cap() => numsteps;<br>LPF lpf;<br>HPF hpf;<br>JCRev jcrev;<br><br>2550 => lpf.freq;<br>300 => hpf.freq;<br>.05 => jcrev.mix;<br><br>StifKarp tambura[numsteps];<br>lpf => hpf => jcrev => dac;
<br><br> //------- Hook up all tamburas to the chain & set them up the way we want them.<br> <br> // .pickupPosition - ( float , READ/WRITE ) - pickup position [0.0 - 1.0]<br> // .sustain - ( float , READ/WRITE ) - string sustain [
0.0 - 1.0]<br> // .stretch - ( float , READ/WRITE ) - string stretch [0.0 - 1.0]<br> // .pluck - ( float , WRITE only ) - pluck string [0.0 - 1.0]<br> // .baseLoopGain - ( float , READ/WRITE ) - ?? [
0.0 - 1.0]<br> // .clear - ( ) - reset instrument<br> for (0 => int stab; stab < numsteps; stab++)<br> {<br> tambura[stab] => lpf;<br> .03 => tambura[stab].pickupPosition;
<br> 1 => tambura[stab].sustain;<br> 1 => tambura[stab].stretch;<br> .99 => tambura[stab].baseLoopGain;<br> Std.rand2f(1-waver, waver) => variance[stab];<br> <<<"tambura #",stab,"hooked up","">>>;
<br> }<br> //------ Hookups done.<br><br><br><<<"pre-comparison","">>>;<br>if (beats.cap() == notes.cap())<br> {<br> <br> <br> <<<"Steps in our sequence", numsteps,"">>>;
<br> <br> //------------------------------------ The Sequence Plays! ----------------------<br> while (true)<br> {<br> for (0 => int stab; stab < numsteps; stab++)<br> {
<br> if (beats[stab] == 1)<br> {<br> <<<"Stab",stab,"">>>;<br> tampluck (stab);<br>
<br> }<br> click * 1::ms => now;<br> }<br> }<br> //------------------------------------ The Sequence (never) Ends! ----------------------
<br><br> <<<"End of Playing!","">>>;<br> }<br>//------------------------------------------------------------------------<br>// Error, stop the program<br>else<br> {<br> <<<"ERROR IN SEQUENCER DATA", "";>>>;
</div>
<div> <<<"Item count mismatch","">>>;<br> }<br> <br>//-------------------------------------------------------------------------<br>// This is the sporkage for our note playing.
<br>fun void tampluck (int step)<br>{<br> float npitch;<br> variance[step] + noteoffset + notes[step] => Std.mtof => npitch;<br> npitch => tambura[step].freq;<br> <<<"Pitch",npitch,"">>>;
<br> 1 => tambura[step].pluck; <br>}<br><br>-- <br><a href="http://www.loscha.com/chuck">www.loscha.com/chuck</a><br> </div>