Audio-Nama

 view release on metacpan or  search on metacpan

lib/Audio/Nama.pm  view on Meta::CPAN

		eval_dest_track $dest_track;
		let cur_track = [gett];
		let cur_pos = [getpos];
		let start_pos = [eval_pos $start_position];
		g $start_pos
		sel $copy_measures;
		tcopy;
		ct $dest_track;
		g $dest_position;
		tpaste;
		ct $cur_track;
		g $cur_pos;
		return 1;
	} else {
		return 0;
	}
}

# Copy copy_measures from start_position on the current track to dest_position
# on the current track.
# No action is taken if the two areas overlap.
# example:
#  icopym now 8 52 # copy 16 measures from current position to measure 52
proc icopym start_position copy_measures dest_position {
	if [eval_cur_track] {
		let cur_track = [gett];
		let start_pos = [eval_pos $start_position];
		let end_pos = $start_pos + $copy_measures;
		if [eval_positive $end_pos $dest_position] {
			return [ccopym $start_position $copy_measures $cur_track $dest_position];
		} else {
			print "Copy interval will overlap.";
			print "Too many measures to copy or destination position too early.";
			return 0;
		}
	} else {
		return 0;
	}
}

# Copy everything between start_position and end_position from current track
# to dest_track at measure dest_position.
# Example:
# 	ccopy 2 end piano 17 # copy from measure 2 to end of song to piano
# 	                     # at measure 17
proc ccopy start_position end_position dest_track dest_position {
	let start_pos = [eval_pos $start_position];
	let end_pos = [eval_pos $end_position];
	if [eval_positive $start_pos $end_pos] {
		let copy_measures = $end_pos - $start_pos;
		return [ccopym $start_pos $copy_measures $dest_track $dest_position];
	} else {
		return 0;
	}
}

# Copy everything from start_position to end_position on the current track to
# destination position on the current track.
# If the intervals overlap, nothing will happen.
# example:
# 	icopy 2 10 24 # copy measures 2 to 10 to measure 24 on the current track
proc icopy start_position end_position dest_position {
	if [eval_cur_track] {
		let cur_track = [gett];
		let end_pos = [eval_pos $end_position];
		if [eval_positive $end_position $dest_position] {
			return [ccopy $start_position $end_position $cur_track $dest_position];
		} else {
			print "Copy intervals overlap.";
			print "Copy interval is too long or";
			print "destination position is too early.";
			return 0;
		}
	} else {
		return 0;
	}
}
# Copy copy_measures from src_track starting at start_position to
# dest_track at dest_position.
# Example:
# 	copym piano now 8 clav 16
proc copym src_track start_position copy_measures dest_track dest_position {
	if [eval_track $src_track] {
		let cur_track = [gett];
		ct $src_track;
		let cur_return_value = [ccopym $start_position $copy_measures $dest_track $dest_position];
		sec_ct $cur_track;
		return $cur_return_value;
	} else {
		return 0;
	}
}

# Copy everything between start_position and end_position from src_track to
# dest_track at dest_position.
# Example:
# 	copy piano 6 end clav now
proc copy src_track start_position end_position dest_track dest_position {
	if [eval_track $src_track] {
		let cur_track = [gett];
		ct $src_track;
		let cur_return_value = [ccopy $start_position $end_position $dest_track $dest_position];
		sec_ct $cur_track;
		return $cur_return_value;
	} else {
		return 0;
	}
}

# Copy everything recorded on the current track on channel channelnumber to
# dest_track
# Example:
# 	tnew manual
# 	tnew pedals
# 	tnew organ
# 	r # record on organ
# 	s
# 	cchdup 0 manual
# 	cchdup 1 pedals
proc cchdup channelnumber dest_track {
	if [eval_cur_track] {



( run in 1.478 second using v1.01-cache-2.11-cpan-5a3173703d6 )