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

		curvoice.time = maxtime;
		s = {
			type: C.STAVES,
			dur: 0
		}

		sym_link(s);		// link the staves in this voice
		par_sy.nstaff = nstaff;

		// if no parameter, duplicate the current staff system
		// and do a voice re-synchronization
		if (!parm) {
			s.sy = clone(par_sy, 2)		// clone the staves and voices
			par_sy.next = s.sy
			par_sy = s.sy
			staves_found = maxtime
			for (v = 0; v < nv; v++)
				voice_tb[v].time = maxtime
			curvoice = voice_tb[par_sy.top_voice]
			return
		}

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.279 second using v1.01-cache-2.11-cpan-0d8aa00de5b )