Csound Csound-dev Csound-tekno Search About

[Csnd] UDOs for table printing

Date2012-08-24 09:48
Fromjoachim heintz
Subject[Csnd] UDOs for table printing
hi all -

as i missed it, i have written (and rewritten) some UDOs for printing 
out the content of a table. basically these are TbDmp (i-rate) and 
TbDmpk (k-rate):
http://www.csounds.com/udo/displayOpcode.php?opcode_id=85
http://www.csounds.com/udo/displayOpcode.php?opcode_id=170

sometimes it is useful to have a string as introduction; i called it 
TbDmpS and TbDmpSk:
http://www.csounds.com/udo/displayOpcode.php?opcode_id=102
http://www.csounds.com/udo/displayOpcode.php?opcode_id=171

a simple example is below, other examples are on the udo site. let me 
know if you experience any problems.

best -

	joachim




   opcode TbDmp, 0, iojjo
ifn, istart, iend, iprec, ippr xin
ippr       =          (ippr == 0 ? 10 : ippr)
iend       =          (iend == -1 ? ftlen(ifn) : iend)
iprec      =          (iprec == -1 ? 3 : iprec)
indx       =          istart
Sformat    sprintf    "%%.%df, ", iprec
Sdump      sprintf    "%s", "["
loop:
ival       tab_i      indx, ifn
Snew       sprintf    Sformat, ival
Sdump      strcat     Sdump, Snew
imod       =          (indx+1-istart) % ippr
  if imod == 0 && indx != iend-1 then
            puts       Sdump, 1
Sdump      =          ""
  endif
            loop_lt    indx, 1, iend, loop
ilen       strlen     Sdump
Slast      strsub     Sdump, 0, ilen-2
            printf_i   "%s]\n", 1, Slast
   endop

   instr 1
;generate a table with random values
ift ftgen 0, 0, -10, 21, 1, 1
;print out
TbDmp ift
   endin


i 1 0 0



Date2012-08-24 17:16
Frompeiman khosravi
SubjectRe: [Csnd] UDOs for table printing
Thanks joachim. I've found a way of graphically plotting lines in python so this will be very handy in passing table content to python and plot them.

P

On 24 August 2012 09:48, joachim heintz <jh@joachimheintz.de> wrote:
hi all -

as i missed it, i have written (and rewritten) some UDOs for printing out the content of a table. basically these are TbDmp (i-rate) and TbDmpk (k-rate):
http://www.csounds.com/udo/displayOpcode.php?opcode_id=85
http://www.csounds.com/udo/displayOpcode.php?opcode_id=170

sometimes it is useful to have a string as introduction; i called it TbDmpS and TbDmpSk:
http://www.csounds.com/udo/displayOpcode.php?opcode_id=102
http://www.csounds.com/udo/displayOpcode.php?opcode_id=171

a simple example is below, other examples are on the udo site. let me know if you experience any problems.

best -

        joachim


<CsoundSynthesizer>
<CsInstruments>
  opcode TbDmp, 0, iojjo
ifn, istart, iend, iprec, ippr xin
ippr       =          (ippr == 0 ? 10 : ippr)
iend       =          (iend == -1 ? ftlen(ifn) : iend)
iprec      =          (iprec == -1 ? 3 : iprec)
indx       =          istart
Sformat    sprintf    "%%.%df, ", iprec
Sdump      sprintf    "%s", "["
loop:
ival       tab_i      indx, ifn
Snew       sprintf    Sformat, ival
Sdump      strcat     Sdump, Snew
imod       =          (indx+1-istart) % ippr
 if imod == 0 && indx != iend-1 then
           puts       Sdump, 1
Sdump      =          ""
 endif
           loop_lt    indx, 1, iend, loop
ilen       strlen     Sdump
Slast      strsub     Sdump, 0, ilen-2
           printf_i   "%s]\n", 1, Slast
  endop

  instr 1
;generate a table with random values
ift ftgen 0, 0, -10, 21, 1, 1
;print out
TbDmp ift
  endin
</CsInstruments>
<CsScore>
i 1 0 0
</CsScore>
</CsoundSynthesizer>


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2012-08-24 17:36
From"Dr. Richard Boulanger"
SubjectRe: [Csnd] UDOs for table printing
Really useful UDOs.  Thanks.  Peiman, please share your plotting routines too!

Sent from my iPhone.

On Aug 24, 2012, at 12:16 PM, peiman khosravi <peimankhosravi@gmail.com> wrote:

Thanks joachim. I've found a way of graphically plotting lines in python so this will be very handy in passing table content to python and plot them.

P

