Click here to Skip to main content
15,435,347 members
Articles / Operating Systems / Windows
Posted 6 Aug 2013

Tagged as


2 bookmarked

DJ Touch

Rate me:
Please Sign up or sign in to vote.
4.57/5 (9 votes)
17 Aug 2013CPOL4 min read
This is a touch-enabled virtual DJ application that features a spinning vinyl record and sound controls. This application targets the All-In-Wonder Entertainment market.

This article is an entry in our AppInnovation Contest. Articles in this sub-section are not required to be full articles so care should be taken when voting.


Using a DJ application on laptop/desktop with a mouse has always been difficult and unnatural. Mouse interaction does not allow for multi-touch events. Hence, you cannot perform multiple tasks at the same time. This slows down performance and makes the DJ task difficult and cumbersome.

What about DJing on a tablet? That certainly does work well given the small screen and limited processing resource. Simply, it is not cool. 

All-In-One's 27" multi-touch screen and compact table-top design is the ultimate solution. All-In-One's powerful core i7 is great for sound processing.  It's superb sound quality is always an awesome bonus.  

The Idea   

The All-In-Wonder's gargantuan 27" touch screen is perfect for a virtual DJ application. This application features a spinning vinyl record that allows the DJ to physically "scratch" the spinning record for special sound effects. Additionally, numerous sound controls are also available at the DJ's disposal. These sound controls include master volume, equalizers, fader, and fx, etc... Of course, it will also provide real-time sound visualizations and a handy GUI. These visualizations include waveform displays and VU meters. Best of all, it will feature a dual deck interface for mixing and fast switching between songs.  

DJ Touch will allow user to load multiple songs into a playlist. The user then selects a song from the list to play with the the deck they choose. A cross-fader will allow for smooth transitioning between decks/songs. The application allows user the option to let DJ Touch handles transition automatically to ensure continuous play. 

How embarrassing would it be for a DJ if he/she does not have a song by user request? Fear not! DJ Touch could connects directly to an only music store like Amazon MP3. The purchased MP3 will automatically be stored and added to the playlist. An amateur DJ will now have access to a vast music database with just a few button clicks and a reliable WIFI connection. And why not let peers share their music through Bluetooth from their mobile device? 

DJ Touch will market as an entertainment tool rather than a professional DJ application. All-In-One's colossal multi-touch screen will make this task easy and enjoyable for any type of user.  

 Image 1

The Code   

For the Demo App, I will utilize C# and WPF XAML. I will also leverage Audio DJ Studio for advanced digital sound processing capabilities. This will enable me to develop the proof of concept demo application quickly. This enables me to put focus on developing the interface and user experience.   

In this section, I will go over the projected implementation of some features mentioned above.  

The spinning vinyl disc is a continuously rotating image. RotateTransform is used to rotate the image continuously.  

<Image Source="disc.png" Height="24" IsManipulationEnabled="True">
        <RotateTransform CenterX="12" CenterY="12" />
                <Trigger Property="Image.IsEnabled" Value="True">
                                    RepeatBehavior="Forever" />
    </Image><span style="font-size: 9pt;">  </span>

 To enable the record scratch behavior, the rotating image will also listen to multi-touch event. This is done by setting the IsManinulationEnabled property to True. In the codebehind, we can override 2 methods: OnManipulationStarting and OnManipulationDelta. OnManipulationStarting is triggered at the first multi-touch action while OnManipulationDelta might be trigger multiple time during a single user action.


Of course, our DJ Touch will also include a lively VU Meter. For this we simply use the GraphicBarManager. For displaying the sound wave profile, we use DisplayWaveform feature. Here is a little code snippet. 

