Csound Csound-dev Csound-tekno Search About

[Cs-dev] CSD manual errors & omissions

Date2005-03-22 21:24
FromAnthony Kozar
Subject[Cs-dev] CSD manual errors & omissions
There are some inaccuracies in the manual entry for the Unified File Format.
(I am working off of Kevin's last manual release since Csounds.com is still
not showing up correctly).

First, the  tag is not mandatory (nor should it be).

Second the description for the  tag does not fit what I see in
the code.  It says that the format is ", where
filename is the name of the file containing the sample."  But the code
interprets 'filename' as a number and creates a file named "soundin.#"
(Perhaps the code should be changed to except a filename?).

And the way that the sample decoding is currently set up, if a number
greater than 99 is used then Csound will overrun one of its internal arrays.
(Need to either check the assumption < 100 or remove it).

Third, there is no information about the  tag.  And there seems to
be a second midi option  in the code which does not use base64
encoding.  Can this be removed ?  Embedding binary data in the CSD seems
bad.  (Note that the CSD is opened as a binary file in the code though,
presumeably for this reason.  That is also why Mac line endings were not
working on MacOS 9).

Fourth, the code for  does not do what the manual says it should.
The mamual claims that "After 4.22" will exclude version 4.22 but the code
does not.  I don't know whether the manual or the code is correct here.

Finally, the note at the bottom of this manual page on the "Command Line
Parameter File" says that "If the file .csoundrc exists, it will be used to
set the command line parameters. These can be overridden. It uses the same
form as a .csd file."  I know that Istvan updated this code but I can't
check right now to see if the manual has been updated.  Previously, some of
the options could _not_ be overridden (I think this is fixed now?).  And the
file does not use the same form as a .csd file.  This statement implied to
me that the following was required in the .csd when I first tried it:


; put my options here


I would just put the information about .csoundrc on a different page (maybe
the "Command line flags" page) and revise it, removing the bit about .csd
format.

I can make these changes to the manual if no else wants to once csounds.com
is working again.


Another note about the CSD code:  I can't figure out what the firstsamp
global variable is supposed to be doing.  And if it is used, the line

    if (firstsamp) firstsamp = 0;

in createFile() seems likely to be an error.  The sampused[] array (which I
mentioned above could be accessed out-of-bounds) also seems not to really be
used for anything.  Therefore, it appears to just be a liability.


Anthony Kozar
anthonykozar@sbcglobal.net
http://akozar.spymac.net/

PS>  Whoever complained about undocumented features in SuperCollider on the
other list is clearly not aware of all of the undocumented and misdocumented
features in Csound ;)



-------------------------------------------------------
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-03-23 12:30
FromIstvan Varga
SubjectRe: [Cs-dev] CSD manual errors & omissions
Anthony Kozar wrote:

> Third, there is no information about the  tag.

This is a Base64 encoded file that is unpacked (apparently in
the current directory) with the original name, and is deleted
at the end of performance. CsFileB is the most generic and probably
the most useful file embedding tag, but probably only works in
Csound5 as there were bugs that I fixed very recently.

Here is an example of an encoded file, as created by csb64enc:


PENzb3VuZFN5bnRoZXNpemVyPgo8Q3NJbnN0cnVtZW50cz4Kc3IJPSAgNDQxMDAKa3NtcHMJ
PSAgMzIKbmNobmxzCT0gIDIKMGRiZnMJPSAgMQoKCWluc3RyIDEKYTEJdmNvMiAwLjc1LCA0
NDAsIDEwCmtmcnEJcG9ydCAxMDAsIDAuMDA4LCAyMDAwMAphMQlidXR0ZXJscCBhMSwga2Zy
cQphMglsaW5zZWcgMCwgMC4wMDMsIDEsIDAuMDEsIDAuNywgMC4wMDUsIDAsIDEsIDAKYTEJ
PSAgYTEgKiBhMgoJZGVub3JtIGExCmFMLCBhUglmcmVldmVyYiBhMSwgYTEsIDAuOSwgMC4z
NSwgc3IsIDAKCW91dHMgYTEgKyBhTCwgYTEgKyBhUgoJZW5kaW4KCjwvQ3NJbnN0cnVtZW50
cz4KPENzU2NvcmU+CgppIDEgMCA1CmUKCjwvQ3NTY29yZT4KPC9Dc291bmRTeW50aGVzaXpl
cj4K


