[Csnd] variable rate table writing

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd] variable rate table writing

kghongaku
hey csound friends.

   i've been. trying to write a rate audio to tables at varing speeds.
i've been using tabw and phasor, but i'm noticing that when i write at
speeds < 1, the end of the previous block gets written over by the next
write. is there a way (or an opcode)  to scale the block of audio in
anticipation of the next write being somewhere in the middle of the
current. conversely, is there a table writing opcode that can stretch a
block of audio and write it across multiple blocks if i were to want to
write at speeds greater than 1?

k.

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] variable rate table writing

Oeyvind Brandtsegg-3
Hi Kelly,
It sounds as if you need to make an intermediate buffer for the audio, then you can do those things easily.
The audio block of an a-rate signal "as is" will always be ksmps worth of audio samples, so it is hard to do read/write speed modifications directly with it. If you write it to an array or table, ksmps samples at each k-pass, then you have a buffer you can read from at any speed. You can for example iterate over all samples in a 10-second buffer all within one k-pass, or read them slowly one by one. If it is a continuous process, you could make the intermediate buffer circular, so that it will always contain the most recent N seconds of audio.

2017-05-13 10:02 GMT-07:00 Kelly Hirai <[hidden email]>:
hey csound friends.

   i've been. trying to write a rate audio to tables at varing speeds.
i've been using tabw and phasor, but i'm noticing that when i write at
speeds < 1, the end of the previous block gets written over by the next
write. is there a way (or an opcode)  to scale the block of audio in
anticipation of the next write being somewhere in the middle of the
current. conversely, is there a table writing opcode that can stretch a
block of audio and write it across multiple blocks if i were to want to
write at speeds greater than 1?

k.

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



--
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] variable rate table writing

kghongaku
In reply to this post by kghongaku
so, i'm taking a shot at writing an opcode to scale a-blocks under the
direction of the /doc/csound_writing_opcodes.tex in the source tree. i
initially tried to clone the dam opcode and build it into the source
tree. when that failed, i tried to build a local .so file per the
instructions in the document. i've put the local build test case on github.

https://github.com/khirai/ablkscale/

the opcode code compiles fine. i can't seem to get csound to find my
opcode though. this has been the same issue whether i build in the tree
or out.

> make
csound --opcode-lib=./ablkscale.so phasor_debug.orc phasor_debug.sco
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
--Csound version 6.09 (double samples) May 28 2017
[commit: 7827ba33f39a72ad57758685440b4d18c291a57d]
libsndfile-1.0.28
orchname:  phasor_debug.orc
Loading command-line libraries:
rtaudio: ALSA module enabled
rtmidi: ALSA Raw MIDI module enabled

error: syntax error, unexpected T_IDENT  (token "ablkscale") from file
phasor_debug.orc (1)
 line 14:
>>>asigscale  ablkscale <<<
Unexpected untyped word asigscale when expecting a variable
Parsing failed due to invalid input!
Stopping on parser failure.



On 05/13/2017 01:02 PM, Kelly Hirai wrote:

> hey csound friends.
>
>    i've been. trying to write a rate audio to tables at varing speeds.
> i've been using tabw and phasor, but i'm noticing that when i write at
> speeds < 1, the end of the previous block gets written over by the next
> write. is there a way (or an opcode)  to scale the block of audio in
> anticipation of the next write being somewhere in the middle of the
> current. conversely, is there a table writing opcode that can stretch a
> block of audio and write it across multiple blocks if i were to want to
> write at speeds greater than 1?
>
> k.
>

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] variable rate table writing

jpff
Are tee unresolved efeeces in you code?  Or missig interface functions?

Ty runig wit  -v ad/o under gdb ad break in load_module

Or show us your ode


On Sun, 28 May 2017, Kelly Hirai wrote:

> so, i'm taking a shot at writing an opcode to scale a-blocks under the
> direction of the /doc/csound_writing_opcodes.tex in the source tree. i
> initially tried to clone the dam opcode and build it into the source
> tree. when that failed, i tried to build a local .so file per the
> instructions in the document. i've put the local build test case on github.
>
> https://github.com/khirai/ablkscale/
>
> the opcode code compiles fine. i can't seem to get csound to find my
> opcode though. this has been the same issue whether i build in the tree
> or out.
>
>> make
> csound --opcode-lib=./ablkscale.so phasor_debug.orc phasor_debug.sco
> virtual_keyboard real time MIDI plugin for Csound
> 0dBFS level = 32768.0
> --Csound version 6.09 (double samples) May 28 2017
> [commit: 7827ba33f39a72ad57758685440b4d18c291a57d]
> libsndfile-1.0.28
> orchname:  phasor_debug.orc
> Loading command-line libraries:
> rtaudio: ALSA module enabled
> rtmidi: ALSA Raw MIDI module enabled
>
> error: syntax error, unexpected T_IDENT  (token "ablkscale") from file
> phasor_debug.orc (1)
> line 14:
>>>> asigscale  ablkscale <<<
> Unexpected untyped word asigscale when expecting a variable
> Parsing failed due to invalid input!
> Stopping on parser failure.
>
>
>
> On 05/13/2017 01:02 PM, Kelly Hirai wrote:
>> hey csound friends.
>>
>>    i've been. trying to write a rate audio to tables at varing speeds.
>> i've been using tabw and phasor, but i'm noticing that when i write at
>> speeds < 1, the end of the previous block gets written over by the next
>> write. is there a way (or an opcode)  to scale the block of audio in
>> anticipation of the next write being somewhere in the middle of the
>> current. conversely, is there a table writing opcode that can stretch a
>> block of audio and write it across multiple blocks if i were to want to
>> write at speeds greater than 1?
>>
>> k.
>>
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] variable rate table writing

kghongaku
code is here:
https://github.com/khirai/ablkscale/blob/master/ablkscale.c

#include "csdl.h"
#include "ablkscale.h"
#include <math.h>


static int ablkscaleinit(CSOUND *csound, ABLKSCALE *p)
{
    return OK;
}

/*
 * Run-time computation code
 */

static int ablkscale(CSOUND *csound, ABLKSCALE *p)
{
  MYFLT *ain = p->ain;
  MYFLT *aout = p->aout;
  MYFLT kscale = *(p->kscale);
  uint32_t osmpcnt,osmpposold,osmpposnew;  
  uint32_t offset = p->h.insdshead->ksmps_offset;
  uint32_t early  = p->h.insdshead->ksmps_no_end;
  uint32_t i, nsmps = CS_KSMPS;
 
  /* Process ksmps samples */
  if (UNLIKELY(offset)) memset(aout, '\0', offset*sizeof(MYFLT));
  if (UNLIKELY(early)) {
    nsmps -= early;
    memset(&aout[nsmps], '\0', early*sizeof(MYFLT));
  }
  osmpcnt=0;
  osmpposold=offset;
  for (i=offset;i<nsmps;i++) {
    /* the new shorter position */
    osmpposnew=(int)((int)(i-offset)*kscale+offset);
    if (osmpposold == osmpposnew) {
      osmpcnt++;  /*count the number of smps accumulated on the position*/
    }
    else {        /*average the old samples and reset count  */
      aout[osmpposold]=aout[osmpposold]/osmpcnt;
      osmpcnt=0;
    }
    aout[osmpposnew] += ain[i]; /*accumulate samples at the new position */
    osmpcnt++;
    osmpposold=osmpposnew;
  }
  /* aout[osmpposnew]=aout[osmpposnew]/osmpcnt; */ /* never more then 1 sample  or zero? */
  return OK;
}

#define S(x)    sizeof(x)

static OENTRY localops[] = {
{ "ablkscale", S(ABLKSCALE), 0, 5, "a","ak",(SUBR)ablkscaleinit, NULL, (SUBR)ablkscale }
};

ablkscale.h

typedef struct {

  OPDS h ;

 

  MYFLT *aout ;      /* Declare output array first  */

  MYFLT *ain ;       /* Input array   */

  MYFLT *kscale  ;/* shrink the block by a scale of */

 

} ABLKSCALE ;


makefile with compiler options:
https://github.com/khirai/ablkscale/blob/master/makefile

test.wav :  ablkscale.so phasor_debug.orc phasor_debug.sco

    csound --opcode-lib=./ablkscale.so phasor_debug.orc phasor_debug.sco

ablkscale.so : ablkscale.c ablkscale.h

    gcc -O2 -shared -o ablkscale.so ablkscale.c  -I /usr/local/include/csound


On 05/28/2017 04:14 PM, jpff wrote:

> Are tee unresolved efeeces in you code?  Or missig interface functions?
>
> Ty runig wit  -v ad/o under gdb ad break in load_module
>
> Or show us your ode
>
>
> On Sun, 28 May 2017, Kelly Hirai wrote:
>
>> so, i'm taking a shot at writing an opcode to scale a-blocks under the
>> direction of the /doc/csound_writing_opcodes.tex in the source tree. i
>> initially tried to clone the dam opcode and build it into the source
>> tree. when that failed, i tried to build a local .so file per the
>> instructions in the document. i've put the local build test case on
>> github.
>>
>> https://github.com/khirai/ablkscale/
>>
>> the opcode code compiles fine. i can't seem to get csound to find my
>> opcode though. this has been the same issue whether i build in the tree
>> or out.
>>
>>> make
>> csound --opcode-lib=./ablkscale.so phasor_debug.orc phasor_debug.sco
>> virtual_keyboard real time MIDI plugin for Csound
>> 0dBFS level = 32768.0
>> --Csound version 6.09 (double samples) May 28 2017
>> [commit: 7827ba33f39a72ad57758685440b4d18c291a57d]
>> libsndfile-1.0.28
>> orchname:  phasor_debug.orc
>> Loading command-line libraries:
>> rtaudio: ALSA module enabled
>> rtmidi: ALSA Raw MIDI module enabled
>>
>> error: syntax error, unexpected T_IDENT  (token "ablkscale") from file
>> phasor_debug.orc (1)
>> line 14:
>>>>> asigscale  ablkscale <<<
>> Unexpected untyped word asigscale when expecting a variable
>> Parsing failed due to invalid input!
>> Stopping on parser failure.
>>
>>
>>
>> On 05/13/2017 01:02 PM, Kelly Hirai wrote:
>>> hey csound friends.
>>>
>>>    i've been. trying to write a rate audio to tables at varing speeds.
>>> i've been using tabw and phasor, but i'm noticing that when i write at
>>> speeds < 1, the end of the previous block gets written over by the next
>>> write. is there a way (or an opcode)  to scale the block of audio in
>>> anticipation of the next write being somewhere in the middle of the
>>> current. conversely, is there a table writing opcode that can stretch a
>>> block of audio and write it across multiple blocks if i were to want to
>>> write at speeds greater than 1?
>>>
>>> k.
>>>
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>>
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] variable rate table writing

moguillansky
In reply to this post by kghongaku
To see if csound has found your opcode, do

csound -z

That will list all the opcodes. See if yours is there.


On 5/28/17 9:55 PM, Kelly Hirai wrote:

> so, i'm taking a shot at writing an opcode to scale a-blocks under the
> direction of the /doc/csound_writing_opcodes.tex in the source tree. i
> initially tried to clone the dam opcode and build it into the source
> tree. when that failed, i tried to build a local .so file per the
> instructions in the document. i've put the local build test case on github.
>
> https://github.com/khirai/ablkscale/
>
> the opcode code compiles fine. i can't seem to get csound to find my
> opcode though. this has been the same issue whether i build in the tree
> or out.
>
>> make
> csound --opcode-lib=./ablkscale.so phasor_debug.orc phasor_debug.sco
> virtual_keyboard real time MIDI plugin for Csound
> 0dBFS level = 32768.0
> --Csound version 6.09 (double samples) May 28 2017
> [commit: 7827ba33f39a72ad57758685440b4d18c291a57d]
> libsndfile-1.0.28
> orchname:  phasor_debug.orc
> Loading command-line libraries:
> rtaudio: ALSA module enabled
> rtmidi: ALSA Raw MIDI module enabled
>
> error: syntax error, unexpected T_IDENT  (token "ablkscale") from file
> phasor_debug.orc (1)
>   line 14:
>>>> asigscale  ablkscale <<<
> Unexpected untyped word asigscale when expecting a variable
> Parsing failed due to invalid input!
> Stopping on parser failure.
>
>
>
> On 05/13/2017 01:02 PM, Kelly Hirai wrote:
>> hey csound friends.
>>
>>     i've been. trying to write a rate audio to tables at varing speeds.
>> i've been using tabw and phasor, but i'm noticing that when i write at
>> speeds < 1, the end of the previous block gets written over by the next
>> write. is there a way (or an opcode)  to scale the block of audio in
>> anticipation of the next write being somewhere in the middle of the
>> current. conversely, is there a table writing opcode that can stretch a
>> block of audio and write it across multiple blocks if i were to want to
>> write at speeds greater than 1?
>>
>> k.
>>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] variable rate table writing

kghongaku
csound --opcode-lib=./ablkscale.so -z
-- not listed

k.

On 05/28/2017 05:12 PM, Eduardo Moguillansky wrote:

> To see if csound has found your opcode, do
>
> csound -z
>
> That will list all the opcodes. See if yours is there.
>
>
> On 5/28/17 9:55 PM, Kelly Hirai wrote:
>> so, i'm taking a shot at writing an opcode to scale a-blocks under the
>> direction of the /doc/csound_writing_opcodes.tex in the source tree. i
>> initially tried to clone the dam opcode and build it into the source
>> tree. when that failed, i tried to build a local .so file per the
>> instructions in the document. i've put the local build test case on
>> github.
>>
>> https://github.com/khirai/ablkscale/
>>
>> the opcode code compiles fine. i can't seem to get csound to find my
>> opcode though. this has been the same issue whether i build in the tree
>> or out.
>>
>>> make
>> csound --opcode-lib=./ablkscale.so phasor_debug.orc phasor_debug.sco
>> virtual_keyboard real time MIDI plugin for Csound
>> 0dBFS level = 32768.0
>> --Csound version 6.09 (double samples) May 28 2017
>> [commit: 7827ba33f39a72ad57758685440b4d18c291a57d]
>> libsndfile-1.0.28
>> orchname:  phasor_debug.orc
>> Loading command-line libraries:
>> rtaudio: ALSA module enabled
>> rtmidi: ALSA Raw MIDI module enabled
>>
>> error: syntax error, unexpected T_IDENT  (token "ablkscale") from file
>> phasor_debug.orc (1)
>>   line 14:
>>>>> asigscale  ablkscale <<<
>> Unexpected untyped word asigscale when expecting a variable
>> Parsing failed due to invalid input!
>> Stopping on parser failure.
>>
>>
>>
>> On 05/13/2017 01:02 PM, Kelly Hirai wrote:
>>> hey csound friends.
>>>
>>>     i've been. trying to write a rate audio to tables at varing speeds.
>>> i've been using tabw and phasor, but i'm noticing that when i write at
>>> speeds < 1, the end of the previous block gets written over by the next
>>> write. is there a way (or an opcode)  to scale the block of audio in
>>> anticipation of the next write being somewhere in the middle of the
>>> current. conversely, is there a table writing opcode that can stretch a
>>> block of audio and write it across multiple blocks if i were to want to
>>> write at speeds greater than 1?
>>>
>>> k.
>>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>          https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] variable rate table writing

Steven Yi

I'm away from computer, but I think you're missing the LINKAGE macro that typically goes with localops.


On Sun, May 28, 2017, 4:36 PM Kelly Hirai <[hidden email]> wrote:
csound --opcode-lib=./ablkscale.so -z
-- not listed

k.

On 05/28/2017 05:12 PM, Eduardo Moguillansky wrote:
> To see if csound has found your opcode, do
>
> csound -z
>
> That will list all the opcodes. See if yours is there.
>
>
> On 5/28/17 9:55 PM, Kelly Hirai wrote:
>> so, i'm taking a shot at writing an opcode to scale a-blocks under the
>> direction of the /doc/csound_writing_opcodes.tex in the source tree. i
>> initially tried to clone the dam opcode and build it into the source
>> tree. when that failed, i tried to build a local .so file per the
>> instructions in the document. i've put the local build test case on
>> github.
>>
>> https://github.com/khirai/ablkscale/
>>
>> the opcode code compiles fine. i can't seem to get csound to find my
>> opcode though. this has been the same issue whether i build in the tree
>> or out.
>>
>>> make
>> csound --opcode-lib=./ablkscale.so phasor_debug.orc phasor_debug.sco
>> virtual_keyboard real time MIDI plugin for Csound
>> 0dBFS level = 32768.0
>> --Csound version 6.09 (double samples) May 28 2017
>> [commit: 7827ba33f39a72ad57758685440b4d18c291a57d]
>> libsndfile-1.0.28
>> orchname:  phasor_debug.orc
>> Loading command-line libraries:
>> rtaudio: ALSA module enabled
>> rtmidi: ALSA Raw MIDI module enabled
>>
>> error: syntax error, unexpected T_IDENT  (token "ablkscale") from file
>> phasor_debug.orc (1)
>>   line 14:
>>>>> asigscale  ablkscale <<<
>> Unexpected untyped word asigscale when expecting a variable
>> Parsing failed due to invalid input!
>> Stopping on parser failure.
>>
>>
>>
>> On 05/13/2017 01:02 PM, Kelly Hirai wrote:
>>> hey csound friends.
>>>
>>>     i've been. trying to write a rate audio to tables at varing speeds.
>>> i've been using tabw and phasor, but i'm noticing that when i write at
>>> speeds < 1, the end of the previous block gets written over by the next
>>> write. is there a way (or an opcode)  to scale the block of audio in
>>> anticipation of the next write being somewhere in the middle of the
>>> current. conversely, is there a table writing opcode that can stretch a
>>> block of audio and write it across multiple blocks if i were to want to
>>> write at speeds greater than 1?
>>>
>>> k.
>>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>          https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] variable rate table writing

kghongaku
i did not get that it was a macro. i thought that was a label in the text. progress.

thanks :)
k.

On 05/28/2017 07:19 PM, Steven Yi wrote:

I'm away from computer, but I think you're missing the LINKAGE macro that typically goes with localops.


On Sun, May 28, 2017, 4:36 PM Kelly Hirai <[hidden email]> wrote:
csound --opcode-lib=./ablkscale.so -z
-- not listed

k.

