Csound Csound-dev Csound-tekno Search About

[CSOUND-DEV:5639] Re: ENVIRON * change

Date2005-01-07 04:42
From"Michael Gogins"
Subject[CSOUND-DEV:5639] Re: ENVIRON * change
I have changed vst4cs, fluid, fluidOpcodes, and Loris. I have not yet 
changed py, but I will.

Real-time audio on the PC is now broken, I have no idea why. Off-line 
rendering works fine.

----- Original Message ----- 
From: "steven yi" 
To: "Csound Developers Discussion List" 
Sent: Thursday, January 06, 2005 11:00 PM
Subject: [CSOUND-DEV:5638] ENVIRON * change


> Hi John,
>
> Could you explain the latest change with passing in the ENVIRON* struct as 
> the first argument to all opcodes?
> As it is, I was accessing the ENVIRON struct in the fluidOpcodes through:
>
> #define CENVIRON(p) (p->h.insdshead->csound)
>
> Granted, it is a lot nicer to have it passed in so as not to have to go 
> through the h.insdshead to get the pointer, but this should also make some 
> broken opcode libraries (vst4cs, py, fluid, fluidOpcodes, Loris), yes? 
> (I'm assuming this change was done for moving forward with reentrancy?)
>
> Thanks,
> steven
>
> 

Date2005-01-07 06:13
Fromsteven yi
Subject[CSOUND-DEV:5640] Re: ENVIRON * change
Thanks Michael!  I'm still curious as to the explanation behind the 
change, but it seems this is the middle of a larger change so I'll wait 
to see what happens.

As for Real-Time, I notice that paBlockingWrite changed a bit between 
the version just before the one commited with the message "Major Change: 
added environ arg to opcodes" and that version.  This is the current 
version in pa_blocking.c:

void paBlockingWrite(PA_BLOCKING_STREAM *pabs, int bytes, MYFLT *buffer)
{
    size_t i;
    for (i = 0; i < bytes; i++) {
      pabs->actualBuffer[i+pabs->bp] = (float) buffer[i];
    }
    pabs->bp += bytes;
    if (pabs->bp >= pabs->actualBufferSampleCount) {
      csoundNotifyThreadLock(pabs->csound, pabs->paLock);
      csoundWaitThreadLock(pabs->csound, pabs->clientLock, 100);
      memcpy(pabs->actualBuffer,
             &pabs->actualBuffer[pabs->actualBufferSampleCount],
             (pabs->bp-pabs->actualBufferSampleCount)*sizeof(float));
      pabs->bp -= pabs->actualBufferSampleCount;
   }
}

and revision 1.17, dated 12/26/04, has:

void paBlockingWrite(PA_BLOCKING_STREAM *pabs, MYFLT *buffer)
{
    size_t i;
    size_t n;
    for (i = 0, n = pabs->actualBufferSampleCount; i < n; i++) {
      pabs->actualBuffer[i] = (float)buffer[i];
    }
    csoundNotifyThreadLock(pabs->csound, pabs->paLock);
    csoundWaitThreadLock(pabs->csound, pabs->clientLock, 100);
}

I'm not sure if that's of any help, but I found this code has no 
changeLog for it so thought it might be something of a lead.

steven


Michael Gogins wrote:

> I have changed vst4cs, fluid, fluidOpcodes, and Loris. I have not yet 
> changed py, but I will.
>
> Real-time audio on the PC is now broken, I have no idea why. Off-line 
> rendering works fine.

Date2005-01-07 08:45
From"Matt J. Ingalls"
Subject[CSOUND-DEV:5641] csound4 lineevent fix
i just checked in a fix to csound4lineevents - i had broken it a bit a 
couple of weeks ago

sorry about that..

-m