[Csnd] Get the note-off message (velocity = 0)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd] Get the note-off message (velocity = 0)

Hanstein Rommerud
Hello,
Sorry for potentially bad explained problem... I'm periodically an
active CSound-user, but it's quite a while since I've been working on
this - it has been more work done in Pure Data.
Anyhow.

I couldn’t so far find the correct solution for this, so I hope this is
something someone could give a quick answer to. When pressing down a
MIDI key (or controlling CSound from another platform), CSound receive
note number and velocity, and at note off note number and 0.  This is a
bit hard to explain, but I need to «get hold of that 0» when it’s note
of. I am using an arduino with CSound, therefore is this necessary (so
that I can send a 0 to the arduino to tell it that it is to stop the
note). In other cases, it is possible to use a madsr-opcode, but that is
not relevant here… I mean, when an instrument is stopped being played,
it should tell the arduino to stop by sending a signal (0) to the serial
port.

Best regards, Hanstein

Csound mailing list
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Get the note-off message (velocity = 0)

Dave Seidel
You can use the release opcode to detect if the instrument is being called on release, this is what I use to know when to turn off instruments that I kicked off on the initial note press. 

On Fri, Apr 6, 2018, 8:15 AM Hanstein Rommerud <[hidden email]> wrote:
Hello,
Sorry for potentially bad explained problem... I'm periodically an
active CSound-user, but it's quite a while since I've been working on
this - it has been more work done in Pure Data.
Anyhow.

I couldn’t so far find the correct solution for this, so I hope this is
something someone could give a quick answer to. When pressing down a
MIDI key (or controlling CSound from another platform), CSound receive
note number and velocity, and at note off note number and 0.  This is a
bit hard to explain, but I need to «get hold of that 0» when it’s note
of. I am using an arduino with CSound, therefore is this necessary (so
that I can send a 0 to the arduino to tell it that it is to stop the
note). In other cases, it is possible to use a madsr-opcode, but that is
not relevant here… I mean, when an instrument is stopped being played,
it should tell the arduino to stop by sending a signal (0) to the serial
port.

Best regards, Hanstein

Csound mailing list
[hidden email]
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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Get the note-off message (velocity = 0)

Tarmo Johannes-3
Not sure If I got what you need but perhaps you could think of starting and stopping instrument from MIDI note (events from channels 1 start instrument 1, channel 2 instr 2, or use massign)
and you can use a i-time operation to send something to arduino and release opcode to detect the end:

;setupd arduino
instr 1 ; started from midi
serialWrite_i iPort, iByte
if (release()==1) then
serialWrite <something else>
end
endin

Hope it helps you further,
see also


greetings,
tarmo



2018-04-06 17:03 GMT+03:00 Dave Seidel <[hidden email]>:
You can use the release opcode to detect if the instrument is being called on release, this is what I use to know when to turn off instruments that I kicked off on the initial note press. 

On Fri, Apr 6, 2018, 8:15 AM Hanstein Rommerud <[hidden email]> wrote:
Hello,
Sorry for potentially bad explained problem... I'm periodically an
active CSound-user, but it's quite a while since I've been working on
this - it has been more work done in Pure Data.
Anyhow.

I couldn’t so far find the correct solution for this, so I hope this is
something someone could give a quick answer to. When pressing down a
MIDI key (or controlling CSound from another platform), CSound receive
note number and velocity, and at note off note number and 0.  This is a
bit hard to explain, but I need to «get hold of that 0» when it’s note
of. I am using an arduino with CSound, therefore is this necessary (so
that I can send a 0 to the arduino to tell it that it is to stop the
note). In other cases, it is possible to use a madsr-opcode, but that is
not relevant here… I mean, when an instrument is stopped being played,
it should tell the arduino to stop by sending a signal (0) to the serial
port.

Best regards, Hanstein

Csound mailing list
[hidden email]
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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Get the note-off message (velocity = 0)

Hanstein Rommerud

Thanks Tarmo and Dave, I'll see if I can get this working! 

Best regards, Hanstein

 

On 2018-04-06 16:31, Tarmo Johannes wrote:

Not sure If I got what you need but perhaps you could think of starting and stopping instrument from MIDI note (events from channels 1 start instrument 1, channel 2 instr 2, or use massign)
and you can use a i-time operation to send something to arduino and release opcode to detect the end:
 
;setupd arduino
instr 1 ; started from midi
serialWrite_i iPort, iByte
if (release()==1) then
serialWrite <something else>
end
endin
 
Hope it helps you further,
see also
 
 
greetings,
tarmo
 
 

2018-04-06 17:03 GMT+03:00 Dave Seidel <[hidden email]>:
You can use the release opcode to detect if the instrument is being called on release, this is what I use to know when to turn off instruments that I kicked off on the initial note press. 

On Fri, Apr 6, 2018, 8:15 AM Hanstein Rommerud <[hidden email]> wrote:
Hello,
Sorry for potentially bad explained problem... I'm periodically an
active CSound-user, but it's quite a while since I've been working on
this - it has been more work done in Pure Data.
Anyhow.

I couldn’t so far find the correct solution for this, so I hope this is
something someone could give a quick answer to. When pressing down a
MIDI key (or controlling CSound from another platform), CSound receive
note number and velocity, and at note off note number and 0.  This is a
bit hard to explain, but I need to «get hold of that 0» when it’s note
of. I am using an arduino with CSound, therefore is this necessary (so
that I can send a 0 to the arduino to tell it that it is to stop the
note). In other cases, it is possible to use a madsr-opcode, but that is
not relevant here… I mean, when an instrument is stopped being played,
it should tell the arduino to stop by sending a signal (0) to the serial
port.

Best regards, Hanstein

Csound mailing list
[hidden email]
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 [hidden email] 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 [hidden email] 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 [hidden email] 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