[Csnd-dev] multiple calls of csoundPerform?
Date | 2019-04-14 06:23 |
From | Pete Goodeve |
Subject | [Csnd-dev] multiple calls of csoundPerform? |
Attachments | None |
Date | 2019-04-14 09:07 |
From | Francois PINOT |
Subject | Re: [Csnd-dev] multiple calls of csoundPerform? |
Each instance of Csound has its own memory space. In one instance you'll have to recompile a csd if you want to play it again. A typical sequence in Python would be: In [1]: import ctcsound In [2]: cs = ctcsound.Csound() time resolution is 1000.000 ns 0dBFS level = 32768.0 --Csound version 6.13 beta (double samples) Nov 4 2018 [commit: 77986c77b743659067d486da1d389e4d8bf9d152] libsndfile-1.0.28 In [3]: cs.compileCsd('myfile.csd') STARTING FILE Creating options Creating orchestra closing tag Creating score Out[3]: 0 In [4]: cs.start() rtaudio: ALSA module enabled rtmidi: ALSA Raw MIDI module enabled displays suppressed 0dBFS level = 1.0 orch now loaded audio buffered in 256 sample-frame blocks ALSA output: total buffer size: 1024, period size: 256 writing 512 sample blks of 64-bit floats to dac SECTION 1: Out[4]: 0 In [5]: cs.perform() ftable 1: new alloc for instr 2: rtevent: T 0.000 TT 0.000 M: 0.00000 0.00000 new alloc for instr 1: rtevent: T 0.100 TT 0.100 M: 0.16000 0.16000 ... Score finished in csoundPerform(). Out[5]: 2 In [6]: cs.reset() resetting Csound instance inactive allocs returned to freespace end of score. overall amps: 0.88989 0.87681 overall samples out of range: 0 0 0 errors in performance Elapsed time at end of performance: real: 41.372s, CPU: 1.887s WARNING: Buffer underrun in real-time audio output 3113 512 sample blks of 64-bit floats written to dac 0dBFS level = 32768.0 --Csound version 6.13 beta (double samples) Nov 4 2018 [commit: 77986c77b743659067d486da1d389e4d8bf9d152] libsndfile-1.0.28 In [7]: cs.compileCsd(myfile.csd') STARTING FILE Creating options Creating orchestra closing tag Creating score Out[7]: 0 In [8]: cs.start() rtaudio: ALSA module enabled rtmidi: ALSA Raw MIDI module enabled displays suppressed 0dBFS level = 1.0 orch now loaded audio buffered in 256 sample-frame blocks ALSA output: total buffer size: 1024, period size: 256 writing 512 sample blks of 64-bit floats to dac SECTION 1: Out[8]: 0 In [9]: cs.perform() ftable 1: new alloc for instr 2: rtevent: T 0.000 TT 0.000 M: 0.00000 0.00000 new alloc for instr 1: rtevent: T 0.100 TT 0.100 M: 0.16000 0.16000 ... Score finished in csoundPerform(). Out[9]: 2 In [10]: cs.reset() resetting Csound instance inactive allocs returned to freespace end of score. overall amps: 0.88989 0.87681 overall samples out of range: 0 0 0 errors in performance Elapsed time at end of performance: real: 43.629s, CPU: 1.803s WARNING: Buffer underrun in real-time audio output 3113 512 sample blks of 64-bit floats written to dac 0dBFS level = 32768.0 --Csound version 6.13 beta (double samples) Nov 4 2018 [commit: 77986c77b743659067d486da1d389e4d8bf9d152] libsndfile-1.0.28 In [11]: etc François Le dim. 14 avr. 2019 à 07:23, Pete Goodeve <pete.goodeve@computer.org> a écrit : Hi, |
Date | 2019-04-14 16:39 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] multiple calls of csoundPerform? |
This is possible alright. You might need to rewind the score, though, as when csoundPerform() reaches the end of score, it will stop playing. Or you might want to reset, compile and run again. Up to what you want to do. ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 14 Apr 2019, at 06:23, Pete Goodeve |
Date | 2019-04-14 17:18 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] multiple calls of csoundPerform? |
That’s right. But just so we are clear: if you are playing the same score again, all you need to do is rewind. ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 14 Apr 2019, at 09:07, Francois PINOT |
Date | 2019-04-14 22:55 |
From | Pete Goodeve |
Subject | Re: [Csnd-dev] multiple calls of csoundPerform? |
Attachments | None |
Date | 2019-04-15 09:03 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] multiple calls of csoundPerform? |
Reset is needed to clear the engine if you want to compile a new CSD from the start etc. ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 14 Apr 2019, at 22:55, Pete Goodeve |
Date | 2019-04-15 09:13 |
From | pete.goodeve@COMPUTER.ORG |
Subject | Re: [Csnd-dev] multiple calls of csoundPerform? |
Attachments | None |