App-Music-ChordPro
view release on metacpan or search on metacpan
lib/ChordPro/res/abc/abc2svg/abc2svg-1.js view on Meta::CPAN
n = bar_num + (tim - bar_tim) / wmeasure
k = n - (n | 0)
if (cfmt.checkbars
&& k
&& check_meas())
error(0, s, "Bad measure duration")
if (tim > ptim + wmeasure) { // if more than one measure
n |= 0
k = 0
bar_tim = tim // re-synchronize
bar_num = n
}
if (txt) {
if (txt[0] == '1') {
if (!cfmt.contbarnb)
rep_tim = tim - bar_tim
if (!nu)
s.bar_num = n
} else {
lib/ChordPro/res/abc/abc2svg/abc2svg-1.js view on Meta::CPAN
if (p_voice.time > maxtime)
maxtime = p_voice.time
}
if (!maxtime) { // if first %%staves
par_sy.staves = []
par_sy.voices = []
} else {
// if (nv) // if many voices
self.voice_adj(1)
// synchronize the voices
for (v = 0; v < nv; v++) {
p_voice = voice_tb[v]
//fixme: does not work if measure bar and %%staves delta time < measure duration
if (maxtime - p_voice.time >= p_voice.meter.wmeasure)
p_voice.acc = [] // no accidental anymore
p_voice.time = maxtime
p_voice.lyric_restart = p_voice.last_sym
p_voice.sym_restart = p_voice.last_sym
}
lib/ChordPro/res/abc/abc2svg/cmdline.js view on Meta::CPAN
// convert the file content into a Unix string
i = file.indexOf('\r')
if (i >= 0) {
if (file[i + 1] == '\n')
file = file.replace(/\r\n/g, '\n') // M$
else
file = file.replace(/\r/g, '\n') // Mac
}
// load the required modules (synchronous)
abc2svg.modules.load(file)
return file
},
errtxt: '',
errmsg: // print or store the error messages
typeof abc2svg.printErr == 'function'
? function(msg, l, c) { abc2svg.printErr(msg) }
: function(msg, l, c) { user.errtxt += msg + '\n' }
} // user
lib/ChordPro/res/abc/abc2svg/grid-1.js view on Meta::CPAN
}
} else {
if (!i) // if not normal measure bar
break
chords.push(chord)
bars.push(bt)
}
if (chord.length)
some_chord++
chord = []
cur_beat = s.time // synchronize in case of error
beat_i = 0
if (bt.indexOf(':') >= 0)
rep = true // some repeat
break
case C.METER:
beat = get_beat(s)
wm = s.wmeasure
break
}
}
lib/ChordPro/res/abc/abc2svg/nns-1.js view on Meta::CPAN
} else {
bars[0] = bt
}
} else {
if (!s.bar_num) // if not normal measure bar
break
chords.push(chord)
bars.push(bt)
}
chord = []
cur_beat = s.time // synchronize in case of error
beat_i = 0
if (bt.indexOf(':') >= 0)
rep = true // some repeat
while (s.ts_next && s.ts_next.type == C.BAR)
s = s.ts_next
break
case C.METER:
beat = get_beat(s)
wm = s.wmeasure
break
lib/ChordPro/res/abc/cmd.js view on Meta::CPAN
// convert the file content into a Unix string
i = file.indexOf('\r')
if (i >= 0) {
if (file[i + 1] == '\n')
file = file.replace(/\r\n/g, '\n') // M$
else
file = file.replace(/\r/g, '\n') // Mac
}
// load the required modules (synchronous)
abc2svg.modules.load(file)
return file
},
errtxt: '',
errmsg: // print or store the error messages
typeof abc2svg.printErr == 'function'
? function(msg, l, c) { abc2svg.printErr(msg) }
: function(msg, l, c) { user.errtxt += msg + '\n' }
} // user
( run in 0.711 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )