Ok, maybe the version I have has actually changed. I tried
helpctcsound\.Csound\.scoreEvent
Help on function scoreEvent in module ctcsound:
scoreEventself, type\_, pFields
Sends a new score event.
> *type_* is the score event type 'a', 'i', 'q', 'f', or 'e'.
> *pFields* is a tuple, a list, or an ndarray of MYFLTs with all the
pfields for this event, starting with the p1 value specified in
pFields[0].
So you are right, it does not have the time argument. The version I was looking at is different.
I looked at your original code and the problem is that you are running Csound in the same
thread as you are trying to put events in. You need to run in a separate thread, see
the example
https://github.com/csound/csoundAPI_examples/blob/master/python/py3/example4.py
For instance,
import ctcsound
cs = ctcsound.Csound()
cs.setOption'\-odac'
0
cs.compileOrc('''
... instr 1
... out oscilip4,p5
... endin''')
0
cs.start()
rtaudio: PortAudio module enabled ...
using callback interface
rtmidi: PortMIDI module enabled
--Csound version 6.18 double samples Nov 24 2022
commit: a1580f9cdf331c35dceb486f4231871ce0b00266
libsndfile-1.1.0
graphics suppressed, ascii substituted
sr = 44100.0, kr = 4410.000, ksmps = 10
0dBFS level = 32768.0, A4 tuning = 440.0
orch now loaded
audio buffered in 1024 sample-frame blocks
PortAudio V19.7.0-devel, revision 147dd722548358763a8b649b3e4b41dfffbcfbb6
0: dac0 BlackHole 2ch \[Core Audio, 2 in, 2 out\]
1: dac1 MacBook Pro Speakers \[Core Audio, 0 in, 2 out\]
2: dac2 Microsoft Teams Audio \[Core Audio, 2 in, 2 out\]
3: dac3 ZoomAudioDevice \[Core Audio, 2 in, 2 out\]
4: dac4 Multi\-Output Device \[Core Audio, 0 in, 2 out\]
5: dac5 Aggregate Device \[Core Audio, 3 in, 4 out\]
PortAudio: selected output device 'MacBook Pro Speakers'
writing 1024 sample blks of 64-bit floats to dac
SECTION 1:
0
t = ctcsound.CsoundPerformanceThreadcs\.csound\()
t.play()
cs.scoreEvent"i",\[1,0,1,4000,550\]
rtevent: T 27.023 TT 27.023 M: 0.0
new alloc for instr 1:
0
and you’ll hear a beep.