Discussion:
[chuck-users] chuck 1.4.0.0, global keyword.
Dana Batali
2018-08-02 16:48:42 UTC
Permalink
Hi all - I'm not sure if this is more of a developer question, but I'll try
here first.

I'm investigating integrating ChucK into a custom app and am intrigued by
the new chunity integration. The key aspects of chunity (for my purposes)
are the new global keyword coupled with the ability to send/recv values
(and events) from a controlling application.

I have two questions:

1. does the new global keyword actually work?
In miniAudicle 1.4.0.0 (on windows), i have a one-line script:

global int myvar;

This produces an error message:

[untitled]:line(1).char(33): syntax error

which goes away with the removal of the global keyword.

1a. i do see a special branch of chuck called dac-ugen-replacement which
may be hold the answers to my question. Perhaps it's only a matter of the
windows build being a little behind (due to the grammar change)?

2. is there a github repository for the chunity plugin? I don't see it in
the standard chuck github. It's possible that the global keyword is only
activated for special builds of chuck and I might be able to get to the
bottom of that question by inspecting the chunity builds. Incidentally, I
see that ChucK Racks addressed a set of similar problems in a different
manner (by extending the chuck environment directly via PluginHost). My
impression is that these two activities occurred in parallel and that there
may be an advantage in combining the two approaches, perhaps ultimately
producing a publicly available .so/.dll as part of the chuck distribution.

Advanced thanks for any comments or pointers on these questions!
And the usual giant kudos to the ChucK devs for producing such a cool
thing!.

Regards,
Dana Batali
Jack Atherton
2018-08-02 17:06:20 UTC
Permalink
Hi!

1. It's possible that the Windows build of miniAudicle is a little behind.
I can't remember when it was built. Do things work in miniAudicle if you
use the (now-deprecated) "external" keyword instead of "global"?
1a. The dac-ugen-replacement branch holds a few extra features that are
used in Chunity but haven't been rolled into the main ChucK branch yet. You
could start building your application from either the master branch or that
branch, depending on your needs. (Check out chuck.h for a hint towards the
extra features -- it adds a few more global types.)
2. There is a github repo for Chunity but it's still private at the moment.
The place to start for developing a new application that embeds ChucK is to
make sure you have access to whatever calls you need from core/chuck.h,
built into whatever wrapper makes sense for your own application. Chunity
doesn't really do much more special than that on the C++ side, other than a
few gnarly nuances unique to Unity audio programming. I do think that the
global keyword is activated for all (new) builds of ChucK -- there are
quite a few tests for the command line version that use it. Sorry I don't
know much about ChucK Racks, maybe Spencer could chime in about that!

Best,
Jack
Post by Dana Batali
Hi all - I'm not sure if this is more of a developer question, but I'll
try here first.
I'm investigating integrating ChucK into a custom app and am intrigued by
the new chunity integration. The key aspects of chunity (for my purposes)
are the new global keyword coupled with the ability to send/recv values
(and events) from a controlling application.
1. does the new global keyword actually work?
global int myvar;
[untitled]:line(1).char(33): syntax error
which goes away with the removal of the global keyword.
1a. i do see a special branch of chuck called dac-ugen-replacement which
may be hold the answers to my question. Perhaps it's only a matter of the
windows build being a little behind (due to the grammar change)?
2. is there a github repository for the chunity plugin? I don't see it in
the standard chuck github. It's possible that the global keyword is only
activated for special builds of chuck and I might be able to get to the
bottom of that question by inspecting the chunity builds. Incidentally, I
see that ChucK Racks addressed a set of similar problems in a different
manner (by extending the chuck environment directly via PluginHost). My
impression is that these two activities occurred in parallel and that there
may be an advantage in combining the two approaches, perhaps ultimately
producing a publicly available .so/.dll as part of the chuck distribution.
Advanced thanks for any comments or pointers on these questions!
And the usual giant kudos to the ChucK devs for producing such a cool
thing!.
Regards,
Dana Batali
_______________________________________________
chuck-users mailing list
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Dana Batali
2018-08-02 22:16:33 UTC
Permalink
Hi Jack and thank you for your response!

Indeed the external keyword doesn't produce a syntax error, so that's a
sign that miniAudicle is a bit behind the times.

Regarding builds, I have been building out of the master branch and am
continuing to investigate why the global keyword is producing a syntax
error in my own mainline builds. If I replace global with external, i see
this message:

[test.ck]:line(1): 'external' keyword is deprecated. please use 'global'

