Csound Csound-dev Csound-tekno Search About

[Csnd] Repeated notes and sustain?

Date2019-04-06 04:29
FromPete Goodeve
Subject[Csnd] Repeated notes and sustain?
AttachmentsNone  

Date2019-04-06 05:03
FromEd Cashin
SubjectRe: [Csnd] Repeated notes and sustain?
Ian McCurdy’s examples include MIDI ones that do limiting of polyphony and note duplication that you can draw techniques from.

I recently posted a synth pad .csd here that used the polyphony limiting example.


On Fri, Apr 5, 2019 at 8:29 PM Pete Goodeve <pete.goodeve@computer.org> wrote:
Hi,

I'd have though this was a common situation and there'd be
a good solution, but a look around didn't show anything.
After a lot of trial and error, I got a solution that seems to work,
but am I missing something obvious?

When you play a real instrument, or a normal synth, repeating
a note with the sustain pedal held down just replaces the original
sounding instance with the new one.  Csound is different, though,
in that each MIDI Note On starts a new instance, and if the sustain
is on, it remains sounding until the pedal is released.

With my sometimes-heavy pedal (:-/), this quickly takes me into
out-of-range territory, with typically nasty results.  I would think
there should be a way of ensuring a given note number only
has a single instance, but I couldn't find one.

I eventually hacked a scheme that uses a 128-slot table to
record sounding notes, and any instrument initialization that
finds the same note sounding kills itself.  It seems to work,
but is not at all elegant!

Also I was not helped by the fact that the behaviour of 'tablew'
has changed (at some point before 6.12) and *it does not match
the manual*!!  The manual (even the latest) clearly states that
tablew *always* only runs at performance time, even with i-time
parameters.  this was true in Csound 5 where I originally created
a working scheme, but it s *not* so in 6.12!  Experimentally, using
i-parameters only, tablew writes at i-time (only)!

In addition, I'm not sure that 'turnoff' is doing what I expected.
I found I have to explicitly skip the performance code once the
instrument is 'turned off', or the release phase seems to happen
anyway -- when the sustain is released.

        -- Pete --

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
--
  Ed Cashin <ecashin@noserose.net>
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2019-04-06 06:35
Frompete.goodeve@COMPUTER.ORG
SubjectRe: [Csnd] Repeated notes and sustain?
AttachmentsNone  

Date2019-04-06 12:37
FromAnders Genell
SubjectRe: [Csnd] Repeated notes and sustain?
Without having tested it, couldn’t you put midi note value in a global variable, and check if the next midi note is of the same value and in such case replace it with the new?

Just a thought...

Regards,
Anders

> 6 apr. 2019 kl. 07:35 skrev pete.goodeve@computer.org:
> 
>> On Fri, Apr 05, 2019 at 10:03:25PM -0600, Ed Cashin wrote:
>> Ian McCurdy’s examples include MIDI ones that do limiting of polyphony and
>> note duplication that you can draw techniques from.
>> 
>> I recently posted a synth pad .csd here that used the polyphony limiting
>> example.
>> 
>> http://iainmccurdy.org/csound.html
>> 
> Thanks, but that's not really applicable to my situation.  I've done that sort
> of thing before too.  His polyphony limiting applies to *all* sounding notes.
> In my case, it's only a previously sounding *same* note that has to be silenced.
> 
> As I said, I hacked a solution anyway,  but it surprises me there isn't some more
> 'built-in' solution.
> 
>    -- Pete --
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-04-06 17:23
Fromjohn
SubjectRe: [Csnd] Repeated notes and sustain?
Another off-the-wall idea.  Create a number for each note value (eg the 
pitch) and declare yoiur instrunmenr like

instr 60 51 62 63 64 65 66 67 68 9
.....
endin

then in scheduling the new instance kill any previous instance. in a 
dispatchinf instrument.

Or have I misunnderstood the question?

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-04-06 17:37
FromOeyvind Brandtsegg
SubjectRe: [Csnd] Repeated notes and sustain?
You can also use fractional instr numbers similarly.
To trigger instrument 20, you would do :
inotenum notnum
insnum = 20+(inotenum*0.01)


lør. 6. apr. 2019, 6:23 p.m. skrev john <jpff@codemist.co.uk>:
Another off-the-wall idea.  Create a number for each note value (eg the
pitch) and declare yoiur instrunmenr like

instr 60 51 62 63 64 65 66 67 68 9
.....
endin

then in scheduling the new instance kill any previous instance. in a
dispatchinf instrument.

Or have I misunnderstood the question?

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2019-04-06 17:42
FromAnders Genell
SubjectRe: [Csnd] Repeated notes and sustain?
That’s very clever!!
I suppose fractional instruments monophonic by nature? 
Then this is much better than my idea that would have a lot of conditionals...
Regards,
Anders

6 apr. 2019 kl. 18:37 skrev Oeyvind Brandtsegg <obrandts@gmail.com>:

You can also use fractional instr numbers similarly.
To trigger instrument 20, you would do :
inotenum notnum
insnum = 20+(inotenum*0.01)


lør. 6. apr. 2019, 6:23 p.m. skrev john <jpff@codemist.co.uk>:
Another off-the-wall idea.  Create a number for each note value (eg the
pitch) and declare yoiur instrunmenr like

instr 60 51 62 63 64 65 66 67 68 9
.....
endin

then in scheduling the new instance kill any previous instance. in a
dispatchinf instrument.

Or have I misunnderstood the question?

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2019-04-06 18:21
FromOeyvind Brandtsegg
SubjectRe: [Csnd] Repeated notes and sustain?
I think they are not monophonic by nature, but it might be possible to use tied notes to just prolong an already running instance. 

lør. 6. apr. 2019, 6:42 p.m. skrev Anders Genell <anders.genell@gmail.com>:
That’s very clever!!
I suppose fractional instruments monophonic by nature? 
Then this is much better than my idea that would have a lot of conditionals...
Regards,
Anders

6 apr. 2019 kl. 18:37 skrev Oeyvind Brandtsegg <obrandts@gmail.com>:

You can also use fractional instr numbers similarly.
To trigger instrument 20, you would do :
inotenum notnum
insnum = 20+(inotenum*0.01)


lør. 6. apr. 2019, 6:23 p.m. skrev john <jpff@codemist.co.uk>:
Another off-the-wall idea.  Create a number for each note value (eg the
pitch) and declare yoiur instrunmenr like

instr 60 51 62 63 64 65 66 67 68 9
.....
endin

then in scheduling the new instance kill any previous instance. in a
dispatchinf instrument.

Or have I misunnderstood the question?

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2019-04-06 22:16
FromPete Goodeve
SubjectRe: [Csnd] Repeated notes and sustain?
AttachmentsNone