On 05/28/2017 05:12 PM, Eduardo Moguillansky wrote:
> To see if csound has found your opcode, do
>
> csound -z
>
> That will list all the opcodes. See if yours is there.
>
>
> On 5/28/17 9:55 PM, Kelly Hirai wrote:
>> so, i'm taking a shot at writing an opcode to scale a-blocks under the
>> direction of the /doc/csound_writing_opcodes.tex in the source tree. i
>> initially tried to clone the dam opcode and build it into the source
>> tree. when that failed, i tried to build a local .so file per the
>> instructions in the document. i've put the local build test case on
>> github.
>>
>> https://github.com/khirai/ablkscale/
>>
>> the opcode code compiles fine. i can't seem to get csound to find my
>> opcode though. this has been the same issue whether i build in the tree
>> or out.
>>
>>> make
>> csound --opcode-lib=./ablkscale.so phasor_debug.orc phasor_debug.sco
>> virtual_keyboard real time MIDI plugin for Csound
>> 0dBFS level = 32768.0
>> --Csound version 6.09 (double samples) May 28 2017
>> [commit: 7827ba33f39a72ad57758685440b4d18c291a57d]
>> libsndfile-1.0.28
>> orchname:  phasor_debug.orc
>> Loading command-line libraries:
>> rtaudio: ALSA module enabled
>> rtmidi: ALSA Raw MIDI module enabled
>>
>> error: syntax error, unexpected T_IDENT  (token "ablkscale") from file
>> phasor_debug.orc (1)
>>   line 14:
>>>>> asigscale  ablkscale <<<
>> Unexpected untyped word asigscale when expecting a variable
>> Parsing failed due to invalid input!
>> Stopping on parser failure.
>>
>>
>>
>> On 05/13/2017 01:02 PM, Kelly Hirai wrote:
>>> hey csound friends.
>>>
>>>     i've been. trying to write a rate audio to tables at varing speeds.
>>> i've been using tabw and phasor, but i'm noticing that when i write at
>>> speeds < 1, the end of the previous block gets written over by the next
>>> write. is there a way (or an opcode)  to scale the block of audio in
>>> anticipation of the next write being somewhere in the middle of the
>>> current. conversely, is there a table writing opcode that can stretch a
>>> block of audio and write it across multiple blocks if i were to want to
>>> write at speeds greater than 1?
>>>
>>> k.
>>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>          https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] variable rate table writing

kghongaku
no luck adding the LINKAGE macro. still gets the:

error: syntax error, unexpected T_IDENT  (token "ablkscale") from file phasor_debug.orc

i am also unable to pickup a breakpoint in gdb using:

b load_module (or _load_module or load-module)

nor am i able yet to see the opcode in the list produced by:

csound --opcode-lib=ablkscale.so -z

the thing is packed up on github. should be able to clone and make this test case on linux from here:

git clone https://github.com/khirai/ablkscale.git
cd ablkscale
make

i know devs are working on 6.09 release. don't let me drag your priorities. but if you get a moment to test this i would appreciate it.
k.


On 05/28/2017 11:14 PM, Kelly Hirai wrote:
i did not get that it was a macro. i thought that was a label in the text. progress.

thanks :)
k.

On 05/28/2017 07:19 PM, Steven Yi wrote:

I'm away from computer, but I think you're missing the LINKAGE macro that typically goes with localops.


On Sun, May 28, 2017, 4:36 PM Kelly Hirai <[hidden email]> wrote:
csound --opcode-lib=./ablkscale.so -z
-- not listed

k.

On 05/28/2017 05:12 PM, Eduardo Moguillansky wrote:
> To see if csound has found your opcode, do
>
> csound -z
>
> That will list all the opcodes. See if yours is there.
>
>
> On 5/28/17 9:55 PM, Kelly Hirai wrote:
>> so, i'm taking a shot at writing an opcode to scale a-blocks under the
>> direction of the /doc/csound_writing_opcodes.tex in the source tree. i
>> initially tried to clone the dam opcode and build it into the source
>> tree. when that failed, i tried to build a local .so file per the
>> instructions in the document. i've put the local build test case on
>> github.
>>
>> https://github.com/khirai/ablkscale/
>>
>> the opcode code compiles fine. i can't seem to get csound to find my
>> opcode though. this has been the same issue whether i build in the tree
>> or out.
>>
>>> make
>> csound --opcode-lib=./ablkscale.so phasor_debug.orc phasor_debug.sco
>> virtual_keyboard real time MIDI plugin for Csound
>> 0dBFS level = 32768.0
>> --Csound version 6.09 (double samples) May 28 2017
>> [commit: 7827ba33f39a72ad57758685440b4d18c291a57d]
>> libsndfile-1.0.28
>> orchname:  phasor_debug.orc
>> Loading command-line libraries:
>> rtaudio: ALSA module enabled
>> rtmidi: ALSA Raw MIDI module enabled
>>
>> error: syntax error, unexpected T_IDENT  (token "ablkscale") from file
>> phasor_debug.orc (1)
>>   line 14:
>>>>> asigscale  ablkscale <<<
>> Unexpected untyped word asigscale when expecting a variable
>> Parsing failed due to invalid input!
>> Stopping on parser failure.
>>
>>
>>
>> On 05/13/2017 01:02 PM, Kelly Hirai wrote:
>>> hey csound friends.
>>>
>>>     i've been. trying to write a rate audio to tables at varing speeds.
>>> i've been using tabw and phasor, but i'm noticing that when i write at
>>> speeds < 1, the end of the previous block gets written over by the next
>>> write. is there a way (or an opcode)  to scale the block of audio in
>>> anticipation of the next write being somewhere in the middle of the
>>> current. conversely, is there a table writing opcode that can stretch a
>>> block of audio and write it across multiple blocks if i were to want to
>>> write at speeds greater than 1?
>>>
>>> k.
>>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>          https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] variable rate table writing

