<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thank you. I think I get it now. <br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I was thinking "i" was smarter about values while going thru the do loop, or was was keeping track somehow of all values, not just the increment. But it seems to only know about values of the increment. I think I can fix it now.</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Regards,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Jim<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> cmdist-bounces@ccrma.Stanford.EDU <cmdist-bounces@ccrma.Stanford.EDU> on behalf of cmdist-request@ccrma.Stanford.EDU <cmdist-request@ccrma.Stanford.EDU><br>
<b>Sent:</b> Tuesday, June 19, 2018 7:00 PM<br>
<b>To:</b> cmdist@ccrma.Stanford.EDU<br>
<b>Subject:</b> Cmdist Digest, Vol 122, Issue 1</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Send Cmdist mailing list submissions to<br>
cmdist@ccrma.stanford.edu<br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="https://cm-mail.stanford.edu/mailman/listinfo/cmdist">https://cm-mail.stanford.edu/mailman/listinfo/cmdist</a><br>
or, via email, send a message with subject or body 'help' to<br>
cmdist-request@ccrma.stanford.edu<br>
<br>
You can reach the person managing the list at<br>
cmdist-owner@ccrma.stanford.edu<br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of Cmdist digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. set! samples (James Hearon)<br>
2. Re: set! samples (bil@ccrma.Stanford.EDU)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Tue, 19 Jun 2018 18:02:31 +0000<br>
From: James Hearon <j_hearon@hotmail.com><br>
To: "cmdist@ccrma.Stanford.EDU" <cmdist@ccrma.Stanford.EDU><br>
Subject: [CM] set! samples<br>
Message-ID:<br>
<MWHPR1001MB208069F8BB2B140455F81911E5700@MWHPR1001MB2080.namprd10.prod.outlook.com><br>
<br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hi,<br>
I get a crash that I cannot seem to understand with the following code. In the do loop when I set the test to (= i 40400) I get a squarish-wave in the editor; but when I set it to 40500 or above I get an endless loop and a crash.<br>
<br>
I was trying to create a 2 sec. test.snd, then write the samples to the editor to fill out the 2 sec. or 44100 samples if sr is 22050, but I must be doing something wrong.<br>
<br>
<br>
(set! *clm-srate* 22050)<br>
<br>
(let* ((dur (* *clm-srate* 2))<br>
(ind (new-sound "test.snd" 1 *clm-srate* mus-ldouble mus-riff :size dur))<br>
(v1 (make-float-vector 100 .75))<br>
(v2 (make-float-vector 98 -.5))<br>
)<br>
(do ((i 0 (+ i 200)))<br>
((= i 40400)) ;xxx 40400 works, but 40500 crashes<br>
(set! (samples i (+ i 100)) v1)<br>
(set! (samples (+ i 101) (+ i 199)) v2)<br>
)<br>
)<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="https://cm-mail.stanford.edu/mailman/private/cmdist/attachments/20180619/9abfc7c8/attachment-0001.html">https://cm-mail.stanford.edu/mailman/private/cmdist/attachments/20180619/9abfc7c8/attachment-0001.html</a>><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Tue, 19 Jun 2018 11:21:30 -0700<br>
From: bil@ccrma.Stanford.EDU<br>
To: James Hearon <j_hearon@hotmail.com><br>
Cc: "cmdist@ccrma.Stanford.EDU" <cmdist@ccrma.Stanford.EDU><br>
Subject: Re: [CM] set! samples<br>
Message-ID: <c89d9a491bd836c9b576a7585d44bcf8@ccrma.stanford.edu><br>
Content-Type: text/plain; charset=US-ASCII; format=flowed<br>
<br>
At first glance, "i" never equals 40500 -- you're<br>
stepping by 200. Use (>= i 40500) or (= i 40600).<br>
Since the end test is never true, you probably<br>
run out of memory eventually.<br>
<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
Cmdist mailing list<br>
Cmdist@ccrma.stanford.edu<br>
<a href="https://cm-mail.stanford.edu/mailman/listinfo/cmdist">https://cm-mail.stanford.edu/mailman/listinfo/cmdist</a><br>
<br>
<br>
End of Cmdist Digest, Vol 122, Issue 1<br>
**************************************<br>
<br>
</div>
</span></font></div>
</body>
</html>