def entangle(p, ti):
	"""
		Entanglement operation discribed in Section 3.3 in the paper.
		[p_gamma p_beta] = p
		z = p_gamma * ti + p_beta
		Note that D = C * F and K = 2 * C * F

		Parameters
		----------
		p : tensor
			[B x (2*C) x T x F]
			the disentangled pitch representation

		ti : tensor
			[B x C x T x F]
			the disentangled timbre representation

		Returns
		---------
			: tensor
			[B x C x T x F]

	"""
	p_gamma = p[:, :ti.shape[1]]
	p_beta = p[:, ti.shape[1]:]
	return p_gamma * ti + p_beta