Csound Csound-dev Csound-tekno Search About

Re: [Cs-dev] New file release for Csound 5 and CsoundVST on Windows

Date2005-03-08 14:44
From"gogins@pipeline.com"
SubjectRe: [Cs-dev] New file release for Csound 5 and CsoundVST on Windows
csoundScoreEvent should produce the same behavior as -L: p2 = 0 means
"now", p2= 1 means "1 beat from now". It should support carry in theory,
but it would certainly be better to have csoundScoreEvent without carry,
than a csoundScoreEvent that doesn't exist or doesn't work at all.

I think having p2 = 0 mean "now" is actually quite important.

-L should be enabled on Windows if and only if it works the same way on
Windows as it does on Linux. Many people would like to have this.



Original Message:
-----------------
From: Istvan Varga istvan@csounds.com
Date: Tue, 08 Mar 2005 14:47:00 +0100
To: csound-devel@lists.sourceforge.net
Subject: Re: [Cs-dev] New file release for Csound 5 and CsoundVST on Windows


Michael Gogins wrote:

> Read line-oriented real-time score events from device DEVICE. The name 
> stdin will permit score events to be typed at your terminal, or piped 
> from another process. Each line-event is terminated by a 
> carriage-return. Events are coded just like those in a standard numeric 
> score, except that an event with p2=0 will be performed immediately, and 
> an event with p2=T will be performed T seconds after arrival. Events can 
> arrive at any time, and in any order. The score carry feature is legal 
> here, as are held notes (p3 negative) and string arguments, but ramps 
> and pp or np references are not.

OK, I know that, but I was asking about csoundScoreEvent(), not -L
(by the way, should -L stdin be allowed under Windows ?).
So, the questions are:
   1. from when should it count the time ?
   2. should it allow the carry feature ? If yes, that is bad news
      because I will then need to revert to using line events for
      this particular function. Although, as far as I know, it did
      not support the carry feature earlier (at least reading the
      (now removed) newevent() function on which csoundScoreEvent()
      was based).

Here is the new function on which now most "create a new event"
type features are based (note: it does not support carry):

/* Schedule new score event to be played. 'time_ofs' is the amount of */
/* time in seconds to add to evt->p[2] to get the actual start time   */
/* of the event (measured from the beginning of performance, and not  */
/* section) in seconds.                                               */
/* If 'allow_now' is non-zero and event type is 'f', the function     */
/* table may be created immediately depending on start time.          */
/* Required parameters in 'evt':                                      */
/*   char   *strarg   string argument of event (NULL if none)         */
/*   char   opcod     event opcode (a, e, f, i, l, q, s)              */
/*   short  pcnt      number of p-fields (>=3 for q, i, a; >=4 for f) */
/*   MYFLT  p[]       array of p-fields, p[1]..p[pcnt] should be set  */
/*  p2orig and p3orig are calculated from p[2] and p[3].              */
/* The contents of 'evt', including the string argument, need not be  */
/* preserved after calling this function, as a copy of the event is   */
/* made.                                                              */
/* Return value is zero on success.                                   */

int insert_score_event(ENVIRON *csound, EVTBLK *evt, double time_ofs,
                        int allow_now);

This function will eventually be part of the API (maybe with a
different name), once I am sure that it does not need further
changes that may break compatibility.

Here is the current state of csoundScoreEvent() in Top/csound.c:

   PUBLIC int csoundScoreEvent(void *csound, char type,
                               MYFLT *pfields, long numFields)
   {
     EVTBLK        evt;
     int           i;

     evt.strarg = NULL;
     evt.opcod = type;
     evt.pcnt = (short) numFields;
     for (i = 0; i < (int) numFields; i++)
       evt.p[i + 1] = pfields[i];
     return
       insert_score_event((ENVIRON*) csound, &evt,
                          ((ENVIRON*) csound)->sensEvents_state.timeOffs,
0);
   }

((ENVIRON*) csound)->sensEvents_state.timeOffs is the start time of the
current section, in seconds. If you want times relative to current time,
replace it with ((ENVIRON*) csound)->sensEvents_state.curTime.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-03-08 14:50
FromIstvan Varga
SubjectRe: [Cs-dev] New file release for Csound 5 and CsoundVST on Windows
gogins@pipeline.com wrote:

> csoundScoreEvent should produce the same behavior as -L: p2 = 0 means
> "now", p2= 1 means "1 beat from now". It should support carry in theory,
> but it would certainly be better to have csoundScoreEvent without carry,
> than a csoundScoreEvent that doesn't exist or doesn't work at all.

How is it expected to have carry with MYFLT arguments ?
Should a special "magic" p-field value be interpreted as '.',
or new arguments need to be added ?

