dietcv
July 8, 2023, 6:40pm
#1
hey,
i get an error message “rate” not understood when using a NamedControl with an array of buffers and NdefGui, is this a bug?
s.boot;
b = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
~arrayOfBufs = [b, b, b];
(
Ndef(\test, {
var arrayOfBufs = \arrayOfBufs.kr(Array.fill(3, 1));
PlayBuf.ar(1, arrayOfBufs[0], loop:1) * 0.2 !2}).set(\arrayOfBufs, ~arrayOfBufs).play;
)
Ndef(\test).gui; //ERROR: Message 'rate' not understood.
i have seen a similiar issue has been fixed already:
opened 12:48AM - 11 Jan 22 UTC
closed 01:20PM - 12 Jan 22 UTC
bug
Calling .gui on a Ndef with a Buffer instance as an argument produces an error.
…
This affects NdefMixer as well if you happen to click the 'ed' button.
Buffer does not implement rate. Bus and other classes in question do.
## Environment
* SuperCollider version: 3.12.2
* Operating system: macOS
## Steps to reproduce
```supercollider
s.boot;
b= Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
Ndef(\test, {|buf| PlayBuf.ar(1, buf, loop:1)*0.2!2}).set(\buf, b).play;
Ndef(\test).gui; //ERROR: Message 'rate' not understood.
```
## Expected vs. actual behavior
It should not throw an error, but instead display the buffer's bufnum.
## Proposal for fixing
```supercollider
--- a/SCClassLibrary/JITLib/ProxySpace/NodeMap.sc
+++ b/SCClassLibrary/JITLib/ProxySpace/NodeMap.sc
@@ -132,7 +132,9 @@ ProxyNodeMap : NodeMap {
controlNames {
var res = Array.new;
this.keysValuesDo { |key, value|
- var rate = if(value.rate == \audio) { \audio } { \control };
+ var rate = if(value.respondsTo(\rate) and:{
+ value.rate == \audio
+ }) { \audio } { \control };
res = res.add(ControlName(key, nil, rate, value))
};
^res
```
What version of SC are you on? I think this has been fixed if you update to the latest version
dietcv
July 11, 2023, 12:26pm
#3
hey, im on Windows with SuperCollider 3.13.0
With just one buffer like in the example its working for me but not with a NamedControl and an array of buffers.
dietcv
July 21, 2023, 8:50pm
#4
its a bug.
i have saved this as an extension, then it works:
// define rate for all objects that don't define it themselves
+Object {
rate { ^\noncontrol }
}
will open an issue on github.