Dear users and developers,
I have found three strange behaviours of the buffer instance created using the class method “.cueSoundFile”.
[1] “.plot” terminates preloading a sound file for streaming using the class DiskIn:
b = Buffer.cueSoundFile(s, Platform.resourceDir +/+ "sounds/a11wlk01-44_1.aiff", 0, 1);
b.plot;
{ DiskIn.ar(1, b.bufnum) }.play
[2] The sound file path is not added to the client-side buffer information being created using the class method “.cueSoundFile” while the new sound file path is added to the client-side buffer information updated using the instance method “.cueSoundFile”::
c = Buffer.cueSoundFile(s, Platform.resourceDir +/+ "sounds/a11wlk01-44_1.aiff", 0, 1)
c.path // -> nil
{ DiskIn.ar(1, c.bufnum) }.play
c.cueSoundFile(Platform.resourceDir +/+ "sounds/a11wlk01-44_1.aiff", 0, 1)
c.path // -> it returns the actual path of the sound file.
The same occurs when using “c.querry” instead of “c.path”.
[3] The post window echos the server’s sample rate when creating a buffer using the class method “.cueSoundFile” while the instance method “.query”, which is sent to the same Buffer instance, returns the sound file’s sample rate. However, the post window echos the sound file’s sample rate when updating that buffer using the instance method “.cueSoundFile”; and the instance method “.query”, which is sent to the same Buffer instance after updating that buffer, returns the sound file’s sample rate:
d = Buffer.cueSoundFile(s, Platform.resourceDir +/+ "sounds/a11wlk01-44_1.aiff", 0, 1)
// -> Buffer(1, 32768, 1, 48000.0, nil)
// Here, 48000.0 seems odd, but it is the sample rate of the local server.
d.query
// -> Buffer(1, 32768, 1, 48000.0, nil)
// bufnum: 2
// numFrames: 32768
// numChannels: 1
// sampleRate: 44100.0
// Here, it echoes oddlt 48000.0 again. However, it returns the correct sample rate of the buffer:
d.cueSoundFile(Platform.resourceDir +/+ "sounds/a11wlk01-44_1.aiff", 0, 1)
// -> Buffer(2, 32768, 1, 44100.0, /Users/prko/Dropbox/prko/__myDocs/Writings/Making Sound using Open Sources/mixed/SuperCollider.app/Contents/Resources/sounds/a11wlk01-44_1.aiff)
// It echoes correctly.
d.query
// -> Buffer(1, 32768, 1, 44100.0, /Users/prko/Dropbox/prko/__myDocs/Writings/Making Sound using Open Sources/mixed/SuperCollider.app/Contents/Resources/sounds/a11wlk01-44_1.aiff)
// bufnum: 2
// numFrames: 32768
// numChannels: 1
// sampleRate: 44100.0
// It echoes correctly and returns correctly.
I think that the followings are expected for the consistent behaviours:
-
The instance method “.plot” should not block the preloading of the sound file when DiskIn.ar is streaming in that sound file.
-
The Post windows should echo the path when a buffer instance is being created using the class method “.cueSoundFile”, and the instance method “.path” sent to that buffer should return the sound file path. Please consider that the Post window does echo the path when a buffer instance is being updated using the instance method “.cueSoundFile”, and that the instance method “.path” sent to that updated buffer returns the sound file path.
-
The Post window should also echo the sound file’s sample rate instead of the server’s sample rate when a buffer instance is created using the class method “.cueSoundFile”. Please consider that the Post window does when a buffer instance is updated using the instance method “.cueSoundFile”.
Please let me know if I misunderstand the correct behaviours of the buffer created by “.cueSoundFile”.
Thank you so much for reading this long post, and sorry for the wordy sentences.
Best regards,