[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:

<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
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

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.

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

i"trigger" 0 16 e

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

Scott

ST Music
https://soundcloud.com/stoons-1

https://youtube.com/channel/UCGhwmkS1uWmX6mhTIQ0IDsg

Sorry, it should be:

ibpm = 120
ibeat = 60/ibpm

Scott

ST Music
https://soundcloud.com/st-csound
https://soundcloud.com/stoons-1

https://youtube.com/channel/UCGhwmkS1uWmX6mhTIQ0IDsg