Author |
Message |
Frostburn
Joined: Dec 12, 2007 Posts: 255 Location: Finland
Audio files: 9
|
|
Back to top
|
|
|
Kassen
Janitor
Joined: Jul 06, 2004 Posts: 7678 Location: The Hague, NL
G2 patch files: 3
|
Posted: Thu Feb 21, 2008 11:53 am Post subject:
|
|
|
Wow, a real treasure-trove!
Thanks for sharing this. _________________ Kassen |
|
Back to top
|
|
|
kijjaz
Joined: Sep 20, 2004 Posts: 765 Location: bangkok, thailand
Audio files: 4
|
Posted: Thu Feb 21, 2008 10:59 pm Post subject:
|
|
|
arg!! this is a huge compilation of many useful tools.
Hmm I still haven't checked out all the codes
But I stopped and look at the Clipper that use a GEN as a transfer-function..
I've got another candidate I haven't done before but simple enough.
The Idea is that, I'd try to limit a signal in the range [-1, 1] by using HalfRect, by this method:
take the input, add with 1, HalfRect, multiply with -1, add with 2, HalfRect, multiply with -1, add with 1: done
If we imagine a linear input, it'd clip the signal definitely..
input => Gain AddOne => HalfRect rect1 => Gain AddTwo => HalfRect rect2 => output;
// and set gain to do the multiplication
-1.0 => rect1.gain => rect2.gain;
// add to AddOne and AddTwo
Step One => AddOne;
One => output;
Step Two => AddTwo;
1.0 => One.next;
2.0 => Two.next;
I still haven't tried in code, but I think it'd work well, because it looks simple and straightforward to me heheh ^_^"
- - -
(edited: last time, i forgot to add 1 to the result thus making the result 1.0 too low all the time) Last edited by kijjaz on Fri Feb 22, 2008 4:23 am; edited 1 time in total |
|
Back to top
|
|
|
Frostburn
Joined: Dec 12, 2007 Posts: 255 Location: Finland
Audio files: 9
|
Posted: Fri Feb 22, 2008 3:11 am Post subject:
|
|
|
Well that was a short maintenance break. I just walked in to the place and they luckily had a spare fan around. Five minutes later I got lappy back well and healthy.
EDIT: Oh you're right Kijjaz! I had the same idea but didn't write it down. It had already escaped me when I wrote the Clipper. Thanks for the heads up!
I'll start putting these classes in to their own files and then make a mother file to machine.add("them all"). It was easier to work with a single file in miniAudicle but now it has grown too big. _________________ To boldly go where no man has bothered to go before. |
|
Back to top
|
|
|
Frostburn
Joined: Dec 12, 2007 Posts: 255 Location: Finland
Audio files: 9
|
|
Back to top
|
|
|
Frostburn
Joined: Dec 12, 2007 Posts: 255 Location: Finland
Audio files: 9
|
Posted: Thu Mar 13, 2008 10:08 am Post subject:
|
|
|
Sigh... I just realized that my approach to the Instruments is running face first to the lack of ChucKian garbage collection... I'm happily sporking shreds with loads of stuff and just letting the shred exit after a note off.
Converting everything to a recycling format will be a hassle as most of the filters I'm using are IIR and clearing delay buffers by sucking out all the samples isn't too fun...
Maybe I'll just keep things the way they are, hope for the glorious garbage collection to arrive one bright day and render my songs in pieces in the meanwhile. _________________ To boldly go where no man has bothered to go before. |
|
Back to top
|
|
|
Inventor
Stream Operator
Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 267
|
Posted: Thu Mar 13, 2008 3:21 pm Post subject:
|
|
|
Well, Frostburn, you seem to have a high level of quality and perhaps a hint of perfectionism in your code, so I'm not surprised you're pushing ChucK's limits. I have done the same thing by writing bloatware! Guitar Lab uses up most of my CPU even at idle, and when recording a four-instrument song ChucK gives periodic warnings about CPU limits. But the recordings turn out just fine due to that ChucKian "strongly timed" feature I guess. |
|
Back to top
|
|
|
Frostburn
Joined: Dec 12, 2007 Posts: 255 Location: Finland
Audio files: 9
|
|
Back to top
|
|
|
Inventor
Stream Operator
Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 267
|
Posted: Sat Mar 15, 2008 7:18 pm Post subject:
|
|
|
Nice Frostburn, that seems to be a very structured and organized library, and quite extensive as well. Bummer though when I tried the example files they wouldn't run. I got the following error:
[melody.ck]:line(37): undefined type 'FastAdditive'...
[melody.ck]:line(37): ... in declaration ...
I tried going up to the folder level and running mother.ck frostburn / examples / melody.ck but it did not work. How do I source your libraries and then run your examples? |
|
Back to top
|
|
|
Frostburn
Joined: Dec 12, 2007 Posts: 255 Location: Finland
Audio files: 9
|
Posted: Sun Mar 16, 2008 12:49 am Post subject:
|
|
|
Inventor wrote: | Nice Frostburn, that seems to be a very structured and organized library, and quite extensive as well. Bummer though when I tried the example files they wouldn't run. I got the following error:
[melody.ck]:line(37): undefined type 'FastAdditive'...
[melody.ck]:line(37): ... in declaration ...
I tried going up to the folder level and running mother.ck frostburn / examples / melody.ck but it did not work. How do I source your libraries and then run your examples? |
You need to somehow run the "frostburn/library.ck" before you can run anything else. It does a machine.add for every file in the "frostburn" folder.
The files "demo.ck" and "mother.ck" do this by machine.adding the library, yielding and then adding the "melody.ck" or any other file depending on the public classes:
Code: | "frostburn/library.ck" => Machine.add;
me.yield();
"frostburn/examples/melody.ck" => Machine.add; |
There are two ways this can still go wrong:
-You nee be on the folder where the "frostburn" folder is, not in the "frostburn" folder.
-Your system needs to use the slash "/" instead of the backslash "\" to determine the folder structure.
I don't know how mac handles these things but you can try modifying the "mother.ck" and "library.ck" to point to the right folders.
Modify the line:
Code: | "frostburn/" => string path; |
in "library.ck".
Let me know how it goes so I can write a readme.txt for the next release. _________________ To boldly go where no man has bothered to go before. |
|
Back to top
|
|
|
Inventor
Stream Operator
Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 267
|
Posted: Sun Mar 16, 2008 1:56 am Post subject:
|
|
|
I don't know what it is, i tried both in the frostburn folder and standing on top of it, same error message. Mac uses a forward slash. I issue the comand:
chuck frostburn/library.ck frostburn/examples/melody.ck
and get the same error. Maybe the library needs to be loaded prior to the melody.ck file somehow? |
|
Back to top
|
|
|
Frostburn
Joined: Dec 12, 2007 Posts: 255 Location: Finland
Audio files: 9
|
Posted: Sun Mar 16, 2008 3:26 am Post subject:
|
|
|
Inventor wrote: | chuck frostburn/library.ck frostburn/examples/melody.ck |
That won't work.
You need to call me.yield() after adding "library.ck" and chuck doesn't do that automatically.
The best way is to work with "mother" files that do the yielding.
You can also try the following:
chuck --loop &
chuck + frostburn/library.ck
chuck + frostburn/examples/melody.ck
chuck --kill
That way library.ck gets added and chuck yields because it advances time in the loop.
Did you try "chuck demo.ck" ?
What does that output? _________________ To boldly go where no man has bothered to go before. |
|
Back to top
|
|
|
Inventor
Stream Operator
Joined: Oct 13, 2007 Posts: 6221 Location: near Austin, Tx, USA
Audio files: 267
|
Posted: Sun Mar 16, 2008 5:55 am Post subject:
|
|
|
OK, I got it to work by editing the mother.ck file. One thing confuses me. Normally to use a library you have some snippet of code at the beginning of your source code that reads in that libray, such as:
#include library.ck
But here we are using this "mother.ck" file which seems to be a more complicated solution. I have to edit that file every time I want to run an example.
Is it possible to put the statement that calls the library in the example ChucK file? That would be more conventional, if I understand it correctly.
Thanks, this is cool, I didn't know we could have library files in ChucK. |
|
Back to top
|
|
|
Frostburn
Joined: Dec 12, 2007 Posts: 255 Location: Finland
Audio files: 9
|
Posted: Sun Mar 16, 2008 6:31 am Post subject:
|
|
|
I banged my head on this one. The mother-file solution was the only one I could get to work.
Code: | chuck library.ck myfile.ck |
Doesn't work because ChucK checks the syntax of both files before loading anything.
Code: | Machine.add("public.ck");
me.yield();
PublicClass pc; |
Doesn't work for the same reason. Syntax is checked before "public.ck" gets added.
So either you're using "chuck --loop" or mother files.
I wish chuck could have include files... Things would be so much easier. _________________ To boldly go where no man has bothered to go before. |
|
Back to top
|
|
|
Sweet Pablo
Joined: Nov 15, 2007 Posts: 3 Location: Illinois, US
|
Posted: Sun Mar 16, 2008 9:57 pm Post subject:
Include Files |
|
|
Quote: | I wish chuck could have include files... Things would be so much easier. |
Forgive me if this is off-topic, but it is possible to include files with #include rather than Machine.add by taking advantage of the C preprocessor (cpp) and using a shell script. The following bash script works for me.
Code: |
for f in $@; do
files="$files /tmp/chuck.$f.$$"
cpp -P $f > /tmp/chuck.$f.$$
done
chuck $files
rm -f $files
|
I suppose the disadvantage is that it will make your chuck files harder to share. |
|
Back to top
|
|
|
|