Author |
Message |
minuskelvin
Joined: Jul 03, 2015 Posts: 5 Location: seattle
|
Posted: Fri Jul 03, 2015 11:07 pm Post subject:
Crash when initing a ugen to null |
|
|
Hey guys, I'm new to learning ChucK (about a week or so of digging in) so I'm not sure if this is even a thing, but I'm assuming crashing the miniaudicle with one line consistently is a "bug".
Here's the 1 liner:
Code: | null => SinOsc foo; |
Also crashes is you null-init a Chubgraph.
Code: | class Foo extends Chubgraph {}
null => Foo foo; |
I discovered this because I wanted to have a class wrap a UGen but have that UGen created outside the class. I didn't want to instantiate 2 UGens when I only wanted one.
Code: | class Wrapper
{
// null this guy...
null => MyChubgraph foo;
// set it from outside
fun void SetObj(MyChubgraph inFoo)
{
inFoo @=> foo;
}
} |
I was led to believe that null-initing a UGen was cool cause I was doing it with other non-UGen type objects. For example, this doesn't crash:
Code: | class MyClass {
<<< "inside pre-init " >>>;
}
null => MyClass foo;
if (foo == null) { <<< "It is null." >>>; } |
Also, I'm not really sure if null-initing an object really saves me anything or if it really matters. For what it's worth, that pre-init print *doesn't* occur if you null-init an object, so I'm guessing it saves me something.
Since it was so easy and consistent to crash, I assumed it was a known issue, but google lead me to believe it wasn't. Or I have no idea how to google this crash.
EDIT: I'm running ChucK on Windows 8 with ChucK version 1.3.5.0 (chimera). |
|
Back to top
|
|
|
Antimon
Joined: Jan 18, 2005 Posts: 4145 Location: Sweden
Audio files: 371
G2 patch files: 100
|
Posted: Sun Jul 05, 2015 10:58 pm Post subject:
|
|
|
In what way does it crash - does the miniaudicle program shut down or do you just get an error text somewhere?
Anyway, you can use @ do declare stuff as references rather than instances. This ought to work:
Code: | null @=> SinOsc @ foo;
|
_________________ Antimon's Window
@soundcloud @Flattr home - you can't explain music |
|
Back to top
|
|
|
minuskelvin
Joined: Jul 03, 2015 Posts: 5 Location: seattle
|
Posted: Tue Jul 07, 2015 11:45 am Post subject:
|
|
|
Antimon wrote: | In what way does it crash - does the miniaudicle program shut down or do you just get an error text somewhere?
Anyway, you can use @ do declare stuff as references rather than instances. This ought to work:
Code: | null @=> SinOsc @ foo;
|
|
It crashes. Asks if I want to attach a debugger. No other text. It's a straight-up crash. Try it... should crash for you pretty easily. If it's not allowed or is invalid syntax it shouldn't compile or it should put the ugen in a bad state (and log error messages).
Anyway, didn't know about declaring things as ref like that! That will definitely work for me.
Thanks. |
|
Back to top
|
|
|
Antimon
Joined: Jan 18, 2005 Posts: 4145 Location: Sweden
Audio files: 371
G2 patch files: 100
|
Posted: Tue Jul 07, 2015 1:14 pm Post subject:
|
|
|
I must confess I don't use the miniAudicle, I'm a command line guy. I agree that stuff shouldn't crash. Anyway, hope the @ stuff works! _________________ Antimon's Window
@soundcloud @Flattr home - you can't explain music |
|
Back to top
|
|
|
minuskelvin
Joined: Jul 03, 2015 Posts: 5 Location: seattle
|
Posted: Tue Jul 07, 2015 2:38 pm Post subject:
|
|
|
Antimon wrote: | I must confess I don't use the miniAudicle, I'm a command line guy. I agree that stuff shouldn't crash. Anyway, hope the @ stuff works! |
So, I'm new to ChucK and am super outgrowing miniAudicle -- since it doesn't do debugging anyway, I'm thinking it'd be way better to do this stuff using a more robust text editor (of course!). What's your typical workflow if you don't use miniAudicle? What editor do you use? |
|
Back to top
|
|
|
Antimon
Joined: Jan 18, 2005 Posts: 4145 Location: Sweden
Audio files: 371
G2 patch files: 100
|
Posted: Wed Jul 08, 2015 6:37 am Post subject:
|
|
|
minuskelvin wrote: | Antimon wrote: | I must confess I don't use the miniAudicle, I'm a command line guy. I agree that stuff shouldn't crash. Anyway, hope the @ stuff works! |
So, I'm new to ChucK and am super outgrowing miniAudicle -- since it doesn't do debugging anyway, I'm thinking it'd be way better to do this stuff using a more robust text editor (of course!). What's your typical workflow if you don't use miniAudicle? What editor do you use? |
I've tried a couple of editors, but recently I found a ChucK mode for Sublime Text, which is a popular editor for coders. I keep a terminal next to it for running chuck - very probably there's a way to run it inside Sublime (or other editors where there are ChucK modes, like emacs), but as I said I like terminals.
Sublime isn't the cheapest editor around though - I used a ChucK mode in jEdit for a while I think, that worked ok. Before I wanted syntax highlighting I just went with any editor really - I still tend to use vi for doing quick tests, when I don't feel like waiting for a bigger text editor to start up. _________________ Antimon's Window
@soundcloud @Flattr home - you can't explain music |
|
Back to top
|
|
|
minuskelvin
Joined: Jul 03, 2015 Posts: 5 Location: seattle
|
Posted: Thu Jul 09, 2015 4:27 pm Post subject:
|
|
|
Excellent -- I use Sublime Text all the time. I should have checked if there was a ChucK syntax highlighting mode.
I'll miss the audicle niceties i guess, but you can't beat being able to find and replace.
Thanks for the advice. |
|
Back to top
|
|
|
Antimon
Joined: Jan 18, 2005 Posts: 4145 Location: Sweden
Audio files: 371
G2 patch files: 100
|
Posted: Thu Jul 09, 2015 10:49 pm Post subject:
|
|
|
Perfect - you've got the best alternative just around the corner then! _________________ Antimon's Window
@soundcloud @Flattr home - you can't explain music |
|
Back to top
|
|
|
|