Csound Csound-dev Csound-tekno Search About

[Csnd] Re: soft midi connections, linux

Date2008-09-02 03:05
From" Partev Barr Sarkissian"
Subject[Csnd] Re: soft midi connections, linux
Hi guys,
Won't this-

asig    =    a1+a2+a3   kenv    linenr    1,.07,.11,.01
  out    asig*kenv

come up as a "used before defined" in the render/compile display?
Doesn't "kenv" need to be declared or defined first?
Or am I missing something?
I ask because I get the "used before defined" messages 
when I go to render something in an incorrect order,
due to not declaring or defining ahead of time.

-Partev



-----------------------------------------------------------------------------------------------------------------------




From:  	"Andres Cabrera" 
Reply-To:  	csound@lists.bath.ac.uk
To:  	csound@lists.bath.ac.uk
Subject:  	[Csnd] Re: Re: Re: Re: soft midi connections, linux
Date:  	Mon 09/01/08 03:05 PM
 
Hi Victor,

You may also need to modprobe snd-virmidi, if it's not loaded by default. I have also used this mechanism sucesfully.

Cheers,
Andrés


On Mon, Sep 1, 2008 at 8:13 AM, Dave Phillips  wrote:
victor wrote:
No, just lazy and wanting to know how to do it without having to
experiment. So how do you do this, please? 
As you know, Csound makes its own MIDI connections, so if you want to drive it from a sequencer you'll use aconnect to hook the sequencer to the input port designated by the -M option (see below).

Here's an old and simple CSD for MIDI input. In this example I use an external MIDI keyboard (connected to Live's hardware MIDI In port) to play the synthesizer :




;;; Set -M to some ridiculous value to see a list of available numbered MIDI input devices.
;;; At -M100 my system reports that these devices exist for use with that option:

; The available MIDI in devices are:
;    0: EMU10K1 MPU-401 (UART) (ALSA)
;    1: VirMIDI 1-0 (ALSA)
;    2: VirMIDI 1-1 (ALSA)
;    3: VirMIDI 1-2 (ALSA)
;    4: VirMIDI 1-3 (ALSA)

;;; In the following instance I've selected the external MIDI port on my SBLive
;;; for MIDI input and the default audio output device:

-+rtmidi=pm -M0 -o dac -d -m0





  instr 1
iamp    ampmidi    5000
kfreq    cpsmidib
kmod    midictrl    1,0,10    ; Mod wheel controls vibrato depth and rate.
irate    veloc    1,10        ; This idea shamelessly stolen from J. Bohn's Csound tutorial
kvib    oscil    kmod, irate, 1    ; at http://www.bohnmedia.com/jbohn/csound/index.html.
a1    oscili    iamp,kfreq+kvib,2
a2    oscili    iamp,(kfreq*1.003)+kvib,3
a3    oscili    iamp,(kfreq*.997)+kvib,4
asig    =    a1+a2+a3   kenv    linenr    1,.07,.11,.01
  out    asig*kenv
  endin



; ==============================================


f1 0 8192 10 .1 0 .2 0 0 .4 0 0 0 0 .8
f2 0 8192 10 1 0 .9 0 0 .7 0 0 0 .4
f3 0 8192 10 .5 0 .6 0 0 .3 0 0 0 .9
f4 0 8192 10 .9 0 .3 0 0 .6 0 0 0 .5
f0 10000
e





Victor, let me know if this example works for you or if I've misunderstood your question. :)


Best,

dp



_____________________________________________________________
Netscape.  Just the Net You Need.

Date2008-09-02 05:20
FromJoseph Sanger
Subject[Csnd] Re: Re: soft midi connections, linux
I think that there should be a line break between a3 and kenv

  Partev Barr Sarkissian wrote:
