[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Literal table ??



Title: Re: [sc-users] Literal table ??
I've been trying to combine Alberto's patch with my
prexisting patch, except the one part of his that I
can't get to work is reading all the sound file
headers as a group.

this is Alberto's example:
 soundfiles = soundfilenames.collect({ arg filename;
  var path, file;
         path = foldername ++ filename;



        file = SoundFile.new;
   if (file.readHeader(path) and: {  file.preload; },
              { file },
                       // complain if file is missing:
                 {       "WARNING! File:" + path + "not found!").postcln;
                        nil

it makes sense, but I just can't get it to work.
I get an error "readHeader primitive failed - path not
string"

For each sound file I'm playing in my patch, I need to
call the file's length.  I can't read the sound file
headers individually, because I'm using more that 256
literals.

Any ideas what I'm doing wrong?

do

path.dump;
       
right before you do

file.readHeader(path);

so you see what path is at that time.

I tried making path a symbol to make it fail,

s = SoundFile.new;
s.readHeader('blablabla...');

and the error window then reads:

ERROR:
Primitive '_ReadSoundFileHeader' failed.

Wrong type.
RECEIVER:
   false
CALL STACK:
   Object::primitiveFailed
        arg this = false
        SoundFile::prReadHeader
        arg this = false
                arg pathName = 'blablabla...'
                // so pathname is a symbol, not a string.
       SoundFile::readHeader

hope that helps,
best,
adc
--
--
Alberto de Campo
ACADEMY OF MEDIA ARTS
Peter-Welter-Platz 2
D - 50676 Cologne / Germany
phone  : ++49-(0)221-20189-141
e-mail : adc@xxxxxx
--