gsenna
Just a quick thought: Did you "sudo ldconfig" after "sudo make install"?


On 29/05/17 11:29, Kelly Hirai wrote:

> no luck adding the LINKAGE macro. still gets the:
>
> error: syntax error, unexpected T_IDENT  (token "ablkscale") from file
> phasor_debug.orc
>
> i am also unable to pickup a breakpoint in gdb using:
>
> b load_module (or _load_module or load-module)
>
> nor am i able yet to see the opcode in the list produced by:
>
> csound --opcode-lib=ablkscale.so -z
>
> the thing is packed up on github. should be able to clone and make this
> test case on linux from here:
>
> git clone https://github.com/khirai/ablkscale.git
> cd ablkscale
> make
>
> i know devs are working on 6.09 release. don't let me drag your
> priorities. but if you get a moment to test this i would appreciate it.
> k.
>
>
> On 05/28/2017 11:14 PM, Kelly Hirai wrote:
>> i did not get that it was a macro. i thought that was a label in the
>> text. progress.
>>
>> thanks :)
>> k.
>>
>> On 05/28/2017 07:19 PM, Steven Yi wrote:
>>> I'm away from computer, but I think you're missing the LINKAGE macro
>>> that typically goes with localops.
>>>
>>>
>>> On Sun, May 28, 2017, 4:36 PM Kelly Hirai <[hidden email]
>>> <mailto:[hidden email]>> wrote:
>>>
>>>     csound --opcode-lib=./ablkscale.so -z
>>>     -- not listed
>>>
>>>     k.
>>>
>>>     On 05/28/2017 05:12 PM, Eduardo Moguillansky wrote:
>>>     > To see if csound has found your opcode, do
>>>     >
>>>     > csound -z
>>>     >
>>>     > That will list all the opcodes. See if yours is there.
>>>     >
>>>     >
>>>     > On 5/28/17 9:55 PM, Kelly Hirai wrote:
>>>     >> so, i'm taking a shot at writing an opcode to scale a-blocks
>>>     under the
>>>     >> direction of the /doc/csound_writing_opcodes.tex in the source
>>>     tree. i
>>>     >> initially tried to clone the dam opcode and build it into the
>>>     source
>>>     >> tree. when that failed, i tried to build a local .so file per the
>>>     >> instructions in the document. i've put the local build test
>>>     case on
>>>     >> github.
>>>     >>
>>>     >> https://github.com/khirai/ablkscale/
>>>     >>
>>>     >> the opcode code compiles fine. i can't seem to get csound to
>>>     find my
>>>     >> opcode though. this has been the same issue whether i build in
>>>     the tree
>>>     >> or out.
>>>     >>
>>>     >>> make
>>>     >> csound --opcode-lib=./ablkscale.so phasor_debug.orc
>>>     phasor_debug.sco
>>>     >> virtual_keyboard real time MIDI plugin for Csound
>>>     >> 0dBFS level = 32768.0
>>>     >> --Csound version 6.09 (double samples) May 28 2017
>>>     >> [commit: 7827ba33f39a72ad57758685440b4d18c291a57d]
>>>     >> libsndfile-1.0.28
>>>     >> orchname:  phasor_debug.orc
>>>     >> Loading command-line libraries:
>>>     >> rtaudio: ALSA module enabled
>>>     >> rtmidi: ALSA Raw MIDI module enabled
>>>     >>
>>>     >> error: syntax error, unexpected T_IDENT  (token "ablkscale")
>>>     from file
>>>     >> phasor_debug.orc (1)
>>>     >>   line 14:
>>>     >>>>> asigscale  ablkscale <<<
>>>     >> Unexpected untyped word asigscale when expecting a variable
>>>     >> Parsing failed due to invalid input!
>>>     >> Stopping on parser failure.
>>>     >>
>>>     >>
>>>     >>
>>>     >> On 05/13/2017 01:02 PM, Kelly Hirai wrote:
>>>     >>> hey csound friends.
>>>     >>>
>>>     >>>     i've been. trying to write a rate audio to tables at
>>>     varing speeds.
>>>     >>> i've been using tabw and phasor, but i'm noticing that when i
>>>     write at
>>>     >>> speeds < 1, the end of the previous block gets written over
>>>     by the next
>>>     >>> write. is there a way (or an opcode)  to scale the block of
>>>     audio in
>>>     >>> anticipation of the next write being somewhere in the middle
>>>     of the
>>>     >>> current. conversely, is there a table writing opcode that can
>>>     stretch a
>>>     >>> block of audio and write it across multiple blocks if i were
>>>     to want to
>>>     >>> write at speeds greater than 1?
>>>     >>>
>>>     >>> k.
>>>     >>>
>>>     >> Csound mailing list
>>>     >> [hidden email] <mailto:[hidden email]>
>>>     >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>     >> Send bugs reports to
>>>     >>          https://github.com/csound/csound/issues
>>>     >> Discussions of bugs and features can be posted here
>>>     >
>>>     > Csound mailing list
>>>     > [hidden email] <mailto:[hidden email]>
>>>     > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>     > Send bugs reports to
>>>     >        https://github.com/csound/csound/issues
>>>     > Discussions of bugs and features can be posted here
>>>
>>>     Csound mailing list
>>>     [hidden email] <mailto:[hidden email]>
>>>     https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>     Send bugs reports to
>>>             https://github.com/csound/csound/issues
>>>     Discussions of bugs and features can be posted here
>>>
>>> Csound mailing list [hidden email]
>>> <mailto:[hidden email]>
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>>> https://github.com/csound/csound/issues Discussions of bugs and
>>> features can be posted here
>>
>> Csound mailing list [hidden email]
>> <mailto:[hidden email]>
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
>> https://github.com/csound/csound/issues Discussions of bugs and
>> features can be posted here
>
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] variable rate table writing

