On Fri, 12 Jul 2013 08:30:14 +0200
"Sean M. Pappalardo - D.J. Pegasus" 
<spappalardo-opwvymzfgylytjvyw6y...@public.gmane.org> wrote:
> On 07/10/2013 09:51 PM, RJ Ryan wrote:
> > Yes! If you want to use the position scratch controller in the engine
> > then that's one way you could tell Mixxx to move smoothly to a position.
> > I was assuming you wanted to work more like vinyl control though in that
> > it would control Mixxx's normal playback rate.
> >
> > To do that,
> > set [ChannelX],scratch_position_enable 1
> > set [ChannelX],scratch_position to the desired position delta from the
> > current position
> >
> > This is how the mouse tells mixxx to scratch back and forth from the
> > position at which enable was changed to 1.
> 
> This sounds a bit closer to what I'm looking for to fully support 
> moving-platter controllers (please add it to the wiki,) but what about 
> when time stamps are provided, as which moving-platter controllers do. 
> (I was under the impression that the engine still doesn't have a way to 
> handle those.)

I'd really appreciate it if the wiki could be updated with this message type 
incl. resolution/limitations. I understand that how often it can actually be 
called is another issue but that'd be a good start.

Sean - is your Serato driver the only one with SysEx-based messages? From your 
experience do you think SysEx can be used to pass around any type of binary 
data?

I attached an 8/7-bit transcoder (8->7 in C++, 7->8 in javascript), but haven't 
tested it on Mixxx yet.

thx & cheers,

-- p
// Midi SysEx encoder (C++) and decoder (javascript)

//---- Encode 8-to-7-bit (C++) -------------------------------------------------

	SysExEncoder::SysExEncoder(const std::vector<uint8_t> &src_bin_data)
{
	const size_t	src_bin_sz = src_bin_data.size();
	wxASSERT(src_bin_sz > 0);
	
	const size_t	calc_enc_sz = ((src_bin_sz * 8 * 8 / 7) + 7) >> 3;
	m_Encoded7Data.resize(calc_enc_sz, 0);
	
	for (int i = 0, j = 0; i < src_bin_sz; i++, j++)
	{	
		const int	ind = (i % 7);
		if (ind == 0)
		{	// reserve mask
			m_Encoded7Data[j++] = 0;
		}
		
		const uint8_t	c = src_bin_data[i];
		const size_t	mask_ind = j - (ind + 1);
		
		// store high-bit
		m_Encoded7Data[mask_ind] |= (c & 0x80) >> (ind + 1);
		// store lower 7 bits
		m_Encoded7Data[j] = c & 0x7F;
	}
}

//---- Decode7 (javascript) ----------------------------------------------------

function Decode7(encoded7_data)
{
	var dec8data = [];
	var mask = 0;
	
	for (var i = 0, j = 0; i < encoded7_data.length; i++, j++)
	{	if (0 == (i & 7))
		{	// get new mask
			mask = encoded7_data[i++];
		}
		
		// recompute cycle index
		var ind = (i & 7);
		
		// retrieve high-bit
		var highbit = (mask & (0x80 >> ind)) << ind;
		
		// combine low-7 with high-bit
		dec8data[j] = encoded7_data[i] | highbit;
	}
	
	return dec8data;
}

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Get Mixxx, the #1 Free MP3 DJ Mixing software Today
http://mixxx.org


Mixxx-devel mailing list
Mixxx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

Reply via email to