Csound Csound-dev Csound-tekno Search About

[Csnd] midi accumulator

Date2010-04-07 03:06
Fromkelly hirai
Subject[Csnd] midi accumulator
i'm having trouble counting midi activated instr 10 instances in the 
orch below. i can't get gkacc to move off of 0.  using cvs checkout from 
yesterday. compiled on fedora 10. global vars are the way to make data 
static in csound, no?

kelly hirai

sr = 44100
kr = 4410
ksmps = 10
nchnls = 2

gkacc init 0
             ;; recording event instrument ----------------------
instr 10
    gkacc=gkacc+1
    prints "%d", gkacc
endin

             ;; playback instrument ----------------------------
instr 11
endin

score:

i11 0 10
e

command and output:

/usr/local/bin/csound  -odac -M 1  test.orc test.sco
time resolution is 0.417 ns
PortMIDI real time MIDI plugin for Csound
PortAudio real-time audio module for Csound
0dBFS level = 32768.0
Csound version 5.12 beta (float samples) Apr  7 2010
libsndfile-1.0.20
orchname:  test.orc
scorename: test.sco
rtaudio: PortAudio module enabled ... using blocking interface
rtmidi: PortMIDI module enabled
orch compiler:
26 (26) lines read
 	instr	10
 	instr	11
Elapsed time at end of orchestra compile: real: 0.005s, CPU: 0.010s
sorting score ...
 	... done
Elapsed time at end of score sort: real: 0.007s, CPU: 0.010s
Csound version 5.12 beta (float samples) Apr  7 2010
midi channel 1 using instr 10
midi channel 2 using instr 10
midi channel 3 using instr 10
midi channel 4 using instr 10
midi channel 5 using instr 10
midi channel 6 using instr 10
midi channel 7 using instr 10
midi channel 8 using instr 10
midi channel 9 using instr 10
midi channel 10 using instr 10
midi channel 11 using instr 11
midi channel 12 using instr 10
midi channel 13 using instr 10
midi channel 14 using instr 10
midi channel 15 using instr 10
midi channel 16 using instr 10
graphics not supported on this terminal, ascii substituted
0dBFS level = 32768.0
The available MIDI in devices are:
    0: Midi Through Port-0 (ALSA)
    1: M Audio Delta 1010LT MIDI (ALSA)
    2: MPU-401 UART MIDI (ALSA)
PortMIDI: Activated input device 1: 'M Audio Delta 1010LT MIDI' (ALSA)
orch now loaded
audio buffered in 256 sample-frame blocks
Cannot connect to server socket err = No such file or directory
Cannot connect to server socket
jack server is not running or cannot be started
no message buffer overruns
PortAudio V19-devel (built Dec 10 2008)
PortAudio: available output devices:
    0: /dev/dsp
    1: M Audio Delta 1010LT: ICE1712 multi (hw:0,0)
    2: front
    3: surround40
    4: surround51
    5: iec958
    6: spdif
    7: default
    8: dmix
PortAudio: selected output device 'default'
writing 1024-byte blks of shorts to dac
SECTION 1:
new alloc for instr 11:
   rtevent:	   T  0.656 TT  0.656 M:      0.0      0.0
new alloc for instr 10:
0  rtevent:	   T  1.446 TT  1.446 M:      0.0      0.0
0  rtevent:	   T  1.446 TT  1.446 M:      0.0      0.0
   rtevent:	   T  2.148 TT  2.148 M:      0.0      0.0
00  rtevent:	   T  2.514 TT  2.514 M:      0.0      0.0
0  rtevent:	   T  2.856 TT  2.856 M:      0.0      0.0
0  rtevent:	   T  3.176 TT  3.176 M:      0.0      0.0
0  rtevent:	   T  3.176 TT  3.176 M:      0.0      0.0
   rtevent:	   T  3.495 TT  3.495 M:      0.0      0.0
0  rtevent:	   T  3.814 TT  3.814 M:      0.0      0.0
0  rtevent:	   T  4.156 TT  4.156 M:      0.0      0.0
0  rtevent:	   T  4.156 TT  4.156 M:      0.0      0.0
   rtevent:	   T  4.429 TT  4.429 M:      0.0      0.0
0  rtevent:	   T  4.429 TT  4.429 M:      0.0      0.0
   rtevent:	   T  4.749 TT  4.749 M:      0.0      0.0
