Applying tempo to score with the API
Date | 2015-05-28 07:25 |
From | Chuckk Hubbard |
Subject | Applying tempo to score with the API |
Attachments | None 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) |
Date | 2015-05-28 07:36 |
From | Victor Lazzarini |
Subject | Re: 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 |
Date | 2015-05-28 07:43 |
From | Victor Lazzarini |
Subject | Re: 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 |
Date | 2015-05-28 07:48 |
From | Chuckk Hubbard |
Subject | Re: Applying tempo to score with the API |
Attachments | None 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? |
Date | 2015-05-28 07:50 |
From | Chuckk Hubbard |
Subject | Re: Applying tempo to score with the API |
Attachments | None 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. |