DBraun / ChucKDesigner

ChucK audio integration with TouchDesigner
Other
38 stars 0 forks source link

Newbie experience #17

Closed Santiquesada closed 6 months ago

Santiquesada commented 6 months ago

Hello. Iam new in this world of Chuckdesigner, i am trying to learn. I am really good at Chuck, but I have not been able to run Chuckdesigner. My project just has one object and i am trying to add code on it. When i click on add code, or any other from the menu. it immediately crashes TD. See below images ChuckObject Chuck error

DBraun commented 6 months ago

Thanks. You've found a bug in which if the "Code" parameter is blank but you press "Add ChucK Code" then TouchDesigner crashes. I'll fix this in the next release. In the meantime, can you try specifying a DAT for the Code parameter? Watch the ChucKDesigner YouTube videos too if you haven't already.

Santiquesada commented 6 months ago

Great, now it is not crashing, but it is not producing any sound. is there any setup i am not doing?¿

Screenshot 2024-02-17 210238

DBraun commented 6 months ago

Great. I've made a new release with the bug fix: https://github.com/DBraun/ChucKDesigner/releases

To hear the audio in TouchDesigner you'll have to connect the ChucK Audio CHOP to an Audio Device Out CHOP. Try just a sine tone:

// This constructor syntax is newly available in ChucK/ChucKDesigner!
SinOsc s(440) => dac;
while (true) {
    10::ms => now;
}
Santiquesada commented 6 months ago

Great it is working perfectly. Two final questions, and sorry if are very basic information, but anyways I think it will be very useful for new users in TD 1) in your videos you can see the messages in the console. how you make it? i also see that you run kind of a "perform mode", dont know how to make it.

my perform Mode is totally black, a completely different interface than yours in the video

2)what about those chuck files that need other chuck files that contain public classes or functions to run? how do you connect them. Lets suppose I have a ck code called Rock, but it needs the public class BPM that is in another file and needs to be running before i run Rock.ck

Perform mode black screen

DBraun commented 6 months ago
me.dir() + "stk_rhodey.ck" => string filepath;
<<< "Adding shred: " + filepath >>>;
Machine.add(filepath);
// our main loop
while( true )
{ 
    100::ms => now;
}

There are some edge cases when it comes to "importing" classes, but I think the core ChucK team is making or has already made some progress on this. Since I think it's outside the scope of TouchDesigner you may want to refer to more recent ChucK resources.

Santiquesada commented 6 months ago

Hello. Thanks for your reply. Sorry, Probably i did not explain myself very well. I understand the "importing classes" in Chuck, But i have been struggling in TD, cos of the different elements. You taught me that if " To hear the audio in TouchDesigner you'll have to connect the ChucK Audio CHOP to an [Audio Device Out CHOP" and It worked perfectly. My question is about those Chuck codes that dont have an audio output, like classes or functions. At what element should I connect them to run?

DBraun commented 6 months ago

Sorry I still don't fully understand. You should think of a single ChucK Audio CHOP as a single version of miniAudicle. It's ok to add multiple shreds to the same ChucK Audio, and one shred can automatically add others via Machine.add(...).

In the past I've borrowed from this example: https://github.com/ccrma/chuck/blob/main/examples/book/digital-artists/chapter9/initialize.ck

You only need to add the initialize.ck shred. Inside it allows UseBPM.ck to refer to a BPM class.

Santiquesada commented 6 months ago

Now I uderstood. I did not know each object was a single versión of miniAudicle. It Will work perfectly. Thanks for all your support