On 24 August 2012 09:48, joachim heintz <jh@joachimheintz.de> wrote:
hi all -

as i missed it, i have written (and rewritten) some UDOs for printing out the content of a table. basically these are TbDmp (i-rate) and TbDmpk (k-rate):
http://www.csounds.com/udo/displayOpcode.php?opcode_id=85
http://www.csounds.com/udo/displayOpcode.php?opcode_id=170

sometimes it is useful to have a string as introduction; i called it TbDmpS and TbDmpSk:
http://www.csounds.com/udo/displayOpcode.php?opcode_id=102
http://www.csounds.com/udo/displayOpcode.php?opcode_id=171

a simple example is below, other examples are on the udo site. let me know if you experience any problems.

best -

        joachim


<CsoundSynthesizer>
<CsInstruments>
  opcode TbDmp, 0, iojjo
ifn, istart, iend, iprec, ippr xin
ippr       =          (ippr == 0 ? 10 : ippr)
iend       =          (iend == -1 ? ftlen(ifn) : iend)
iprec      =          (iprec == -1 ? 3 : iprec)
indx       =          istart
Sformat    sprintf    "%%.%df, ", iprec
Sdump      sprintf    "%s", "["
loop:
ival       tab_i      indx, ifn
Snew       sprintf    Sformat, ival
Sdump      strcat     Sdump, Snew
imod       =          (indx+1-istart) % ippr
 if imod == 0 && indx != iend-1 then
           puts       Sdump, 1
Sdump      =          ""
 endif
           loop_lt    indx, 1, iend, loop
ilen       strlen     Sdump
Slast      strsub     Sdump, 0, ilen-2
           printf_i   "%s]\n", 1, Slast
  endop

  instr 1
;generate a table with random values
ift ftgen 0, 0, -10, 21, 1, 1
;print out
TbDmp ift
  endin
</CsInstruments>
<CsScore>
i 1 0 0
</CsScore>
</CsoundSynthesizer>


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Date2012-08-24 17:45
Frompeiman khosravi
SubjectRe: [Csnd] UDOs for table printing
for sure, it's just a sketch at the moment.

Best,
Peiman

On 24 August 2012 17:36, Dr. Richard Boulanger <rboulanger@berklee.edu> wrote:
Really useful UDOs.  Thanks.  Peiman, please share your plotting routines too!

Sent from my iPhone.

On Aug 24, 2012, at 12:16 PM, peiman khosravi <peimankhosravi@gmail.com> wrote:

Thanks joachim. I've found a way of graphically plotting lines in python so this will be very handy in passing table content to python and plot them.

P

On 24 August 2012 09:48, joachim heintz <jh@joachimheintz.de> wrote:
hi all -

as i missed it, i have written (and rewritten) some UDOs for printing out the content of a table. basically these are TbDmp (i-rate) and TbDmpk (k-rate):
http://www.csounds.com/udo/displayOpcode.php?opcode_id=85
http://www.csounds.com/udo/displayOpcode.php?opcode_id=170

sometimes it is useful to have a string as introduction; i called it TbDmpS and TbDmpSk:
http://www.csounds.com/udo/displayOpcode.php?opcode_id=102
http://www.csounds.com/udo/displayOpcode.php?opcode_id=171

a simple example is below, other examples are on the udo site. let me know if you experience any problems.

best -

        joachim


<CsoundSynthesizer>
<CsInstruments>
  opcode TbDmp, 0, iojjo
ifn, istart, iend, iprec, ippr xin
ippr       =          (ippr == 0 ? 10 : ippr)
iend       =          (iend == -1 ? ftlen(ifn) : iend)
iprec      =          (iprec == -1 ? 3 : iprec)
indx       =          istart
Sformat    sprintf    "%%.%df, ", iprec
Sdump      sprintf    "%s", "["
loop:
ival       tab_i      indx, ifn
Snew       sprintf    Sformat, ival
Sdump      strcat     Sdump, Snew
imod       =          (indx+1-istart) % ippr
 if imod == 0 && indx != iend-1 then
           puts       Sdump, 1
Sdump      =          ""
 endif
           loop_lt    indx, 1, iend, loop
ilen       strlen     Sdump
Slast      strsub     Sdump, 0, ilen-2
           printf_i   "%s]\n", 1, Slast
  endop

  instr 1
;generate a table with random values
ift ftgen 0, 0, -10, 21, 1, 1
;print out
TbDmp ift
  endin
</CsInstruments>
<CsScore>
i 1 0 0
</CsScore>
</CsoundSynthesizer>


Send bugs reports to the Sourceforge bug tracker
           https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"