0  rtevent:	   T  4.749 TT  4.749 M:      0.0      0.0
^CCsound tidy up: Interrupt
Early return from csoundPerform().
inactive allocs returned to freespace
end of score.		   overall amps:      0.0      0.0
 	   overall samples out of range:        0        0
0 errors in performance
Elapsed time at end of performance: real: 7.023s, CPU: 0.580s
1025 1024-byte soundblks of shorts written to dac
Pt_Stop called
Removing temporary file /tmp/csound-VqRrmV.srt ...
[khirai@kgh drumlooper]$



Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2010-04-08 09:41
FromIain McCurdy
Subject[Csnd] RE: midi accumulator
Your counter should probably be i-rate. This works as you want:

<CsInstruments>

sr = 44100
kr = 4410
ksmps = 10
nchnls = 2
 
massign 0,10

giacc init 0
             ;; recording event instrument ----------------------
instr 10
    giacc=giacc+1
    prints "%d", giacc
endin
 
             ;; playback instrument ----------------------------
instr 11
endin
 

</CsInstruments>

<CsScore>
i11 0 10
e
</CsScore>


> Date: Tue, 6 Apr 2010 22:06:36 -0400
> From: khirai@ongaku.isa-geek.net
> To: csound@lists.bath.ac.uk
> Subject: [Csnd] midi accumulator
>
> i'm having trouble counting midi activated instr 10 instances in the
> orch below. i can't get gkacc to move off of 0. using cvs checkout from
> yesterday. compiled on fedora 10. global vars are the way to make data
> static in csound, no?
>
> kelly hirai
>
> sr = 44100
> kr = 4410
> ksmps = 10
> nchnls = 2
>
> gkacc init 0
> ;; recording event instrument ----------------------
> instr 10
> gkacc=gkacc+1
> prints "%d", gkacc
> endin
>
> ;; playback instrument ----------------------------
> instr 11
> endin
>
> score:
>
> i11 0 10
> e
>
> command and output:
>
> /usr/local/bin/csound -odac -M 1 test.orc test.sco
> time resolution is 0.417 ns
> PortMIDI real time MIDI plugin for Csound
> PortAudio real-time audio module for Csound
> 0dBFS level = 32768.0
> Csound version 5.12 beta (float samples) Apr 7 2010
> libsndfile-1.0.20
> orchname: test.orc
> scorename: test.sco
> rtaudio: PortAudio module enabled ... using blocking interface
> rtmidi: PortMIDI module enabled
> orch compiler:
> 26 (26) lines read
> instr 10
> instr 11
> Elapsed time at end of orchestra compile: real: 0.005s, CPU: 0.010s
> sorting score ...
> ... done
> Elapsed time at end of score sort: real: 0.007s, CPU: 0.010s
> Csound version 5.12 beta (float samples) Apr 7 2010
> midi channel 1 using instr 10
> midi channel 2 using instr 10
> midi channel 3 using instr 10
> midi channel 4 using instr 10
> midi channel 5 using instr 10
> midi channel 6 using instr 10
> midi channel 7 using instr 10
> midi channel 8 using instr 10
> midi channel 9 using instr 10
> midi channel 10 using instr 10
> midi channel 11 using instr 11
> midi channel 12 using instr 10
> midi channel 13 using instr 10
> midi channel 14 using instr 10
> midi channel 15 using instr 10
> midi channel 16 using instr 10
> graphics not supported on this terminal, ascii substituted
> 0dBFS level = 32768.0
> The available MIDI in devices are:
> 0: Midi Through Port-0 (ALSA)
> 1: M Audio Delta 1010LT MIDI (ALSA)
> 2: MPU-401 UART MIDI (ALSA)
> PortMIDI: Activated input device 1: 'M Audio Delta 1010LT MIDI' (ALSA)
> orch now loaded
> audio buffered in 256 sample-frame blocks
> Cannot connect to server socket err = No such file or directory
> Cannot connect to server socket
> jack server is not running or cannot be started
> no message buffer overruns
> PortAudio V19-devel (built Dec 10 2008)
> PortAudio: available output devices:
> 0: /dev/dsp
> 1: M Audio Delta 1010LT: ICE1712 multi (hw:0,0)
> 2: front
> 3: surround40
> 4: surround51
> 5: iec958
> 6: spdif
> 7: default
> 8: dmix
> PortAudio: selected output device 'default'
> writing 1024-byte blks of shorts to dac
> SECTION 1:
> new alloc for instr 11:
> rtevent: T 0.656 TT 0.656 M: 0.0 0.0
> new alloc for instr 10:
> 0 rtevent: T 1.446 TT 1.446 M: 0.0 0.0
> 0 rtevent: T 1.446 TT 1.446 M: 0.0 0.0
> rtevent: T 2.148 TT 2.148 M: 0.0 0.0
> 00 rtevent: T 2.514 TT 2.514 M: 0.0 0.0
> 0 rtevent: T 2.856 TT 2.856 M: 0.0 0.0
> 0 rtevent: T 3.176 TT 3.176 M: 0.0 0.0
> 0 rtevent: T 3.176 TT 3.176 M: 0.0 0.0
> rtevent: T 3.495 TT 3.495 M: 0.0 0.0
> 0 rtevent: T 3.814 TT 3.814 M: 0.0 0.0
> 0 rtevent: T 4.156 TT 4.156 M: 0.0 0.0
> 0 rtevent: T 4.156 TT 4.156 M: 0.0 0.0
> rtevent: T 4.429 TT 4.429 M: 0.0 0.0
> 0 rtevent: T 4.429 TT 4.429 M: 0.0 0.0
> rtevent: T 4.749 TT 4.749 M: 0.0 0.0
> 0 rtevent: T 4.749 TT 4.749 M: 0.0 0.0
> ^CCsound tidy up: Interrupt
> Early return from csoundPerform().
> inactive allocs returned to freespace
> end of score. overall amps: 0.0 0.0
> overall samples out of range: 0 0
> 0 errors in performance
> Elapsed time at end of performance: real: 7.023s, CPU: 0.580s
> 1025 1024-byte soundblks of shorts written to dac
> Pt_Stop called
> Removing temporary file /tmp/csound-VqRrmV.srt ...
> [khirai@kgh drumlooper]$
>
>
>
> Send bugs reports to the Sourceforge bug tracker
> https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>


