Csound Csound-dev Csound-tekno Search About

[Csnd] midi trigger instrument

Date2014-04-14 15:13
Fromzappfinger
Subject[Csnd] midi trigger instrument
A simple setup:

VCO1 ->VCF1 -> VCA
             ^
             |
LFO1-------
env1 ------

and a separate ADSR and LFO that control the VCF for example

When I use a midi trigger instrument like this:

instr miditrig
inote   = p4
;ivel    = p5   ; not used now
icps    = cpsmidinn(inote)
		event "i", "vco1", 0, -1, inote
		event "i", "env1", 0, -1
		event "i", "lfo1", 0, -1
endin

it sounds rather messy.
When I comment this miditrig out and move the cpsmidinn to the VCO, it
sounds ok
Any clues?

Richard



--
View this message in context: http://csound.1045644.n5.nabble.com/midi-trigger-instrument-tp5734211.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-04-14 17:31
FromJim Aikin
Subject[Csnd] Re: midi trigger instrument
Untested, but I notice you're not using icps for anything. Is it possible you
meant to write:

event "i", "vco1", 0, -1, icps

?



--
View this message in context: http://csound.1045644.n5.nabble.com/midi-trigger-instrument-tp5734211p5734213.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-04-14 18:50
FromRory Walsh
SubjectRe: [Csnd] Re: midi trigger instrument

Event is k-rate. Try event_i?

On 14 Apr 2014 18:31, "Jim Aikin" <midiguru23@sbcglobal.net> wrote:
Untested, but I notice you're not using icps for anything. Is it possible you
meant to write:

event "i", "vco1", 0, -1, icps

?



--
View this message in context: http://csound.1045644.n5.nabble.com/midi-trigger-instrument-tp5734211p5734213.html
Sent from the Csound - General mailing list archive at Nabble.com.


Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




Date2014-04-14 20:01
Fromzappfinger
Subject[Csnd] Re: midi trigger instrument
Thanks Jim, I was not using icps and Rory, I did not know about event_i...



--
View this message in context: http://csound.1045644.n5.nabble.com/midi-trigger-instrument-tp5734211p5734218.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-04-14 20:47
FromRory Walsh
SubjectRe: [Csnd] Re: midi trigger instrument

It's your friend if you are triggering events from a midi instr :)

On 14 Apr 2014 21:02, "zappfinger" <zappfinger@gmail.com> wrote:
Thanks Jim, I was not using icps and Rory, I did not know about event_i...



--
View this message in context: http://csound.1045644.n5.nabble.com/midi-trigger-instrument-tp5734211p5734218.html
Sent from the Csound - General mailing list archive at Nabble.com.


Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




Date2014-04-14 21:02
Fromzappfinger
Subject[Csnd] Re: midi trigger instrument
Some questions though..

instr   vco1
ioct        chnget      "vco1.oct"
kmodd       chnget      "vco1.modd"
kcpsmod	    inletk		"vco1.modin"
;       ADSR envelope
iattack     chnget      "env1.A"
idecay      chnget      "env1.D"
isustain    chnget      "env1.S"
irelease    chnget      "env1.R"
kenv 	    madsr       iattack, idecay, isustain, irelease

kcps        = p4 + ioct*12 + kmodd*kcpsmod*10
a1          vco2 .9, kcps                ; (sawtooth wave with default
parameters)
			outleta     "vco1out", a1*kenv
endin

this is the instrument that is triggered (I moved the env inside the instr)
but: 
it is monophonic now when triggered with event_i
and the sound does not stop, despite the envelope - it only gets softer

the triggering inst is now:

instr miditrig

inote   = p4
iamp    = ampdbfs(((p5 / 127) * 96) - 96)
icps    = cpsmidinn(inote)
		event_i "i", "vco1", 0, -1, icps, iamp
;		event_i "i", "env1", 0, -1
		event_i "i", "lfo1", 0, -1
endin

so i am still puzzled....
 




--
View this message in context: http://csound.1045644.n5.nabble.com/midi-trigger-instrument-tp5734211p5734220.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-04-14 21:35
FromTarmo Johannes
SubjectRe: [Csnd] Re: midi trigger instrument
Hi,

you start the note for infinite time but you need to also stop them. Something 
like

instr miditrig
....

kend release

if (kend==1) then
	turnoff2 "vco1",0,1
	turnoff2 "env1",0,1
	turnoff2 "lfo1",0,1
endif

endin


(untested code)

best!
tarmo


On Monday 14 April 2014 13:02:00 zappfinger wrote:
> nstr miditrig
> 
> inote   = p4
> iamp    = ampdbfs(((p5 / 127) * 96) - 96)
> icps    = cpsmidinn(inote)
>                 event_i "i", "vco1", 0, -1, icps, iamp
> ;               event_i "i", "env1", 0, -1
>                 event_i "i", "lfo1", 0, -1
> endin

Date2014-04-15 11:09
Fromzappfinger
Subject[Csnd] Re: midi trigger instrument
Thanks Tarmo, that seems to do it.
The only thing now is that I have no clue why the instrument has turned
monophonic - only one note at a time...  since the use of event_i.



--
View this message in context: http://csound.1045644.n5.nabble.com/midi-trigger-instrument-tp5734211p5734232.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2014-04-15 15:00
FromRory Walsh
SubjectRe: [Csnd] Re: midi trigger instrument
You could also try using subinstr? You wouldn't have to worry about
durations then as it would match the duration of your MIDI note/.

On 15 April 2014 11:09, zappfinger  wrote:
> Thanks Tarmo, that seems to do it.
> The only thing now is that I have no clue why the instrument has turned
> monophonic - only one note at a time...  since the use of event_i.
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/midi-trigger-instrument-tp5734211p5734232.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>
>

Date2014-04-15 16:10
FromTarmo Johannes
SubjectRe: [Csnd] Re: midi trigger instrument

yes,
subinstr would.sole also the problem of monophony.
tarmo

2014 4 15 17:00 kirjutas kuupäeval "Rory Walsh" <rorywalsh@ear.ie>:
You could also try using subinstr? You wouldn't have to worry about
durations then as it would match the duration of your MIDI note/.

On 15 April 2014 11:09, zappfinger <zappfinger@gmail.com> wrote:
> Thanks Tarmo, that seems to do it.
> The only thing now is that I have no clue why the instrument has turned
> monophonic - only one note at a time...  since the use of event_i.
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/midi-trigger-instrument-tp5734211p5734232.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>
>


Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




Date2014-04-15 17:33
Fromzappfinger
Subject[Csnd] Re: midi trigger instrument
I could not find any good examples of using subinstr like this, so I moved
the cpsmidinn to the vco and this works fine for me.
BTW there is a section in the Floss manual that talks about using subinstr,
but it is not using this opcode at all..

http://en.flossmanuals.net/csound/ch023_a-additive-synthesis/



--
View this message in context: http://csound.1045644.n5.nabble.com/midi-trigger-instrument-tp5734211p5734243.html
Sent from the Csound - General mailing list archive at Nabble.com.