So something good is happening. That said, the following .ck file, taken
Post by Jack Atherton
Hi!
1. It's possible that the Windows build of miniAudicle is a little behind.
I can't remember when it was built. Do things work in miniAudicle if you
use the (now-deprecated) "external" keyword instead of "global"?
1a. The dac-ugen-replacement branch holds a few extra features that are
used in Chunity but haven't been rolled into the main ChucK branch yet. You
could start building your application from either the master branch or that
branch, depending on your needs. (Check out chuck.h for a hint towards the
extra features -- it adds a few more global types.)
2. There is a github repo for Chunity but it's still private at the
moment. The place to start for developing a new application that embeds
ChucK is to make sure you have access to whatever calls you need from
core/chuck.h, built into whatever wrapper makes sense for your own
application. Chunity doesn't really do much more special than that on the
C++ side, other than a few gnarly nuances unique to Unity audio
programming. I do think that the global keyword is activated for all (new)
builds of ChucK -- there are quite a few tests for the command line version
that use it. Sorry I don't know much about ChucK Racks, maybe Spencer could
chime in about that!
Best,
Jack
Post by Dana Batali
Hi all - I'm not sure if this is more of a developer question, but I'll
try here first.
I'm investigating integrating ChucK into a custom app and am intrigued by
the new chunity integration. The key aspects of chunity (for my purposes)
are the new global keyword coupled with the ability to send/recv values
(and events) from a controlling application.
1. does the new global keyword actually work?
global int myvar;
[untitled]:line(1).char(33): syntax error
which goes away with the removal of the global keyword.
1a. i do see a special branch of chuck called dac-ugen-replacement which
may be hold the answers to my question. Perhaps it's only a matter of the
windows build being a little behind (due to the grammar change)?
2. is there a github repository for the chunity plugin? I don't see it
in the standard chuck github. It's possible that the global keyword is
only activated for special builds of chuck and I might be able to get to
the bottom of that question by inspecting the chunity builds.
Incidentally, I see that ChucK Racks addressed a set of similar problems in
a different manner (by extending the chuck environment directly via
PluginHost). My impression is that these two activities occurred in
parallel and that there may be an advantage in combining the two
approaches, perhaps ultimately producing a publicly available .so/.dll as
part of the chuck distribution.
Advanced thanks for any comments or pointers on these questions!
And the usual giant kudos to the ChucK devs for producing such a cool
thing!.
Regards,
Dana Batali
_______________________________________________
Post by Dana Batali
chuck-users mailing list
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________
chuck-users mailing list
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Dana Batali
2018-08-02 22:22:25 UTC
Permalink
Oops - here's the code that doesn't compile:

fun void PlayImpact( float intensity ) {
// play a collision sound...}

global Event impactHappened;
global float impactIntensity;
while( true ) {
impactHappened => now;
spork ~

Also: regarding chuck.h. I did discover the valuable methods:

setGlobalInt()
setGlobalFloat()
signalGlobalEvent()
broadcastGlobalEvent()

If I can get these to work, I'll be "on my way" (I think...).

fwiw: setGlobalString() appears to be missing...

Thanks again for your help!
Post by Dana Batali
Hi Jack and thank you for your response!
Indeed the external keyword doesn't produce a syntax error, so that's a
sign that miniAudicle is a bit behind the times.
Regarding builds, I have been building out of the master branch and am
continuing to investigate why the global keyword is producing a syntax
error in my own mainline builds. If I replace global with external, i see
[test.ck]:line(1): 'external' keyword is deprecated. please use 'global'
So something good is happening. That said, the following .ck file, taken
Post by Jack Atherton
Hi!
1. It's possible that the Windows build of miniAudicle is a little
behind. I can't remember when it was built. Do things work in miniAudicle
if you use the (now-deprecated) "external" keyword instead of "global"?
1a. The dac-ugen-replacement branch holds a few extra features that are
used in Chunity but haven't been rolled into the main ChucK branch yet. You
could start building your application from either the master branch or that
branch, depending on your needs. (Check out chuck.h for a hint towards the
extra features -- it adds a few more global types.)
2. There is a github repo for Chunity but it's still private at the
moment. The place to start for developing a new application that embeds
ChucK is to make sure you have access to whatever calls you need from
core/chuck.h, built into whatever wrapper makes sense for your own
application. Chunity doesn't really do much more special than that on the
C++ side, other than a few gnarly nuances unique to Unity audio
programming. I do think that the global keyword is activated for all (new)
builds of ChucK -- there are quite a few tests for the command line version
that use it. Sorry I don't know much about ChucK Racks, maybe Spencer could
chime in about that!
Best,
Jack
Post by Dana Batali
Hi all - I'm not sure if this is more of a developer question, but I'll
try here first.
I'm investigating integrating ChucK into a custom app and am intrigued
by the new chunity integration. The key aspects of chunity (for my
purposes) are the new global keyword coupled with the ability to send/recv
values (and events) from a controlling application.
1. does the new global keyword actually work?
global int myvar;
[untitled]:line(1).char(33): syntax error
which goes away with the removal of the global keyword.
1a. i do see a special branch of chuck called dac-ugen-replacement which
may be hold the answers to my question. Perhaps it's only a matter of the
windows build being a little behind (due to the grammar change)?
2. is there a github repository for the chunity plugin? I don't see it
in the standard chuck github. It's possible that the global keyword is
only activated for special builds of chuck and I might be able to get to
the bottom of that question by inspecting the chunity builds.
Incidentally, I see that ChucK Racks addressed a set of similar problems in
a different manner (by extending the chuck environment directly via
PluginHost). My impression is that these two activities occurred in
parallel and that there may be an advantage in combining the two
approaches, perhaps ultimately producing a publicly available .so/.dll as
part of the chuck distribution.
Advanced thanks for any comments or pointers on these questions!
And the usual giant kudos to the ChucK devs for producing such a cool
thing!.
Regards,
Dana Batali
_______________________________________________
Post by Dana Batali
chuck-users mailing list
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________
chuck-users mailing list
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Jack Atherton
2018-08-02 22:39:46 UTC
Permalink
Hi!

1. If you grab chuck_win32.c and chuck_win32.h off the dac-ugen-replacement
branch and rebuild, then can you successfully parse scripts with the
"global" keyword? It looks like those never got regenerated on the main
branch after the introduction of "global". If you grab those two from
dac-ugen-replacement and it starts working on your machine, then I'll be
sure to forward that fix onto the main branch.
2. setGlobalString and many others are only present on the
dac-ugen-replacement branch. If you need to work with global strings,
you'll need to be operating from the dac-ugen-replacement branch for now!
The master branch only contains basic accessors for global ints, floats,
and Events.

Best,
Jack
Post by Dana Batali
fun void PlayImpact( float intensity ) {
// play a collision sound...}
global Event impactHappened;
global float impactIntensity;
while( true ) {
impactHappened => now;
spork ~
setGlobalInt()
setGlobalFloat()
signalGlobalEvent()
broadcastGlobalEvent()
If I can get these to work, I'll be "on my way" (I think...).
fwiw: setGlobalString() appears to be missing...
Thanks again for your help!
Post by Dana Batali
Hi Jack and thank you for your response!
Indeed the external keyword doesn't produce a syntax error, so that's a
sign that miniAudicle is a bit behind the times.
Regarding builds, I have been building out of the master branch and am
continuing to investigate why the global keyword is producing a syntax
error in my own mainline builds. If I replace global with external, i see
[test.ck]:line(1): 'external' keyword is deprecated. please use 'global'
So something good is happening. That said, the following .ck file, taken
Post by Jack Atherton
Hi!
1. It's possible that the Windows build of miniAudicle is a little
behind. I can't remember when it was built. Do things work in miniAudicle
if you use the (now-deprecated) "external" keyword instead of "global"?
1a. The dac-ugen-replacement branch holds a few extra features that are
used in Chunity but haven't been rolled into the main ChucK branch yet. You
could start building your application from either the master branch or that
branch, depending on your needs. (Check out chuck.h for a hint towards the
extra features -- it adds a few more global types.)
2. There is a github repo for Chunity but it's still private at the
moment. The place to start for developing a new application that embeds
ChucK is to make sure you have access to whatever calls you need from
core/chuck.h, built into whatever wrapper makes sense for your own
application. Chunity doesn't really do much more special than that on the
C++ side, other than a few gnarly nuances unique to Unity audio
programming. I do think that the global keyword is activated for all (new)
builds of ChucK -- there are quite a few tests for the command line version
that use it. Sorry I don't know much about ChucK Racks, maybe Spencer could
chime in about that!
Best,
Jack
Post by Dana Batali
Hi all - I'm not sure if this is more of a developer question, but I'll
try here first.
I'm investigating integrating ChucK into a custom app and am intrigued
by the new chunity integration. The key aspects of chunity (for my
purposes) are the new global keyword coupled with the ability to send/recv
values (and events) from a controlling application.
1. does the new global keyword actually work?
global int myvar;
[untitled]:line(1).char(33): syntax error
which goes away with the removal of the global keyword.
1a. i do see a special branch of chuck called dac-ugen-replacement
which may be hold the answers to my question. Perhaps it's only a matter
of the windows build being a little behind (due to the grammar change)?
2. is there a github repository for the chunity plugin? I don't see it
in the standard chuck github. It's possible that the global keyword is
only activated for special builds of chuck and I might be able to get to
the bottom of that question by inspecting the chunity builds.
Incidentally, I see that ChucK Racks addressed a set of similar problems in
a different manner (by extending the chuck environment directly via
PluginHost). My impression is that these two activities occurred in
parallel and that there may be an advantage in combining the two
approaches, perhaps ultimately producing a publicly available .so/.dll as
part of the chuck distribution.
Advanced thanks for any comments or pointers on these questions!
And the usual giant kudos to the ChucK devs for producing such a cool
thing!.
Regards,
Dana Batali
_______________________________________________
Post by Dana Batali
chuck-users mailing list
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________
chuck-users mailing list
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________
chuck-users mailing list
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Dana Batali
2018-08-02 23:02:07 UTC
Permalink
Jack, Bingo!

chuck_win32.c from the dac-ugen-replacement branch, makes the global
keyword appear to work. I was in the process of figuring out the bison +
lex invocation for windows, but the shortcut you provided is way easier.

I will likely jump over to this branch after I validate the basic
functionality in the main branch.

Thanks!
Dana
Post by Jack Atherton
Hi!
1. If you grab chuck_win32.c and chuck_win32.h off the
dac-ugen-replacement branch and rebuild, then can you successfully parse
scripts with the "global" keyword? It looks like those never got
regenerated on the main branch after the introduction of "global". If you
grab those two from dac-ugen-replacement and it starts working on your
machine, then I'll be sure to forward that fix onto the main branch.
2. setGlobalString and many others are only present on the
dac-ugen-replacement branch. If you need to work with global strings,
you'll need to be operating from the dac-ugen-replacement branch for now!
The master branch only contains basic accessors for global ints, floats,
and Events.
Best,
Jack
Post by Dana Batali
fun void PlayImpact( float intensity ) {
// play a collision sound...}
global Event impactHappened;
global float impactIntensity;
while( true ) {
impactHappened => now;
spork ~
setGlobalInt()
setGlobalFloat()
signalGlobalEvent()
broadcastGlobalEvent()
If I can get these to work, I'll be "on my way" (I think...).
fwiw: setGlobalString() appears to be missing...
Thanks again for your help!
Post by Dana Batali
Hi Jack and thank you for your response!
Indeed the external keyword doesn't produce a syntax error, so that's a
sign that miniAudicle is a bit behind the times.
Regarding builds, I have been building out of the master branch and am
continuing to investigate why the global keyword is producing a syntax
error in my own mainline builds. If I replace global with external, i see
[test.ck]:line(1): 'external' keyword is deprecated. please use 'global'
So something good is happening. That said, the following .ck file,
Post by Jack Atherton
Hi!
1. It's possible that the Windows build of miniAudicle is a little
behind. I can't remember when it was built. Do things work in miniAudicle
if you use the (now-deprecated) "external" keyword instead of "global"?
1a. The dac-ugen-replacement branch holds a few extra features that are
used in Chunity but haven't been rolled into the main ChucK branch yet. You
could start building your application from either the master branch or that
branch, depending on your needs. (Check out chuck.h for a hint towards the
extra features -- it adds a few more global types.)
2. There is a github repo for Chunity but it's still private at the
moment. The place to start for developing a new application that embeds
ChucK is to make sure you have access to whatever calls you need from
core/chuck.h, built into whatever wrapper makes sense for your own
application. Chunity doesn't really do much more special than that on the
C++ side, other than a few gnarly nuances unique to Unity audio
programming. I do think that the global keyword is activated for all (new)
builds of ChucK -- there are quite a few tests for the command line version
that use it. Sorry I don't know much about ChucK Racks, maybe Spencer could
chime in about that!
Best,
Jack
Post by Dana Batali
Hi all - I'm not sure if this is more of a developer question, but
I'll try here first.
I'm investigating integrating ChucK into a custom app and am intrigued
by the new chunity integration. The key aspects of chunity (for my
purposes) are the new global keyword coupled with the ability to send/recv
values (and events) from a controlling application.
1. does the new global keyword actually work?
global int myvar;
[untitled]:line(1).char(33): syntax error
which goes away with the removal of the global keyword.
1a. i do see a special branch of chuck called dac-ugen-replacement
which may be hold the answers to my question. Perhaps it's only a matter
of the windows build being a little behind (due to the grammar change)?
2. is there a github repository for the chunity plugin? I don't see
it in the standard chuck github. It's possible that the global keyword is
only activated for special builds of chuck and I might be able to get to
the bottom of that question by inspecting the chunity builds.
Incidentally, I see that ChucK Racks addressed a set of similar problems in
a different manner (by extending the chuck environment directly via
PluginHost). My impression is that these two activities occurred in
parallel and that there may be an advantage in combining the two
approaches, perhaps ultimately producing a publicly available .so/.dll as
part of the chuck distribution.
Advanced thanks for any comments or pointers on these questions!
And the usual giant kudos to the ChucK devs for producing such a cool
thing!.
Regards,
Dana Batali
_______________________________________________
Post by Dana Batali
chuck-users mailing list
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________
chuck-users mailing list
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________
chuck-users mailing list
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________
chuck-users mailing list
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Loading...