Victor Lazzarini
In reply to this post by kghongaku
Try giving the full path to the .so

like --opcode-lib=./myopcode.so

if it is in the working directory

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 29 May 2017, at 15:30, Kelly Hirai <[hidden email]> wrote:

no luck adding the LINKAGE macro. still gets the:

error: syntax error, unexpected T_IDENT  (token "ablkscale") from file phasor_debug.orc

i am also unable to pickup a breakpoint in gdb using:

b load_module (or _load_module or load-module)

nor am i able yet to see the opcode in the list produced by:

csound --opcode-lib=ablkscale.so -z

the thing is packed up on github. should be able to clone and make this test case on linux from here:

git clone https://github.com/khirai/ablkscale.git
cd ablkscale
make

i know devs are working on 6.09 release. don't let me drag your priorities. but if you get a moment to test this i would appreciate it.
k.


On 05/28/2017 11:14 PM, Kelly Hirai wrote:
i did not get that it was a macro. i thought that was a label in the text. progress.

thanks :)
k.

On 05/28/2017 07:19 PM, Steven Yi wrote:

I'm away from computer, but I think you're missing the LINKAGE macro that typically goes with localops.


On Sun, May 28, 2017, 4:36 PM Kelly Hirai <[hidden email]> wrote:
csound --opcode-lib=./ablkscale.so -z
-- not listed

k.

On 05/28/2017 05:12 PM, Eduardo Moguillansky wrote:
> To see if csound has found your opcode, do
>
> csound -z
>
> That will list all the opcodes. See if yours is there.
>
>
> On 5/28/17 9:55 PM, Kelly Hirai wrote:
>> so, i'm taking a shot at writing an opcode to scale a-blocks under the
>> direction of the /doc/csound_writing_opcodes.tex in the source tree. i
>> initially tried to clone the dam opcode and build it into the source
>> tree. when that failed, i tried to build a local .so file per the
>> instructions in the document. i've put the local build test case on
>> github.
>>
>> https://github.com/khirai/ablkscale/
>>
>> the opcode code compiles fine. i can't seem to get csound to find my
>> opcode though. this has been the same issue whether i build in the tree
>> or out.
>>
>>> make
>> csound --opcode-lib=./ablkscale.so phasor_debug.orc phasor_debug.sco
>> virtual_keyboard real time MIDI plugin for Csound
>> 0dBFS level = 32768.0
>> --Csound version 6.09 (double samples) May 28 2017
>> [commit: 7827ba33f39a72ad57758685440b4d18c291a57d]
>> libsndfile-1.0.28
>> orchname:  phasor_debug.orc
>> Loading command-line libraries:
>> rtaudio: ALSA module enabled
>> rtmidi: ALSA Raw MIDI module enabled
>>
>> error: syntax error, unexpected T_IDENT  (token "ablkscale") from file
>> phasor_debug.orc (1)
>>   line 14:
>>>>> asigscale  ablkscale <<<
>> Unexpected untyped word asigscale when expecting a variable
>> Parsing failed due to invalid input!
>> Stopping on parser failure.
>>
>>
>>
>> On 05/13/2017 01:02 PM, Kelly Hirai wrote:
>>> hey csound friends.
>>>
>>>     i've been. trying to write a rate audio to tables at varing speeds.
>>> i've been using tabw and phasor, but i'm noticing that when i write at
>>> speeds < 1, the end of the previous block gets written over by the next
>>> write. is there a way (or an opcode)  to scale the block of audio in
>>> anticipation of the next write being somewhere in the middle of the
>>> current. conversely, is there a table writing opcode that can stretch a
>>> block of audio and write it across multiple blocks if i were to want to
>>> write at speeds greater than 1?
>>>
>>> k.
>>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>          https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] variable rate table writing

