Csound Csound-dev Csound-tekno Search About

[Csnd] Irregular metronome

Date2023-04-04 10:54
FromEnrico Francioni <00000005323c8739-dmarc-request@LISTSERV.HEANET.IE>
Subject[Csnd] Irregular metronome
Hi everyone,

I ask for help
I would like to design a somewhat particular metronome: a metronome that always beats a given bpm (eg 53 MM), but which occasionally has short irregularities; the irregularities all have a precise action time and duration, therefore not random.

I know how to make a metronome, but a metronome with this particular feature, at the moment I'm not able.

The only idea that came to me was to fix all the players step by step in the score
i Statements of the instrument that manages the metronome…



here is an example:

 
 

sr	=	44100 
kr	=	44100
nchnls = 2 
nchnls_i = 1
0dbfs = 1 

instr 1 

iamp = ampdb(p7-12)
ibps = round(6000/p4)*.01
acotral mpulse iamp*.7, ibps 
ametro resonz acotral, p6, p6*.01 
outs ametro, ametro 

endin 

 
 
;	at  		dur 		bpm   measure   freq   amp 
;first staff
i1	0   		2   		120      1          3210	  -6
i.	2   		.25		240      .           .	. 
i.	2.25 		2   		120      .           .	.
i.	4.25 		.375		480      .           .	.
i.	4.625  	8.5		120      .           .	.
i.	13.125 	.375		480      .           .	.
i.	13.5 		1.5   	120      .           .	.

;second staff
; etc…

e

 
 


Any other ideas?
k

Csound mailing list
Csound@listserv.heanet.ie
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

Date2023-04-04 12:08
FromST Music
SubjectRe: [Csnd] Irregular metronome
I'm not sure I understand precisely what you mean, but have you considered a table or array to hold the rhythmic durations? In this example 1 = 1 beat, .25 = sixteenth note etc.

</CsOptions>
<CsInstruments>

sr      =       44100
kr      =       44100
nchnls = 2
nchnls_i = 1
0dbfs = 1

gkcount init -1

instr trigger
ibpm = 120
ibeat = 60/120
irhythm[] fillarray 1, 1, 1, 1, .25, .25, .25, .75, 1, .75, .5, .25 
ilen = lenarray(irhythm)
ktrig  metro 1/ibeat/irhythm[gkcount]
schedkwhen ktrig, 0, 0, 1, 0, .1

    if  ktrig == 1 then
        gkcount += 1
    endif
    
    if  gkcount == ilen then
        gkcount = 0
    endif

endin

instr 1
kenv linseg 0, .002, .2, .1, 0
ametro  oscil kenv, 3210
outs ametro, ametro
endin

</CsInstruments>
<CsScore>
i"trigger"  0  16       
e
</CsScore>
</CsoundSynthesizer>

This will adapt to any bpm value you enter. Perhaps not the best solution, maybe someone else has easier solution.

Scott


On Tue, Apr 4, 2023, 5:49 AM Enrico Francioni, <00000005323c8739-dmarc-request@listserv.heanet.ie> wrote:
Hi everyone,

I ask for help
I would like to design a somewhat particular metronome: a metronome that always beats a given bpm (eg 53 MM), but which occasionally has short irregularities; the irregularities all have a precise action time and duration, therefore not random.

I know how to make a metronome, but a metronome with this particular feature, at the moment I'm not able.

The only idea that came to me was to fix all the players step by step in the score
i Statements of the instrument that manages the metronome…



here is an example:

<CsoundSynthesizer>
<CsInstruments>

sr      =       44100
kr      =       44100
nchnls = 2
nchnls_i = 1
0dbfs = 1

instr 1

iamp = ampdb(p7-12)
ibps = round(6000/p4)*.01
acotral mpulse iamp*.7, ibps
ametro resonz acotral, p6, p6*.01
outs ametro, ametro

endin

</CsInstruments>
<CsScore>
;       at              dur             bpm   measure   freq   amp
;first staff
i1      0               2               120      1          3210          -6
i.      2               .25             240      .           .  .
i.      2.25            2               120      .           .  .
i.      4.25            .375            480      .           .  .
i.      4.625   8.5             120      .           .  .
i.      13.125  .375            480      .           .  .
i.      13.5            1.5     120      .           .  .

;second staff
; etc…

e

</CsScore>
</CsoundSynthesizer>


Any other ideas?
k

Csound mailing list
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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

Date2023-04-04 12:13
FromST Music
SubjectRe: [Csnd] Irregular metronome

On Tue, Apr 4, 2023, 7:08 AM ST Music, <stunes6556@gmail.com> wrote:
I'm not sure I understand precisely what you mean, but have you considered a table or array to hold the rhythmic durations? In this example 1 = 1 beat, .25 = sixteenth note etc.

</CsOptions>
<CsInstruments>

sr      =       44100
kr      =       44100
nchnls = 2
nchnls_i = 1
0dbfs = 1

gkcount init -1

instr trigger
ibpm = 120
ibeat = 60/120
irhythm[] fillarray 1, 1, 1, 1, .25, .25, .25, .75, 1, .75, .5, .25 
ilen = lenarray(irhythm)
ktrig  metro 1/ibeat/irhythm[gkcount]
schedkwhen ktrig, 0, 0, 1, 0, .1

    if  ktrig == 1 then
        gkcount += 1
    endif
    
    if  gkcount == ilen then
        gkcount = 0
    endif

endin

instr 1
kenv linseg 0, .002, .2, .1, 0
ametro  oscil kenv, 3210
outs ametro, ametro
endin

</CsInstruments>
<CsScore>
i"trigger"  0  16       
e
</CsScore>
</CsoundSynthesizer>

This will adapt to any bpm value you enter. Perhaps not the best solution, maybe someone else has easier solution.

Scott


On Tue, Apr 4, 2023, 5:49 AM Enrico Francioni, <00000005323c8739-dmarc-request@listserv.heanet.ie> wrote:
Hi everyone,

I ask for help
I would like to design a somewhat particular metronome: a metronome that always beats a given bpm (eg 53 MM), but which occasionally has short irregularities; the irregularities all have a precise action time and duration, therefore not random.

I know how to make a metronome, but a metronome with this particular feature, at the moment I'm not able.

The only idea that came to me was to fix all the players step by step in the score
i Statements of the instrument that manages the metronome…



here is an example:

<CsoundSynthesizer>
<CsInstruments>

sr      =       44100
kr      =       44100
nchnls = 2
nchnls_i = 1
0dbfs = 1

instr 1

iamp = ampdb(p7-12)
ibps = round(6000/p4)*.01
acotral mpulse iamp*.7, ibps
ametro resonz acotral, p6, p6*.01
outs ametro, ametro

endin

</CsInstruments>
<CsScore>
;       at              dur             bpm   measure   freq   amp
;first staff
i1      0               2               120      1          3210          -6
i.      2               .25             240      .           .  .
i.      2.25            2               120      .           .  .
i.      4.25            .375            480      .           .  .
i.      4.625   8.5             120      .           .  .
i.      13.125  .375            480      .           .  .
i.      13.5            1.5     120      .           .  .

;second staff
; etc…

e

</CsScore>
</CsoundSynthesizer>


Any other ideas?
k

Csound mailing list
Csound@listserv.heanet.ie
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 Csound@listserv.heanet.ie 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