An example of a complete, working CSD file with CsFileB tags:


; this CSD file was generated with makecsd v1.1
; (written by Istvan Varga, Mar 2003)

; set command line options here
-F test.mid


sr      =  48000
ksmps   =  32
nchnls  =  2

garvb   init 0

#include "instr_90.h"

         instr 1

iamp    veloc
kcps    cpsmidib
a1      vco2 iamp * iamp, kcps
kfco    expon 10000, 0.5, 4000
a2      clfilt a1, kfco, 0, 2
aenv    linsegr 0, 0.005, 1, 2, 0.5, 3600, 0.5, 0.05, 0
a1      =  a2 * aenv * aenv
         vincr garvb, a1
         outs a1, a1

         endin



i 90 0 5
e



CglpbnN0ciA5MAoKZ2FydmIJPSAgZ2FydmIgKiAwLjM1CglkZW5vcm0gZ2FydmIKYWwsIGFy
CXJldmVyYnNjIGdhcnZiLCBnYXJ2YiwgMC43NSwgMTAwMDAsIHNyLCAwLjUKZ2FydmIJPSAg
MAoJb3V0cyBhbCwgYXIKCgllbmRpbgoK


TVRoZAAAAAYAAQABAHhNVHJrAAAATwDwCkEQQhJAAH8AQfcA/38USkFaMgEAAAAAAAAAAAAA
AAAAAAAA/1EDBbjYAJAwf1QwACQ3f1Q3ACQ8f1Q8ACRDf1RDACRIf1RIAAD/LwA




-------------------------------------------------------
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-03-23 12:41
From"Richard Boulanger"
SubjectRe: [Cs-dev] CSD manual errors & omissions
Istvan,

Am I to understand that this would allow one to embed the required samples
into a .csd file?  If so, that would be really great.  Hope that all
versions of Csound could support this feature.

Dr. B.

on 3/23/05 7:30 AM, Istvan Varga at istvan_v@fibermail.hu wrote:

> Anthony Kozar wrote:
> 
>> Third, there is no information about the  tag.
> 
> This is a Base64 encoded file that is unpacked (apparently in
> the current directory) with the original name, and is deleted
> at the end of performance. CsFileB is the most generic and probably
> the most useful file embedding tag, but probably only works in
> Csound5 as there were bugs that I fixed very recently.
> 
> Here is an example of an encoded file, as created by csb64enc:
> 
> 
> PENzb3VuZFN5bnRoZXNpemVyPgo8Q3NJbnN0cnVtZW50cz4Kc3IJPSAgNDQxMDAKa3NtcHMJ
> PSAgMzIKbmNobmxzCT0gIDIKMGRiZnMJPSAgMQoKCWluc3RyIDEKYTEJdmNvMiAwLjc1LCA0
> NDAsIDEwCmtmcnEJcG9ydCAxMDAsIDAuMDA4LCAyMDAwMAphMQlidXR0ZXJscCBhMSwga2Zy
> cQphMglsaW5zZWcgMCwgMC4wMDMsIDEsIDAuMDEsIDAuNywgMC4wMDUsIDAsIDEsIDAKYTEJ
> PSAgYTEgKiBhMgoJZGVub3JtIGExCmFMLCBhUglmcmVldmVyYiBhMSwgYTEsIDAuOSwgMC4z
> NSwgc3IsIDAKCW91dHMgYTEgKyBhTCwgYTEgKyBhUgoJZW5kaW4KCjwvQ3NJbnN0cnVtZW50
> cz4KPENzU2NvcmU+CgppIDEgMCA1CmUKCjwvQ3NTY29yZT4KPC9Dc291bmRTeW50aGVzaXpl
> cj4K
> 
> 
> An example of a complete, working CSD file with CsFileB tags:
> 
> 
> ; this CSD file was generated with makecsd v1.1
> ; (written by Istvan Varga, Mar 2003)
> 
> ; set command line options here
> -F test.mid
> 
> 
> sr      =  48000
> ksmps   =  32
> nchnls  =  2
> 
> garvb   init 0
> 
> #include "instr_90.h"
> 
>        instr 1
> 
> iamp    veloc
> kcps    cpsmidib
> a1      vco2 iamp * iamp, kcps
> kfco    expon 10000, 0.5, 4000
> a2      clfilt a1, kfco, 0, 2
> aenv    linsegr 0, 0.005, 1, 2, 0.5, 3600, 0.5, 0.05, 0
> a1      =  a2 * aenv * aenv
>        vincr garvb, a1
>        outs a1, a1
> 
>        endin
> 
> 
> 
> i 90 0 5
> e
> 
> 
> 
> CglpbnN0ciA5MAoKZ2FydmIJPSAgZ2FydmIgKiAwLjM1CglkZW5vcm0gZ2FydmIKYWwsIGFy
> CXJldmVyYnNjIGdhcnZiLCBnYXJ2YiwgMC43NSwgMTAwMDAsIHNyLCAwLjUKZ2FydmIJPSAg
> MAoJb3V0cyBhbCwgYXIKCgllbmRpbgoK
> 
> 
> TVRoZAAAAAYAAQABAHhNVHJrAAAATwDwCkEQQhJAAH8AQfcA/38USkFaMgEAAAAAAAAAAAAA
> AAAAAAAA/1EDBbjYAJAwf1QwACQ3f1Q3ACQ8f1Q8ACRDf1RDACRIf1RIAAD/LwA
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
> Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
> for the chance to win $25,000 and application distribution. Enter today at
> http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