kghongaku
full path or the win!
thanks everyone!
kelly

On 05/29/2017 10:53 AM, Victor Lazzarini wrote:
Try giving the full path to the .so

like --opcode-lib=./myopcode.so

if it is in the working directory

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 29 May 2017, at 15:30, Kelly Hirai <[hidden email]> wrote:

no luck adding the LINKAGE macro. still gets the:

error: syntax error, unexpected T_IDENT  (token "ablkscale") from file phasor_debug.orc

i am also unable to pickup a breakpoint in gdb using:

b load_module (or _load_module or load-module)

nor am i able yet to see the opcode in the list produced by:

csound --opcode-lib=ablkscale.so -z

the thing is packed up on github. should be able to clone and make this test case on linux from here:

git clone https://github.com/khirai/ablkscale.git
cd ablkscale
make

i know devs are working on 6.09 release. don't let me drag your priorities. but if you get a moment to test this i would appreciate it.
k.


On 05/28/2017 11:14 PM, Kelly Hirai wrote:
i did not get that it was a macro. i thought that was a label in the text. progress.

thanks :)
k.

On 05/28/2017 07:19 PM, Steven Yi wrote:

I'm away from computer, but I think you're missing the LINKAGE macro that typically goes with localops.


On Sun, May 28, 2017, 4:36 PM Kelly Hirai <[hidden email]> wrote:
csound --opcode-lib=./ablkscale.so -z
-- not listed

k.

On 05/28/2017 05:12 PM, Eduardo Moguillansky wrote:
> To see if csound has found your opcode, do
>
> csound -z
>
> That will list all the opcodes. See if yours is there.
>
>
> On 5/28/17 9:55 PM, Kelly Hirai wrote:
>> so, i'm taking a shot at writing an opcode to scale a-blocks under the
>> direction of the /doc/csound_writing_opcodes.tex in the source tree. i
>> initially tried to clone the dam opcode and build it into the source
>> tree. when that failed, i tried to build a local .so file per the
>> instructions in the document. i've put the local build test case on
>> github.
>>
>> https://github.com/khirai/ablkscale/
>>
>> the opcode code compiles fine. i can't seem to get csound to find my
>> opcode though. this has been the same issue whether i build in the tree
>> or out.
>>
>>> make
>> csound --opcode-lib=./ablkscale.so phasor_debug.orc phasor_debug.sco
>> virtual_keyboard real time MIDI plugin for Csound
>> 0dBFS level = 32768.0
>> --Csound version 6.09 (double samples) May 28 2017
>> [commit: 7827ba33f39a72ad57758685440b4d18c291a57d]
>> libsndfile-1.0.28
>> orchname:  phasor_debug.orc
>> Loading command-line libraries:
>> rtaudio: ALSA module enabled
>> rtmidi: ALSA Raw MIDI module enabled
>>
>> error: syntax error, unexpected T_IDENT  (token "ablkscale") from file
>> phasor_debug.orc (1)
>>   line 14:
>>>>> asigscale  ablkscale <<<
>> Unexpected untyped word asigscale when expecting a variable
>> Parsing failed due to invalid input!
>> Stopping on parser failure.
>>
>>
>>
>> On 05/13/2017 01:02 PM, Kelly Hirai wrote:
>>> hey csound friends.
>>>
>>>     i've been. trying to write a rate audio to tables at varing speeds.
>>> i've been using tabw and phasor, but i'm noticing that when i write at
>>> speeds < 1, the end of the previous block gets written over by the next
>>> write. is there a way (or an opcode)  to scale the block of audio in
>>> anticipation of the next write being somewhere in the middle of the
>>> current. conversely, is there a table writing opcode that can stretch a
>>> block of audio and write it across multiple blocks if i were to want to
>>> write at speeds greater than 1?
>>>
>>> k.
>>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>          https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here