Get a free e-mail account with Hotmail. Sign-up now.

Date2010-04-08 12:58
FromAndres Cabrera
Subject[Csnd] Re: midi accumulator
Hi,

Your problem is that while gkacc is correctly summing at k-rate,
prints is an i-rate opcode, so you only see the value when the note is
initialized. You can use something like printks.

Cheers,
Andrés

On Wed, Apr 7, 2010 at 3:06 AM, kelly  hirai  wrote:
> i'm having trouble counting midi activated instr 10 instances in the orch
> below. i can't get gkacc to move off of 0.  using cvs checkout from
> yesterday. compiled on fedora 10. global vars are the way to make data
> static in csound, no?
>
> kelly hirai
>
> sr = 44100
> kr = 4410
> ksmps = 10
> nchnls = 2
>
> gkacc init 0
>            ;; recording event instrument ----------------------
> instr 10
>   gkacc=gkacc+1
>   prints "%d", gkacc
> endin
>
>            ;; playback instrument ----------------------------
> instr 11
> endin
>
> score:
>
> i11 0 10
> e
>
> command and output:
>
> /usr/local/bin/csound  -odac -M 1  test.orc test.sco
> time resolution is 0.417 ns
> PortMIDI real time MIDI plugin for Csound
> PortAudio real-time audio module for Csound
> 0dBFS level = 32768.0
> Csound version 5.12 beta (float samples) Apr  7 2010
> libsndfile-1.0.20
> orchname:  test.orc
> scorename: test.sco
> rtaudio: PortAudio module enabled ... using blocking interface
> rtmidi: PortMIDI module enabled
> orch compiler:
> 26 (26) lines read
>        instr   10
>        instr   11
> Elapsed time at end of orchestra compile: real: 0.005s, CPU: 0.010s
> sorting score ...
>        ... done
> Elapsed time at end of score sort: real: 0.007s, CPU: 0.010s
> Csound version 5.12 beta (float samples) Apr  7 2010
> midi channel 1 using instr 10
> midi channel 2 using instr 10
> midi channel 3 using instr 10
> midi channel 4 using instr 10
> midi channel 5 using instr 10
> midi channel 6 using instr 10
> midi channel 7 using instr 10
> midi channel 8 using instr 10
> midi channel 9 using instr 10
> midi channel 10 using instr 10
> midi channel 11 using instr 11
> midi channel 12 using instr 10
> midi channel 13 using instr 10
> midi channel 14 using instr 10
> midi channel 15 using instr 10
> midi channel 16 using instr 10
> graphics not supported on this terminal, ascii substituted
> 0dBFS level = 32768.0
> The available MIDI in devices are:
>   0: Midi Through Port-0 (ALSA)
>   1: M Audio Delta 1010LT MIDI (ALSA)
>   2: MPU-401 UART MIDI (ALSA)
> PortMIDI: Activated input device 1: 'M Audio Delta 1010LT MIDI' (ALSA)
> orch now loaded
> audio buffered in 256 sample-frame blocks
> Cannot connect to server socket err = No such file or directory
> Cannot connect to server socket
> jack server is not running or cannot be started
> no message buffer overruns
> PortAudio V19-devel (built Dec 10 2008)
> PortAudio: available output devices:
>   0: /dev/dsp
>   1: M Audio Delta 1010LT: ICE1712 multi (hw:0,0)
>   2: front
>   3: surround40
>   4: surround51
>   5: iec958
>   6: spdif
>   7: default
>   8: dmix
> PortAudio: selected output device 'default'
> writing 1024-byte blks of shorts to dac
> SECTION 1:
> new alloc for instr 11:
>  rtevent:         T  0.656 TT  0.656 M:      0.0      0.0
> new alloc for instr 10:
> 0  rtevent:        T  1.446 TT  1.446 M:      0.0      0.0
> 0  rtevent:        T  1.446 TT  1.446 M:      0.0      0.0
>  rtevent:         T  2.148 TT  2.148 M:      0.0      0.0
> 00  rtevent:       T  2.514 TT  2.514 M:      0.0      0.0
> 0  rtevent:        T  2.856 TT  2.856 M:      0.0      0.0
> 0  rtevent:        T  3.176 TT  3.176 M:      0.0      0.0
> 0  rtevent:        T  3.176 TT  3.176 M:      0.0      0.0
>  rtevent:         T  3.495 TT  3.495 M:      0.0      0.0
> 0  rtevent:        T  3.814 TT  3.814 M:      0.0      0.0
> 0  rtevent:        T  4.156 TT  4.156 M:      0.0      0.0
> 0  rtevent:        T  4.156 TT  4.156 M:      0.0      0.0
>  rtevent:         T  4.429 TT  4.429 M:      0.0      0.0
> 0  rtevent:        T  4.429 TT  4.429 M:      0.0      0.0
>  rtevent:         T  4.749 TT  4.749 M:      0.0      0.0
> 0  rtevent:        T  4.749 TT  4.749 M:      0.0      0.0
> ^CCsound tidy up: Interrupt
> Early return from csoundPerform().
> inactive allocs returned to freespace
> end of score.              overall amps:      0.0      0.0
>           overall samples out of range:        0        0
> 0 errors in performance
> Elapsed time at end of performance: real: 7.023s, CPU: 0.580s
> 1025 1024-byte soundblks of shorts written to dac
> Pt_Stop called
> Removing temporary file /tmp/csound-VqRrmV.srt ...
> [khirai@kgh drumlooper]$
>
>
>
> Send bugs reports to the Sourceforge bug tracker
>           https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>



