Comments (3)
I tried to recreate your example in miniAudicle and got a similar message. I believe static Bus @ bus[6]
should instead be static Bus @ bus[]
. Including the [6] means that the bus
object will be instantiated rather than just being a null reference (or pointing to the already declared static reference).
// Test
class Mixer {
0.5 => float volume;
}
class Channel {
static Mixer @ mix[]; // reference, [] vs [2]
}
Mixer mainMix;
Mixer mix2;
new Channel @=> Channel c1;
[mainMix, mix2] @=> c1.mix; // initialization outside of class
<<< "c1 mix", c1.mix >>>;
new Channel @=> Channel c2;
<<< "c2 mix", c2.mix >>>;
I got the same result in WebChucK IDE. Let me know if that helps!
from webchuck.
Sorry, I should have posted my original code here, https://github.com/lmaxwell/guiless-daw/blob/main/lib/mixer/Mixer.ck . The original code works ok with version 1.3.6.0.
I started from your example and tried the newest version of ChucK(1.4.2.0) , it did throw the same error if specifying a number for a static array inside class definition, while ChucK(1.3.6.0) did not throw any error. However, in 1.3.6.0 (if a number is given in class definition) Channel.mix(accessing from class name) points to the same instance, while c1.mix and c2.mix(accessing from instance) point to different instances. It seems a bug and 1.4.2 sovles this.
The following code works fine in both chuck(1.4.2.0) and webchuck IDE.
//a.ck
class Mixer {
0.5 => float volume;
}
public class Channel {
static Mixer @ mix[]; // reference, [] vs [2]
}
Mixer mainMix;
Mixer mix2;
[mainMix, mix2] @=> Channel.mix; // initialization outside of class
new Channel @=> Channel c1;
<<< "a.ck:Channel.mix", Channel.mix >>>;
<<<"a.ck:c1.mix", c1.mix>>>;
//b.ck
new Channel @=> Channel c2;
<<<"b.ck:Channel.mix",Channel.mix>>>;
<<<"b.ck:c2.mix",c2.mix>>>;
Thank you for your help!
from webchuck.
No problem! Glad to see it working!
from webchuck.
Related Issues (13)
- chugin support HOT 5
- API documentation HOT 1
- make a dedicated API documentation page HOT 1
- Investigate webchuck playback on mobile HOT 1
- Loading webchuck doens't work over http HOT 1
- webchuck ACE syntax highlight HOT 4
- Weird issue when running `npm run test` HOT 1
- HID support HOT 1
- Web MIDI Support
- WebChuGL support HOT 2
- Math.randomize() inconsistent behavior HOT 1
- Multichannel support does not work. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webchuck.