Csound Csound-dev Csound-tekno Search About

Applying tempo to score with the API

Date2015-05-28 07:25
FromChuckk Hubbard
SubjectApplying tempo to score with the API
AttachmentsNone  None  
Hello.

Is it possible to run tempo on a score with the API? I'd just like to get note times translated to seconds.
The documentation tells me that I should run csoundPreCompile before csoundScoreSort, but I don't see csoundPreCompile anywhere.
I try jumping straight to ScoreSort and I get an error that argument 2 should be of type 'FILE *'. I made both arguments using Python's StringIO, which formats a string as a file. I also tried by opening text files, though, with the same result. This all just to see what happens when I run ScoreSort.
I'm running Python 2.7 with Csound 6.04 on Windows 7.
Thanks in advance for any info!

Python:

import csnd6
from cStringIO import StringIO

opt = '-m0d -+rtaudio=portaudio -odac0'

orc = '''sr = 44100
ksmps = 16
nchnls = 2

pyinit

instr 1
aosc oscil 25000, 440
outs aosc, aosc
endin
'''

sco = '''
f0 10
i1 0 .2
i1 + .
i1 + .
i1 + .
'''

scof = StringIO(sco)
sortsco = StringIO()
cp = csnd6.CppSound()
for word in opt.split():
    cp.SetOption(word)
cp.CompileOrc(orc)
cp.ScoreSort(scof, sortsco)



Date2015-05-28 07:36
FromVictor Lazzarini
SubjectRe: Applying tempo to score with the API
CsoundPreCompile is gone from Csound 6. Which documentation are you using? 

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

> On 28 May 2015, at 07:25, Chuckk Hubbard  wrote:
> 
> Hello.
> 
> Is it possible to run tempo on a score with the API? I'd just like to get note times translated to seconds.
> The documentation tells me that I should run csoundPreCompile before csoundScoreSort, but I don't see csoundPreCompile anywhere.
> I try jumping straight to ScoreSort and I get an error that argument 2 should be of type 'FILE *'. I made both arguments using Python's StringIO, which formats a string as a file. I also tried by opening text files, though, with the same result. This all just to see what happens when I run ScoreSort.
> I'm running Python 2.7 with Csound 6.04 on Windows 7.
> Thanks in advance for any info!
> 
> Python:
> 
> import csnd6
> from cStringIO import StringIO
> 
> opt = '-m0d -+rtaudio=portaudio -odac0'
> 
> orc = '''sr = 44100
> ksmps = 16
> nchnls = 2
> 
> pyinit
> 
> instr 1
> aosc oscil 25000, 440
> outs aosc, aosc
> endin
> '''
> 
> sco = '''
> f0 10
> i1 0 .2
> i1 + .
> i1 + .
> i1 + .
> '''
> 
> scof = StringIO(sco)
> sortsco = StringIO()
> cp = csnd6.CppSound()
> for word in opt.split():
>     cp.SetOption(word)
> cp.CompileOrc(orc)
> cp.ScoreSort(scof, sortsco)
> 
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Csound-users mailing list
> Csound-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-users
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2015-05-28 07:43
FromVictor Lazzarini
SubjectRe: Applying tempo to score with the API
The documentation needs to be fixed. I think this is one of the functions that is not appropriately wrapped in Python. It needs a special wrapper to deal with the FILE  args.

As it is, I think it is not possible to use it outside of C or C++.

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

> On 28 May 2015, at 07:25, Chuckk Hubbard  wrote:
> 
> Hello.
> 
> Is it possible to run tempo on a score with the API? I'd just like to get note times translated to seconds.
> The documentation tells me that I should run csoundPreCompile before csoundScoreSort, but I don't see csoundPreCompile anywhere.
> I try jumping straight to ScoreSort and I get an error that argument 2 should be of type 'FILE *'. I made both arguments using Python's StringIO, which formats a string as a file. I also tried by opening text files, though, with the same result. This all just to see what happens when I run ScoreSort.
> I'm running Python 2.7 with Csound 6.04 on Windows 7.
> Thanks in advance for any info!
> 
> Python:
> 
> import csnd6
> from cStringIO import StringIO
> 
> opt = '-m0d -+rtaudio=portaudio -odac0'
> 
> orc = '''sr = 44100
> ksmps = 16
> nchnls = 2
> 
> pyinit
> 
> instr 1
> aosc oscil 25000, 440
> outs aosc, aosc
> endin
> '''
> 
> sco = '''
> f0 10
> i1 0 .2
> i1 + .
> i1 + .
> i1 + .
> '''
> 
> scof = StringIO(sco)
> sortsco = StringIO()
> cp = csnd6.CppSound()
> for word in opt.split():
>     cp.SetOption(word)
> cp.CompileOrc(orc)
> cp.ScoreSort(scof, sortsco)
> 
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Csound-users mailing list
> Csound-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-users
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2015-05-28 07:48
FromChuckk Hubbard
SubjectRe: Applying tempo to score with the API
AttachmentsNone  None  