> I think having p2 = 0 mean "now" is actually quite important.
> 
> -L should be enabled on Windows if and only if it works the same way on
> Windows as it does on Linux. Many people would like to have this.

OK, I will commit these soon in case you have not done so already.
Both changes are trivial (affect 1-1 lines), fortunately.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-03-08 15:01
FromIstvan Varga
SubjectRe: [Cs-dev] New file release for Csound 5 and CsoundVST on Windows
gogins@pipeline.com wrote:

> csoundScoreEvent should produce the same behavior as -L: p2 = 0 means
> "now", p2= 1 means "1 beat from now".

-L interprets p2 and p3 as seconds. Should csoundScoreEvent() really
expect beats ? That simply means both values need to be multiplied
by ENVIRON.sensEvents_state.beatTime.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-03-08 20:36
FromIain Duncan
SubjectRe: [Cs-dev] New file release for Csound 5 and CsoundVST on Windows
I have situations where both are desirable. Is there any way we could 
signify to event which to use without changing the syntax badly? ie 
maybe a negative p2 is seconds and not beats or somesuch thing?

For example, if you have several instruments, some using full duplex 
audio, some midi out, etc, you might have to add a latency offset to get 
them to play in sync ( I have this in my gig ensemble again ). In that 
case using p2 in seconds makes things really easy cause the offset won't 
change with tempo changes.

Iain

Istvan Varga wrote:
> gogins@pipeline.com wrote:
> 
>> csoundScoreEvent should produce the same behavior as -L: p2 = 0 means
>> "now", p2= 1 means "1 beat from now".
> 
> 
> -L interprets p2 and p3 as seconds. Should csoundScoreEvent() really
> expect beats ? That simply means both values need to be multiplied
> by ENVIRON.sensEvents_state.beatTime.
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-03-08 20:47
FromIstvan Varga
SubjectRe: [Cs-dev] New file release for Csound 5 and CsoundVST on Windows
Iain Duncan wrote:

> I have situations where both are desirable. Is there any way we could 
> signify to event which to use without changing the syntax badly? ie 
> maybe a negative p2 is seconds and not beats or somesuch thing?
> 
> For example, if you have several instruments, some using full duplex 
> audio, some midi out, etc, you might have to add a latency offset to get 
> them to play in sync ( I have this in my gig ensemble again ). In that 
> case using p2 in seconds makes things really easy cause the offset won't 
> change with tempo changes.

There is a new opcode, miditempo, that returns the current tempo
at k-rate, of either the MIDI file (if available) or the score.

ksig miditempo


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-03-08 20:48
FromIain Duncan
SubjectRe: [Cs-dev] more on event
nice, thanks.

Another event question, are there hard to change reasons why event can't 
be used to send things like r and s and a statements to the score? If 
that wasn't really hard to implement, it could be really useful.

iain

Istvan Varga wrote:
> Iain Duncan wrote:
> 
>> I have situations where both are desirable. Is there any way we could 
>> signify to event which to use without changing the syntax badly? ie 
>> maybe a negative p2 is seconds and not beats or somesuch thing?
>>
>> For example, if you have several instruments, some using full duplex 
>> audio, some midi out, etc, you might have to add a latency offset to 
>> get them to play in sync ( I have this in my gig ensemble again ). In 
>> that case using p2 in seconds makes things really easy cause the 
>> offset won't change with tempo changes.
> 
> 
> There is a new opcode, miditempo, that returns the current tempo
> at k-rate, of either the MIDI file (if available) or the score.
> 
> ksig miditempo
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
> 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-03-08 21:04
FromIstvan Varga
SubjectRe: [Cs-dev] more on event
Iain Duncan wrote:

> Another event question, are there hard to change reasons why event can't 
> be used to send things like r and s and a statements to the score? If 
> that wasn't really hard to implement, it could be really useful.

r: this is not handled at performance time, but rather when the score
    is read from a file, so there is no easy way to add support for 'r'
    to event

s and a: these are supported by insert_score_event() (the function on
    which the event opcode is currently based), but I am not sure that
    the functionality is correct (both can potentially have some ugly
    quirks). However, the syntax checking in "event" rejects 's' and
    'a'.

I did already add 'q' to event, though. There is also a new event_i
opcode that runs at i-time. Furthermore, -L stdin is no longer needed
for anything other than actually entering events as text.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-03-08 21:08
FromIstvan Varga
SubjectRe: [Cs-dev] New file release for Csound 5 and CsoundVST on Windows
By the way, another MIDI file related change is that Csound5
can now read MIDI files with any number of tracks, and you can
filter tracks with the -+mute_tracks option.
Also, you can disable the default GM compatible handling of
controllers (sustain pedal, reset controllers, etc.) with
-+raw_controller_mode.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net