_______________________________________________________________________
 +  Dr. Richard Boulanger, Professor
 +  Music Synthesis Department, Berklee College of Music
 +  1140 Boylston Street  - Boston, MA  02215-3693
 +  Office Phone: (617) 747-2485   Office Fax: (617) 747-2564
 +  eMail: rboulanger@csounds.com  or  rboulanger@berklee.edu
 +  WebPage: http://csounds.com/boulanger/
________________________________________________________________________
 +  Almost Everything Csound @ http://csounds.com/
 +  The Csound Catalog with Audio @ http://csounds.com/catalog/
 +  The Csound Book @ http://csounds.com/book/
 +  The Csound Magazine @ http://csounds.com/ezine/
 +  CsoundForums @ http://csounds.com/phpBB2/
________________________________________________________________________



-------------------------------------------------------
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-03-23 13:36
FromIstvan Varga
SubjectRe: [Cs-dev] CSD manual errors & omissions
Richard Boulanger wrote:

> Am I to understand that this would allow one to embed the required samples
> into a .csd file?

Yes, although the size of the CSD would be significantly increased, of course.


-------------------------------------------------------
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-03-23 13:49
From"Richard Boulanger"
SubjectRe: [Cs-dev] CSD manual errors & omissions
WOW... Well, I hope that this is supported in all versions of Csound.

Dr. B.

on 3/23/05 8:36 AM, Istvan Varga at istvan_v@fibermail.hu wrote:

> Richard Boulanger wrote:
> 
>> Am I to understand that this would allow one to embed the required samples
>> into a .csd file?
> 
> Yes, although the size of the CSD would be significantly increased, of course.
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
> Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
> for the chance to win $25,000 and application distribution. Enter today at
> http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

_______________________________________________________________________
 +  Dr. Richard Boulanger, Professor
 +  Music Synthesis Department, Berklee College of Music
 +  1140 Boylston Street  - Boston, MA  02215-3693
 +  Office Phone: (617) 747-2485   Office Fax: (617) 747-2564
 +  eMail: rboulanger@csounds.com  or  rboulanger@berklee.edu
 +  WebPage: http://csounds.com/boulanger/
________________________________________________________________________
 +  Almost Everything Csound @ http://csounds.com/
 +  The Csound Catalog with Audio @ http://csounds.com/catalog/
 +  The Csound Book @ http://csounds.com/book/
 +  The Csound Magazine @ http://csounds.com/ezine/
 +  CsoundForums @ http://csounds.com/phpBB2/