<pre><span style="font-size: 9pt;">//creating a vu meter
private IntPtr CreateVuMeter(Label ctrlPosition, enumGraphicBarOrientations nOrientation)</span>
	// create a new graphic bar
	IntPtr hWnd = <span style="font-size: 9pt;">studio</span><span style="font-size: 9pt;">.GraphicBarsManager.Create(m_windowHandle,</span>
		(int)GetControlPosition(ctrlPosition).X, (int)GetControlPosition(ctrlPosition).Y,
		(int)ctrlPosition.ActualWidth, (int)ctrlPosition.ActualHeight);
	// set graphic bar range
	<span style="font-size: 9pt;">studio</span><span style="font-size: 9pt;">.GraphicBarsManager.SetRange(hWnd, 0, 32767);     </span>
	// enable automatic drop and set the requested orientation
	<span style="font-size: 9pt;">studio</span><span style="font-size: 9pt;">.GraphicBarsManager.GetGraphicalSettings(hWnd, ref settings);</span>
	settings.bAutomaticDrop = true;
	settings.nOrientation = nOrientation;
	<span style="font-size: 9pt;">studio</span><span style="font-size: 9pt;">.GraphicBarsManager.SetGraphicalSettings(hWnd, settings);</span>
	return hWnd;
}<span style="font-size: 14px;"</span> 

 Fading between two decks (players) can be done using the FaderObject 

// initialise the Fader on deck 0 and deck 1

studio.Fader.Init (AudioDjStudio.enumFadeTypes.FADE_SINGLE, 0, 1);
// set the fade-in and fade-out duration
studio.Fader.FadeInLength = 3000;
studio.Fader.FadeOutLength = 4000;  

  DJ Touch will feature a simple equalizer with 3 sliders: Low, Mid, and High. We can initialize these equalizers with AudioDJStudio in a XML declaration. Each slider is configured with a frequency of operation. 

     <Band FreqInHz="80" BandWidth="12" GainIndB="-5.200000">Low</Band>
     <Band FreqInHz="1000" BandWidth="12" GainIndB="-3.000000">Mid</Band>
     <Band FreqInHz="14000" BandWidth="12" GainIndB="-3.120000">High</Band>

DJ Touch tracks the song playlist in memory. User is allowed to load a single song or an entire library. The song names and their locations are kept in memory. The sound data will not be loaded until user chooses to play it. 

Audio DJ Studio allows each deck to output to its own channel, separately. This feature, however requires 2 audio outputs. Lenovo All-In-One features only a single 3.5mm audio. This challenge could be overcome by using a USB audio device to allow for multiple output channels.  DJ now could listen to one deck while playing with the other through the main output. A Bluetooth enabled headset can also be an option that is worth investigating. 

To keep it simple, the Amazon MP3 music store can be integrated into DJ Touch by wrapping it within a XAML Web Browser control. User can select a button to display the browser, login, search, purchase, and play; all without exiting DJ Touch.   






C# and XAML 


DJ Touch is a project that can be expanded to include many new features and sound processing capabilities. With time and effort, it can evolve into the professional market for DJs. But as an entertainment toy, I would love to have a DJ Touch when I host a party at home or at a clubhouse.  



This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Written By
Software Developer Booz Allen Hamilton
United States United States
I am a senior full-time software developer with more than 5 years of professional experience. I have done both .NET and Java development during these years. I started out my career as an ASP.NET programmer but recently moved over to Java. My focus has been on writing applications for web and desktop. However, I have also gained substantial experience in backend cloud computing with Java technologies like Hadoop HDFS & Mapreduce, Accumulo, and Solr. I earned my Hadoop Developer certification in March 2013.

Comments and Discussions

QuestionHow's app development going? Will you be submitting on time? Pin
Kevin Priddle23-Oct-13 10:29
professionalKevin Priddle23-Oct-13 10:29 
AdminGreat entry! Pin
Kevin Priddle15-Aug-13 16:07
professionalKevin Priddle15-Aug-13 16:07 
GeneralRe: Great entry! Pin
lamlh17-Aug-13 13:15
professionallamlh17-Aug-13 13:15 
GeneralMy vote of 5 Pin
Adam David Hill6-Aug-13 22:00
professionalAdam David Hill6-Aug-13 22:00 
GeneralCool Pin
Meshack Musundi6-Aug-13 20:43
professionalMeshack Musundi6-Aug-13 20:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.