<br><br><div class="gmail_quote">2010/9/30 Daniel Trueman <span dir="ltr"><<a href="mailto:dtrueman@princeton.edu">dtrueman@princeton.edu</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word">i just want the opposite of SndBuf.read(); want to be able to open a file and write to it all at once, even if it causes hiccups in the VM. but as far as i can tell it's not possible.</div>
</blockquote><div><br></div><div>Got it.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"> i'm pretty sure i can cram samples into SndBuf using valueAt, doing the opposite of what we do now to load samples into LiSa, but i haven't tried that either... so maybe it's all a big mess.<div>
<br></div></div></blockquote><div><br></div><div>From memory (mine, I mean, not ChucK's) I don't think you can. For LiSa valueAt() is read/write and for SndBuf I think it's read only.</div><div><br></div><div>
I think it will have to be a fileIO with some function that formats the numbers from the LiSa to stick to some audio file format. Might be easy enough for raw PCM file though you will have to convert the floats to ints. I heard bad things about implementing the .wav format yourself. I'm not sure this would actually be easier than having LiSa call libsndfile in C++. This is, after all, what libsndfile is supposed to do and we already support it. I imagine that you would be quite sick, quite soon, of turning raw files into something useful in your wave editor.</div>
<div><br></div><div>It's hard for me to say as I have very little C++ experience.</div><div><br></div><div>We could also wonder what the most general solution to this would be as a potential new feature. Right now I think LiSa is the only build-in thing that really records anything we might like to save. We could also have a function that would turn a array of floats into a wave file, give LiSa the possibility of returning a array like that and also add that to anything that records that we think of in the future? That sounds more complicated and I'm not sure it's so much more versatile that it makes sense.</div>
<div><br></div><div>Yours,</div><div>Kas.</div></div>