-- 


Andrés


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"


Date2010-04-08 20:44
Fromthorin kerr
Subject[Csnd] Re: midi accumulator
The 'active' opcode might be useful for you.

http://www.csounds.com/manual/html/active.html


On Wed, Apr 7, 2010 at 12:06 PM, kelly  hirai
 wrote:
> i'm having trouble counting midi activated instr 10 instances in the orch
> below. i can't get gkacc to move off of 0.  using cvs checkout from
> yesterday. compiled on fedora 10. global vars are the way to make data
> static in csound, no?
>
> kelly hirai
>
> sr = 44100
> kr = 4410
> ksmps = 10
> nchnls = 2
>
> gkacc init 0
>            ;; recording event instrument ----------------------
> instr 10
>   gkacc=gkacc+1
>   prints "%d", gkacc
> endin
>
>            ;; playback instrument ----------------------------
> instr 11
> endin
>
> score:
>
> i11 0 10
> e
>
> command and output:
>
> /usr/local/bin/csound  -odac -M 1  test.orc test.sco
> time resolution is 0.417 ns
> PortMIDI real time MIDI plugin for Csound
> PortAudio real-time audio module for Csound
> 0dBFS level = 32768.0
> Csound version 5.12 beta (float samples) Apr  7 2010
> libsndfile-1.0.20
> orchname:  test.orc
> scorename: test.sco
> rtaudio: PortAudio module enabled ... using blocking interface
> rtmidi: PortMIDI module enabled
> orch compiler:
> 26 (26) lines read
>        instr   10
>        instr   11
> Elapsed time at end of orchestra compile: real: 0.005s, CPU: 0.010s
> sorting score ...
>        ... done
> Elapsed time at end of score sort: real: 0.007s, CPU: 0.010s
> Csound version 5.12 beta (float samples) Apr  7 2010
> midi channel 1 using instr 10
> midi channel 2 using instr 10
> midi channel 3 using instr 10
> midi channel 4 using instr 10
> midi channel 5 using instr 10
> midi channel 6 using instr 10
> midi channel 7 using instr 10
> midi channel 8 using instr 10
> midi channel 9 using instr 10
> midi channel 10 using instr 10
> midi channel 11 using instr 11
> midi channel 12 using instr 10
> midi channel 13 using instr 10
> midi channel 14 using instr 10
> midi channel 15 using instr 10
> midi channel 16 using instr 10
> graphics not supported on this terminal, ascii substituted
> 0dBFS level = 32768.0
> The available MIDI in devices are:
>   0: Midi Through Port-0 (ALSA)
>   1: M Audio Delta 1010LT MIDI (ALSA)
>   2: MPU-401 UART MIDI (ALSA)
> PortMIDI: Activated input device 1: 'M Audio Delta 1010LT MIDI' (ALSA)
> orch now loaded
> audio buffered in 256 sample-frame blocks
> Cannot connect to server socket err = No such file or directory
> Cannot connect to server socket
> jack server is not running or cannot be started
> no message buffer overruns
> PortAudio V19-devel (built Dec 10 2008)
> PortAudio: available output devices:
>   0: /dev/dsp
>   1: M Audio Delta 1010LT: ICE1712 multi (hw:0,0)
>   2: front
>   3: surround40
>   4: surround51
>   5: iec958
>   6: spdif
>   7: default
>   8: dmix
> PortAudio: selected output device 'default'
> writing 1024-byte blks of shorts to dac
> SECTION 1:
> new alloc for instr 11:
>  rtevent:         T  0.656 TT  0.656 M:      0.0      0.0
> new alloc for instr 10:
> 0  rtevent:        T  1.446 TT  1.446 M:      0.0      0.0
> 0  rtevent:        T  1.446 TT  1.446 M:      0.0      0.0
>  rtevent:         T  2.148 TT  2.148 M:      0.0      0.0
> 00  rtevent:       T  2.514 TT  2.514 M:      0.0      0.0
> 0  rtevent:        T  2.856 TT  2.856 M:      0.0      0.0
> 0  rtevent:        T  3.176 TT  3.176 M:      0.0      0.0
> 0  rtevent:        T  3.176 TT  3.176 M:      0.0      0.0
>  rtevent:         T  3.495 TT  3.495 M:      0.0      0.0
> 0  rtevent:        T  3.814 TT  3.814 M:      0.0      0.0
> 0  rtevent:        T  4.156 TT  4.156 M:      0.0      0.0
> 0  rtevent:        T  4.156 TT  4.156 M:      0.0      0.0
>  rtevent:         T  4.429 TT  4.429 M:      0.0      0.0
> 0  rtevent:        T  4.429 TT  4.429 M:      0.0      0.0
>  rtevent:         T  4.749 TT  4.749 M:      0.0      0.0
> 0  rtevent:        T  4.749 TT  4.749 M:      0.0      0.0
> ^CCsound tidy up: Interrupt
> Early return from csoundPerform().
> inactive allocs returned to freespace
> end of score.              overall amps:      0.0      0.0
>           overall samples out of range:        0        0
> 0 errors in performance
> Elapsed time at end of performance: real: 7.023s, CPU: 0.580s
> 1025 1024-byte soundblks of shorts written to dac
> Pt_Stop called
> Removing temporary file /tmp/csound-VqRrmV.srt ...
> [khirai@kgh drumlooper]$
>
>
>
> Send bugs reports to the Sourceforge bug tracker
>           https://sourceforge.net/tracker/?group_id=81968&atid=564599
> 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 the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"