Csound Csound-dev Csound-tekno Search About

[Cs-dev] textfile.csd

Date2012-08-13 09:02
FromTito Latini
Subject[Cs-dev] textfile.csd
AttachmentsNone  

Date2012-08-13 09:08
Fromjpff@cs.bath.ac.uk
SubjectRe: [Cs-dev] textfile.csd
I see the sense but this is an incompatible change.  Csound originally
took two files -- the first an orchestra and the second a score.  Names
did/does not matter.  One file is thus an error.  This check allowed one
file as long as it was a .csd file.

As long as we are happy with this minor lack of backwards....


> I think that the check for the csd extension in Top/main.c:202
> is a useless limit. It works:
>
>   csound text.csd
>   ...
>   UnifiedCSD:  text.csd
>   ...
>
> but it fails
>
>   cp text.csd text
>   csound text
>   ...
>   orchname:  text
>   ...
>
> The follow is better (csound->orchname is non-NULL):
>
>   else if ((csound->scorename == NULL || csound->scorename[0] == (char) 0)
>            && csound->orchname[0] != '\0') {
>
> instead of the current
>
>   else if (csound->scorename == NULL || csound->scorename[0] == (char) 0)
> {
>     int   tmp = (int) strlen(csound->orchname) - 4;
>     if (tmp >= 0 && csound->orchname[tmp] == '.' &&
>         tolower(csound->orchname[tmp + 1]) == 'c' &&
>         tolower(csound->orchname[tmp + 2]) == 's' &&
>         tolower(csound->orchname[tmp + 3]) == 'd') {
>
> After this change, I can suggest a solution to Peter in csnd-ml.
>
> tito
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-08-13 11:03
FromTito Latini
SubjectRe: [Cs-dev] textfile.csd
AttachmentsNone  

Date2012-08-13 11:25
Fromjpff@cs.bath.ac.uk
SubjectRe: [Cs-dev] textfile.csd
OK; go ahead

>> I see the sense but this is an incompatible change.  Csound originally
>> took two files -- the first an orchestra and the second a score.  Names
>> did/does not matter.  One file is thus an error.  This check allowed one
>> file as long as it was a .csd file.
>>
>> As long as we are happy with this minor lack of backwards....
>
> One file is an error but we have a segfault (all parsers) with
>
>   csound orcfile
>
> caused by `strlen(csound->scorename)' in main.c. The change also fixes it.
> There is not a segfault with a csdfile without extension because the
> parser signals an error
>
>   error: syntax error, unexpected S_LT  (token "<") line 0:
>
> * Some free thoughts
>
> Discarded solution: a xml file begins with a tag, so the '<' char is
> the first char and it is an error in an orc file. Therefore it is
> enough a check for the first non-blank character; if it is '<', the
> file is 'csd'. But it is too late because there are some csd files
> that begin with
>
>   some text bla bla
>   bla bla ...
>   
>
> so I think that a `--orc' flag is useful when there is only one file
>
>   csound text         (it is a csd file or error)
>   csound --orc text   (it is an orc file with INF score or error)
>
> I use tmpfs for temporary csd files, but I like
>
>   csound <(myscript)
>
> or (without `-i stdin')
>
>   myscript | csound /dev/stdin
>
> because I avoid to set/write/remove a tmpfile and to use a "trap" for
> SIGINT in my scripts.
>
> Now we can use it only with (it is a workaround but `file.sco' is
> immutable)
>
>   csound <(make_orc_file_script) file.sco
>   make_orc_file_script | csound /dev/stdin file.sco
>
> only because `/dev/fd/N' and `/dev/stdin' are without the csd extension.
>
> Let me know what is good for you.
>
> tito
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-08-13 11:45
FromTito Latini
SubjectRe: [Cs-dev] textfile.csd
AttachmentsNone  

Date2012-08-13 17:58
FromAndres Cabrera
SubjectRe: [Cs-dev] textfile.csd
Hi,

I think Cosund6 should attempt a cleanup of command line options, to
settle on -+ or -- but having both can be confusing...

Cheers,
Andrés

On 8/13/12, Tito Latini  wrote:
>> OK; go ahead
>
> Applied the first change, so there are not segfaults.
> I'll write the code for `--orc' in the next break.
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>


-- 


Andrés

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cs

Date2012-08-13 18:12
FromTito Latini
SubjectRe: [Cs-dev] textfile.csd
AttachmentsNone  

Date2012-08-13 18:13
FromToby
SubjectRe: [Cs-dev] textfile.csd
On 08/13/2012 09:58 AM, Andres Cabrera wrote:
> Hi,
>
> I think Cosund6 should attempt a cleanup of command line options, to
> settle on -+ or -- but having both can be confusing...

I always wondered about that.  Where did the -+ thing come from?

Toby

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-08-13 18:53
FromJustin Smith
SubjectRe: [Cs-dev] textfile.csd
On Mon, Aug 13, 2012 at 10:13 AM, Toby  wrote:
> On 08/13/2012 09:58 AM, Andres Cabrera wrote:
>> Hi,
>>
>> I think Cosund6 should attempt a cleanup of command line options, to
>> settle on -+ or -- but having both can be confusing...
>
> I always wondered about that.  Where did the -+ thing come from?
>

I don't know, but it definitely isn't a posix specified thing or a gnu
convention / extension

http://www.gnu.org/prep/standards/standards.html#Command_002dLine-Interfaces

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-08-13 19:16
FromJustin Smith
SubjectRe: [Cs-dev] textfile.csd
On Mon, Aug 13, 2012 at 10:53 AM, Justin Smith  wrote:
> On Mon, Aug 13, 2012 at 10:13 AM, Toby  wrote:
>> On 08/13/2012 09:58 AM, Andres Cabrera wrote:
>>> Hi,
>>>
>>> I think Cosund6 should attempt a cleanup of command line options, to
>>> settle on -+ or -- but having both can be confusing...
>>
>> I always wondered about that.  Where did the -+ thing come from?
>>
>
> I don't know, but it definitely isn't a posix specified thing or a gnu
> convention / extension
>
> http://www.gnu.org/prep/standards/standards.html#Command_002dLine-Interfaces

Also, on the subject of compatibility with the rest of the world -
what about allowing more flexibility in csd tags?

On my current home version of csound at least, tags cause errors if
they are not on a line by themselves, which is not really what one
expects if used to xml. Which is to say, a csd looks like xml but
really is not xml at the moment. This comes up when generating a csd
using an xml generating library from another program (I end up needing
to throw in extra new lines before and after every tag just to be
safe).

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-08-13 20:58
Fromjpff@cs.bath.ac.uk
SubjectRe: [Cs-dev] textfile.csd
> On 08/13/2012 09:58 AM, Andres Cabrera wrote:
>> Hi,
>>
>> I think Cosund6 should attempt a cleanup of command line options, to
>> settle on -+ or -- but having both can be confusing...
>
> I always wondered about that.  Where did the -+ thing come from?
>
> Toby
>


The -- form was in csound with a different meaning from before the GNU
use.  It came from the Codemist interface much earlier.  The -+ form was
ibtroduced by Istvan Varga at some stage as -- waqs already used
==John ff


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2012-08-13 22:06
FromMichael Gogins
SubjectRe: [Cs-dev] textfile.csd
The tags are not XML, and the restrictions on placement are
deliberate. If the tags were XML, it would not be clear to a non
programmer how to edit a CSD file.

That said, the CSD files will (or least, used to) load into an XML
editor just fine.

Regards,
Mike

On Mon, Aug 13, 2012 at 3:58 PM,   wrote:
>> On 08/13/2012 09:58 AM, Andres Cabrera wrote:
>>> Hi,
>>>
>>> I think Cosund6 should attempt a cleanup of command line options, to
>>> settle on -+ or -- but having both can be confusing...
>>
>> I always wondered about that.  Where did the -+ thing come from?
>>
>> Toby
>>
>
>
> The -- form was in csound with a different meaning from before the GNU
> use.  It came from the Codemist interface much earlier.  The -+ form was
> ibtroduced by Istvan Varga at some stage as -- waqs already used
> ==John ff
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel



-- 
Michael Gogins
Irreducible Productions
http://www.michael-gogins.com
Michael dot Gogins at gmail dot com

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net