> Hi guys,
> Won't this-
> 
> asig    =    a1+a2+a3   kenv    linenr    1,.07,.11,.01
>   out    asig*kenv
> 
> come up as a "used before defined" in the render/compile display?
> Doesn't "kenv" need to be declared or defined first?
> Or am I missing something?
> I ask because I get the "used before defined" messages 
> when I go to render something in an incorrect order,
> due to not declaring or defining ahead of time.
> 
> -Partev
> 
> 
> 
> -----------------------------------------------------------------------------------------------------------------------
> 
> 
> 
> 
> From:  	"Andres Cabrera" 
> Reply-To:  	csound@lists.bath.ac.uk
> To:  	csound@lists.bath.ac.uk
> Subject:  	[Csnd] Re: Re: Re: Re: soft midi connections, linux
> Date:  	Mon 09/01/08 03:05 PM
>  
> Hi Victor,
> 
> You may also need to modprobe snd-virmidi, if it's not loaded by default. I have also used this mechanism sucesfully.
> 
> Cheers,
> Andrés
> 
> 
> On Mon, Sep 1, 2008 at 8:13 AM, Dave Phillips  wrote:
> victor wrote:
> No, just lazy and wanting to know how to do it without having to
> experiment. So how do you do this, please? 
> As you know, Csound makes its own MIDI connections, so if you want to drive it from a sequencer you'll use aconnect to hook the sequencer to the input port designated by the -M option (see below).
> 
> Here's an old and simple CSD for MIDI input. In this example I use an external MIDI keyboard (connected to Live's hardware MIDI In port) to play the synthesizer :
> 
> 
> 
> 
> ;;; Set -M to some ridiculous value to see a list of available numbered MIDI input devices.
> ;;; At -M100 my system reports that these devices exist for use with that option:
> 
> ; The available MIDI in devices are:
> ;    0: EMU10K1 MPU-401 (UART) (ALSA)
> ;    1: VirMIDI 1-0 (ALSA)
> ;    2: VirMIDI 1-1 (ALSA)
> ;    3: VirMIDI 1-2 (ALSA)
> ;    4: VirMIDI 1-3 (ALSA)
> 
> ;;; In the following instance I've selected the external MIDI port on my SBLive
> ;;; for MIDI input and the default audio output device:
> 
> -+rtmidi=pm -M0 -o dac -d -m0
> 
> 
> 
> 
> 
>   instr 1
> iamp    ampmidi    5000
> kfreq    cpsmidib
> kmod    midictrl    1,0,10    ; Mod wheel controls vibrato depth and rate.
> irate    veloc    1,10        ; This idea shamelessly stolen from J. Bohn's Csound tutorial
> kvib    oscil    kmod, irate, 1    ; at http://www.bohnmedia.com/jbohn/csound/index.html.
> a1    oscili    iamp,kfreq+kvib,2
> a2    oscili    iamp,(kfreq*1.003)+kvib,3
> a3    oscili    iamp,(kfreq*.997)+kvib,4
> asig    =    a1+a2+a3   kenv    linenr    1,.07,.11,.01
>   out    asig*kenv
>   endin
> 
> 
> 
> ; ==============================================
> 
> 
> f1 0 8192 10 .1 0 .2 0 0 .4 0 0 0 0 .8
> f2 0 8192 10 1 0 .9 0 0 .7 0 0 0 .4
> f3 0 8192 10 .5 0 .6 0 0 .3 0 0 0 .9
> f4 0 8192 10 .9 0 .3 0 0 .6 0 0 0 .5
> f0 10000
> e
> 
> 
> 
> 
> 
> Victor, let me know if this example works for you or if I've misunderstood your question. :)
> 
> 
> Best,
> 
> dp
> 
> 
> 
> _____________________________________________________________
> Netscape.  Just the Net You Need.
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

-- 
Joseph Sanger

Blueberry Eikaiwa
www.bbeikaiwa.com
joe@bbeikaiwa.com

Date2008-09-02 11:13
FromDave Phillips
Subject[Csnd] Re: Re: Re: soft midi connections, linux
Joseph Sanger wrote:
> I think that there should be a line break between a3 and kenv
>
>  
>>
>> asig    =    a1+a2+a3   kenv    linenr    1,.07,.11,.01
>>   out    asig*kenv
>>
>>
Indeed there should be. Sorry about that.

Best,

dp