Csound Csound-dev Csound-tekno Search About

[Csnd] Re: Strange segmentation error...

Date2009-02-25 19:10
Fromvictor
Subject[Csnd] Re: Strange segmentation error...
>From 'ctrl7' man page:

"ctrl7 differs from midic7 because it can be included in score-oriented 
instruments without Csound crashes. It also needs the additional parameter 
ichan containing the MIDI channel of the controller."

----- Original Message ----- 
From: "Anthony Palomba" 
To: 
Sent: Wednesday, February 25, 2009 6:53 PM
Subject: [Csnd] Strange segmentation error...


>I have a simple insturment that is calling midic7 to fill in
> some variables. When ever I try to execute the code below,
> I get the following error: "Csound tidy up: Segmentation violation".
>
> When I remove the sections that call midic7 it seems to play.
> I made sure I was using a proper MIDI port. Does anyone have any ideas why 
> it might be doing that?
>
> I am running Csound 5.10...
>
>
>
>
>
> 
> 
> 
> 
>
> ; Initialize the global variables.
> sr = 44100
> kr = 4410
> ksmps = 10
> nchnls = 2
>
> massign 0, 0 ; Disable default MIDI assignments.
> massign 1, 1 ; Assign MIDI channel 1 to instr 1.
>
> ; Initialize MIDI control values. initc7 1, 1, 0
> initc7 1, 2, .5
> initc7 1, 3, .25
> initc7 1, 4, .2
>
> kvib init 0
> iCps init 400
> iAmp init 30000
> ; Simple ocsil instrument instr 1
>
> ; our in put signals
> ;ainL inch 1
> ;ainR inch 2
>
> iCps cpsmidi
> iAmp veloc 0, 30000
>
>
> ; Read in MIDI cc's as normalized [0,1] values.
> iAtk midic7 1, 0, 1
> iDec midic7 2, 0, 1
> iSus midic7 3, 0, 1
> iRel midic7 4, 0, 1
>  ; Make the MIDI knobs behave exponentially by squaring,
> ; then multiply by max length in seconds.
> iAtk = iAtk * iAtk * 3 + .001
> iDec = iDec * iDec * 3 + .001
> iSus = iSus * iSus + .001
> iRel = iRel * iRel * 4 + .001
>
>  ; generate our compisite signal
> a1 oscili 5000, 400, 1
> outch 1, a1, 2, a1
>
> endin
>
>
> 
> 
>
> ; Table #1, a sine wave.
> f 1 0 128 10 1
>
> ; Play Instrument #1 for two seconds.
> ; 1 0 86400
> i 1 0 3
> e
>
>
> 
> 
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe 
> csound" 


Date2009-02-27 04:19
From"Anthony Palomba"
Subject[Csnd] Re: Re: Strange segmentation error...
Working now, thanks Victor!




Anthony


----- Original Message ----- 
From: "victor" 
To: 
Sent: Wednesday, February 25, 2009 1:10 PM
Subject: [Csnd] Re: Strange segmentation error...


> From 'ctrl7' man page:
>
> "ctrl7 differs from midic7 because it can be included in score-oriented 
> instruments without Csound crashes. It also needs the additional parameter 
> ichan containing the MIDI channel of the controller."
>
> ----- Original Message ----- 
> From: "Anthony Palomba" 
> To: 
> Sent: Wednesday, February 25, 2009 6:53 PM
> Subject: [Csnd] Strange segmentation error...
>
>
>>I have a simple insturment that is calling midic7 to fill in
>> some variables. When ever I try to execute the code below,
>> I get the following error: "Csound tidy up: Segmentation violation".
>>
>> When I remove the sections that call midic7 it seems to play.
>> I made sure I was using a proper MIDI port. Does anyone have any ideas 
>> why it might be doing that?
>>
>> I am running Csound 5.10...
>>
>>
>>
>>
>>
>> 
>> 
>> 
>> 
>>
>> ; Initialize the global variables.
>> sr = 44100
>> kr = 4410
>> ksmps = 10
>> nchnls = 2
>>
>> massign 0, 0 ; Disable default MIDI assignments.
>> massign 1, 1 ; Assign MIDI channel 1 to instr 1.
>>
>> ; Initialize MIDI control values. initc7 1, 1, 0
>> initc7 1, 2, .5
>> initc7 1, 3, .25
>> initc7 1, 4, .2
>>
>> kvib init 0
>> iCps init 400
>> iAmp init 30000
>> ; Simple ocsil instrument instr 1
>>
>> ; our in put signals
>> ;ainL inch 1
>> ;ainR inch 2
>>
>> iCps cpsmidi
>> iAmp veloc 0, 30000
>>
>>
>> ; Read in MIDI cc's as normalized [0,1] values.
>> iAtk midic7 1, 0, 1
>> iDec midic7 2, 0, 1
>> iSus midic7 3, 0, 1
>> iRel midic7 4, 0, 1
>>  ; Make the MIDI knobs behave exponentially by squaring,
>> ; then multiply by max length in seconds.
>> iAtk = iAtk * iAtk * 3 + .001
>> iDec = iDec * iDec * 3 + .001
>> iSus = iSus * iSus + .001
>> iRel = iRel * iRel * 4 + .001
>>
>>  ; generate our compisite signal
>> a1 oscili 5000, 400, 1
>> outch 1, a1, 2, a1
>>
>> endin
>>
>>
>> 
>> 
>>
>> ; Table #1, a sine wave.
>> f 1 0 128 10 1
>>
>> ; Play Instrument #1 for two seconds.
>> ; 1 0 86400
>> i 1 0 3
>> e
>>
>>
>> 
>> 
>>
>>
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe 
>> csound"
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe 
> csound"
>