Closed gogins closed 2 years ago
Handling standard score events, "note on" and "note off" events, and MIDI events in the same instrument definition is tricky.
--midi-key=4 --midi-velocity=5
.p1
must have a tag (ID), e.g. 1.036 for instrument 1. For "note on" messages, p3
must be negative, and normally is -1. For "note off" messages, p1
must be exactly the same as the p1
of the matching "note on" event, and p3
must be 0.p3
as a duration, e.g. for the sustain segment of an envelope, but rather create an i_sustain
or i_decay
value that is as long as makes sense for that instrument. That would be as long as possible for a sustained instrument, or the maximum reasonable decay for an emulation of a struck or plucked resonator.cossegr
. The attack and release segments should be as long as necessary to mask unwanted artifacts, and this should be determined by experiment. xtratim
opcode should be used to carry the duration of the note well past the end of the release segment. setksmps 1
should be used.It's too much to go ahead and try to fix all my patches at once, and if I did, I would miss something. I am going to fix them as I use them and commit them back to csound-ac.
I need to isolate the effects of envelopes/declicking/deblock2
etc. I will do experiments using first a pure sine tone. All variants will be imported into Audacity at the same as separate tracks, and critical sections will be closely examined.
cossegr
only. It seems the declicking envelope must last longer than the physical envelope.transeg
only.transegr
only.transeg
with cossegr
. As expected this gives the best results, but still not ideal.xtratim
needed with cossegr
and, if so, how extra time? Yes, and longer than you might think, 1 second seems to work.0dbfs
and the Csound amplitude diagnostics. Seems to be OK actually, but "envelope only" signals may not work with 0dbfs.massign
.cossegr
itself.cossegr
and that will be the complete signal. No oscillator. OK, that's the problem. Misleading documentation. We get 1/4 a cosine period instead of the 1/2 period that I expected. But this is on some envelopes only. Higher amplitude envelopes show this issue, lower amplitude envelopes do not show this issue. I have no idea why but I now suspect the opcode has a bug. I will try substituting or re-implementing the opcode.cossegr
. No change.Strategy that works:
I can't get rid of all the clicks even with a sine tone. I am investigating if this has something to do with Apple or with Audacity. If necessary I will try some of these experiments on Linux. There is definitely a problem -- I hear these clicks even if I create tones in Audacity without using Csound at all. Maybe it has something to do with Bluetooth, so I will try headphones. Yes, it's Bluetooth. But then with USB audio I get a ground loop!!....
For now I'm using Bluetooth for ordinary work and studio monitor headphones for critical work.
What I'm looking for here is instruments usable for cloud-music, that is, no external dependencies. Some should have sharp attacks and a fairly long decay, others should be pads.
ksmps = 1
but local setksmps
doesn't work because the signal flow graph opcodes don't work with local ksmps. It's a shame because the instrument is very good. Now fixed using `ksmps=1 UDO.I have cleaned up all of these Csound instrument patches that do not have external dependencies such as Faust or plugins, and that therefore can be used with the WebAssembly build of Csound.
I have not touched effect patches.
playpen.py
to test Csound instrument patches with standard<CsScore>
notes, "note on" and "note off" events, and MIDI events. Done, but the MIDI file can only be played at the beginning of the test.