| The tempo option only works with a sorted score, so you will need to give a score to Csound before
you start it (via a CSD, or ReadScore(), but before calling csoundStart()).
For instance, in Python,
Python 2.7.5 (v2.7.5:ab05e7dd2788, May 13 2013, 13:18:45)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import csnd6
>>> cs = csnd6.Csound()
virtual_keyboard real time MIDI plugin for Csound
0dBFS level = 32768.0
Csound version 6.02.0 (double samples) Apr 26 2014
libsndfile-1.0.25
>>> cs.ReadScore("t 0 120 \n i1 0 10 \n")
0
>>> cs.CompileOrc("instr 1 \n a1 oscili 10000,440 \n out a1 \n endin \n")
0
>>> cs.Start()
rtaudio: PortAudio module enabled ...
using callback interface
rtmidi: PortMIDI module enabled
--Csound version 6.02.0 (double samples) Apr 26 2014
graphics suppressed, ascii substituted
0dBFS level = 32768.0
orch now loaded
audio buffered in 1024 sample-frame blocks
writing 2048-byte blks of shorts to test.aif (AIFF)
SECTION 1:
0
>>> cs.Perform()
new alloc for instr 1:
B 0.000 .. 10.000 T 5.000 TT 5.000 M: 10000.0
Score finished in csoundPerform().
2
>>> quit()
inactive allocs returned to freespace
end of score. overall amps: 10000.0
overall samples out of range: 0
0 errors in performance
Elapsed time at end of performance: real: 132.711s, CPU: 0.025s
1024 2048 sample blks of shorts written to test.aif (AIFF)
ligeti-2:debug victor$ sndfile-info test.aif
Version : libsndfile-1.0.25
========================================
File : test.aif
Length : 441054
FORM : 441046
AIFF
COMM : 18
Sample Rate : 44100
Frames : 220500
Channels : 1
Sample Size : 16
Encoding : NONE
SSND : 441008
Offset : 0
Block Size : 0
----------------------------------------
Sample Rate : 44100
Frames : 220500
Channels : 1
Format : 0x00020002
Sections : 1
Seekable : TRUE
Duration : 00:00:05.000
Signal Max : 10000 (-10.31 dB)
you see it worked as the 10-beat sound is 5 secs long with t0 120. Tempo only
affects the first sorted score.
========================
Dr Victor Lazzarini
Senior Lecturer
NUI Maynooth, Ireland
victor dot lazzarini at nuim dot ie
On 28 Apr 2014, at 07:19, francesco wrote:
> Hello All,
> i was trying to use the tempo flags from the API (from Lua), but
> i'm not able to get it working.
>
> I tried:
> cs:SetOption("--tempo=120") and
> cs:SetOption("-t240")
>
> but without success.
>
> I also tried to use t flags in score, something like
> cs:ReadScore("t 0 120") that give me an error.
>
> Is the tempo flag supposed to work using the API?
>
> Thanks,
> ciao,
> francesco.
>
>
>
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Csound-API-and-command-line-flag-tempo-tp5734731.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> Send bugs reports to
> https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>
>
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
|