On Thu, May 28, 2015 at 9:36 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
CsoundPreCompile is gone from Csound 6. Which documentation are you using?

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

> On 28 May 2015, at 07:25, Chuckk Hubbard <badmuthahubbard@gmail.com> wrote:
>
> Hello.
>
> Is it possible to run tempo on a score with the API? I'd just like to get note times translated to seconds.
> The documentation tells me that I should run csoundPreCompile before csoundScoreSort, but I don't see csoundPreCompile anywhere.
> I try jumping straight to ScoreSort and I get an error that argument 2 should be of type 'FILE *'. I made both arguments using Python's StringIO, which formats a string as a file. I also tried by opening text files, though, with the same result. This all just to see what happens when I run ScoreSort.
> I'm running Python 2.7 with Csound 6.04 on Windows 7.
> Thanks in advance for any info!
>
> Python:
>
> import csnd6
> from cStringIO import StringIO
>
> opt = '-m0d -+rtaudio=portaudio -odac0'
>
> orc = '''sr = 44100
> ksmps = 16
> nchnls = 2
>
> pyinit
>
> instr 1
> aosc oscil 25000, 440
> outs aosc, aosc
> endin
> '''
>
> sco = '''
> f0 10
> i1 0 .2
> i1 + .
> i1 + .
> i1 + .
> '''
>
> scof = StringIO(sco)
> sortsco = StringIO()
> cp = csnd6.CppSound()
> for word in opt.split():
>     cp.SetOption(word)
> cp.CompileOrc(orc)
> cp.ScoreSort(scof, sortsco)
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Csound-users mailing list
> Csound-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-users
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



--

Date2015-05-28 07:50
FromChuckk Hubbard
SubjectRe: Applying tempo to score with the API
AttachmentsNone  None  
OK, thanks for the info. Maybe I will call scsort with a pipe...

-Chuckk

On Thu, May 28, 2015 at 9:43 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
The documentation needs to be fixed. I think this is one of the functions that is not appropriately wrapped in Python. It needs a special wrapper to deal with the FILE  args.

As it is, I think it is not possible to use it outside of C or C++.

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

> On 28 May 2015, at 07:25, Chuckk Hubbard <badmuthahubbard@gmail.com> wrote:
>
> Hello.
>
> Is it possible to run tempo on a score with the API? I'd just like to get note times translated to seconds.
> The documentation tells me that I should run csoundPreCompile before csoundScoreSort, but I don't see csoundPreCompile anywhere.
> I try jumping straight to ScoreSort and I get an error that argument 2 should be of type 'FILE *'. I made both arguments using Python's StringIO, which formats a string as a file. I also tried by opening text files, though, with the same result. This all just to see what happens when I run ScoreSort.
> I'm running Python 2.7 with Csound 6.04 on Windows 7.
> Thanks in advance for any info!
>
> Python:
>
> import csnd6
> from cStringIO import StringIO
>
> opt = '-m0d -+rtaudio=portaudio -odac0'
>
> orc = '''sr = 44100
> ksmps = 16
> nchnls = 2
>
> pyinit
>
> instr 1
> aosc oscil 25000, 440
> outs aosc, aosc
> endin
> '''
>
> sco = '''
> f0 10
> i1 0 .2
> i1 + .
> i1 + .
> i1 + .
> '''
>
> scof = StringIO(sco)
> sortsco = StringIO()
> cp = csnd6.CppSound()
> for word in opt.split():
>     cp.SetOption(word)
> cp.CompileOrc(orc)
> cp.ScoreSort(scof, sortsco)
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Csound-users mailing list
> Csound-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-users
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

------------------------------------------------------------------------------
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



--