________________________________________________________________________



-------------------------------------------------------
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-03-23 14:49
Fromjpff@cs.bath.ac.uk
SubjectRe: [Cs-dev] CSD manual errors & omissions
>>>>> "Richard" == Richard Boulanger  writes:

 Richard> Istvan,
 Richard> Am I to understand that this would allow one to embed the required samples
 Richard> into a .csd file?  If so, that would be really great.  Hope that all
 Richard> versions of Csound could support this feature.

 Richard> Dr. B.

This was done YEARS ago, and if anyone had actually used it the bugs
would have been fixed too.  Actually Rick, I think it was done in
your house initially!

==John ff


-------------------------------------------------------
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-03-23 14:59
From"Richard Boulanger"
Subject[Cs-dev] After the Attack - cSounds.com is BACK!
Anthony and All...

We were massively hacked and attacked over a week ago.
We had to erase and re-install everything from backups,
but I am happy to say that:

... cSounds.com is back!

Dr. B.

(still sorting some things out, but... We're getting there...)
(thanks to all of you for your support and understanding during this
crisis.)
_______________________________________________________________________
 +  Dr. Richard Boulanger, Professor
 +  Music Synthesis Department, Berklee College of Music
 +  1140 Boylston Street  - Boston, MA  02215-3693
 +  Office Phone: (617) 747-2485   Office Fax: (617) 747-2564
 +  eMail: rboulanger@csounds.com  or  rboulanger@berklee.edu
 +  WebPage: http://csounds.com/boulanger/
________________________________________________________________________
 +  Almost Everything Csound @ http://csounds.com/
 +  The Csound Catalog with Audio @ http://csounds.com/catalog/
 +  The Csound Book @ http://csounds.com/book/
 +  The Csound Magazine @ http://csounds.com/ezine/
 +  CsoundForums @ http://csounds.com/phpBB2/
________________________________________________________________________



-------------------------------------------------------
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-03-23 15:01
From"Richard Boulanger"
SubjectRe: [Cs-dev] CSD manual errors & omissions
John,

I remember us talking about it - and I even think I remember us doing it,
but then... I don't know why I never tried it.  Probably it was not there in
MacCsound and so much of my teaching at Berklee and NYU is focused on that
version of the program.

Hopefully it is there in all the versions already!

Rick

on 3/23/05 9:49 AM, jpff@cs.bath.ac.uk at jpff@cs.bath.ac.uk wrote:

>>>>>> "Richard" == Richard Boulanger  writes:
> 
> Richard> Istvan,
> Richard> Am I to understand that this would allow one to embed the required
> samples
> Richard> into a .csd file?  If so, that would be really great.  Hope that all
> Richard> versions of Csound could support this feature.
> 
> Richard> Dr. B.
> 
> This was done YEARS ago, and if anyone had actually used it the bugs
> would have been fixed too.  Actually Rick, I think it was done in
> your house initially!
> 
> ==John ff
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
> Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
> for the chance to win $25,000 and application distribution. Enter today at
> http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

_______________________________________________________________________
 +  Dr. Richard Boulanger, Professor
 +  Music Synthesis Department, Berklee College of Music
 +  1140 Boylston Street  - Boston, MA  02215-3693
 +  Office Phone: (617) 747-2485   Office Fax: (617) 747-2564
 +  eMail: rboulanger@csounds.com  or  rboulanger@berklee.edu
 +  WebPage: http://csounds.com/boulanger/
________________________________________________________________________
 +  Almost Everything Csound @ http://csounds.com/
 +  The Csound Catalog with Audio @ http://csounds.com/catalog/
 +  The Csound Book @ http://csounds.com/book/
 +  The Csound Magazine @ http://csounds.com/ezine/
 +  CsoundForums @ http://csounds.com/phpBB2/
________________________________________________________________________



-------------------------------------------------------
This SF.net email is sponsored by: 2005 Windows Mobile Application Contest
Submit applications for Windows Mobile(tm)-based Pocket PCs or Smartphones
for the chance to win $25,000 and application distribution. Enter today at
http://ads.osdn.com/?ad_id=6882&alloc_id=15148&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net