Tuesday, 13 November 2012

Launchpad Sequencer - Step Indicators

Just a quick update on the progress of the sequencer I'm building in Max for my final year project. I wanted the Automap lights along the top of the Launchpad to show which step was currently playing, so I used the counter object in Max to trigger a chain of objects that turn each light on and off in sequence.

Here is an overview of the patch itself:


Download the patch here.


The data flow is explained in the comments, so I'll skip to how I put it together (and what went wrong along the way).

The main problem is that the launchpad needs two messages to control the LEDs; one to turn them on, and one to turn them off; so sending a control message each time the counter iterates isn't sufficient. To make things more difficult there's no way for the counter object to indicate that it has reset back to the minimum defined value, so I needed a way of executing one set of actions when the counter was at zero, and another when the counter was above zero.

I thought this would be a simple case of sending a light on message to the light corresponding to the counter number and a light off message to the one corresponding to one below the counter number; for example "2 on, 1 off", but implementing it was tricker than I imagined.

The way I did it was to use a routepass object to detect a message of zero coming out of the counter, and send it to a message containing the number of the maximum counter value (initially fixed at 7). All other messages come out of the second outlet, and subsequently go through a subtract object which takes 1 away from the value. This took some time to get right, because I forgot to subtract 1, so each light would come on and stay on, with a brief flicker indicating which step the counter had reached.

When I tried changing the number of steps using the number object connected to the counter I encountered even more problems: When changing the number of steps some lights would get stuck on until the counter reached that step, and the final LED of the sequence would always get stuck on unless there were 7 steps in the sequence. This second problem was easy to fix; all I had to do was connect the  number of steps number object to the right inlet of the message that is triggered on the final step. This changed the contents of the message whenever a change is made to the number of steps. 

The big headache came in trying to fix the other sticking LEDs. A flat out Launchpad reset wasn't an option, as this would erase all of the LED data relating to the actual sequencer. I first connected up a message that turned off all of the Automap LEDs, but because such a long message was being triggered each time the number object changed this created a great deal of lag when changing the number of steps by more than 2 or 3. After reading the Max reference guide I discovered the Uzi object. Uzi normally sends out a specified number of bang messages when it is triggered, but out of the third outlet comes the index number of each bang as an integer. Put simply, it will count from 1 to whatever you tell it to very quickly. I connected this to the middle inlet of my note off pack object (via a + object to reference the LEDs) and it provided me with a convenient way of resetting the LEDs each time.

Here's a video of the final result in action:



A couple of quick notes on the patch above:

The Automap LEDs on the launchpad are controlled by CC messages 104 to 111 on channel 1. This means that all messages to them should begin with 176. The actual data byte controls the colour and brightness of the LED. In this case a value of 3 results in a bright red LED and 0 turns it off.

The message box containing "176 0 0" connected to midiout causes the launchpad to reset; clearing both buffers and turning all LEDs off. This is a useful message to send when closing the patch using the closebang object - otherwise the LEDs will stay on until they are next referenced.
Your Ad Here

10 comments:

  1. I have been using this replica watch, replica omega watchesit is a very beautiful and affordable automatic watch, good size, great quality, elegant and temperament, is my favorite style.fake omega seamaster watches I shared this website with my friends and they were very happy.

    ReplyDelete
  2. There is good news for you. Now, you need not to spend those big bucks for acquiring your dream watch. Your answer is Replica watches. Yes come here buy mini for watchreplica rolex watchesreplica rolex Datejust 31 Everose gold White mother-of-pearl Dial Watch m278245-0014etc.

    ReplyDelete
  3. The Audemars Piguet Jules Audemarsfake watches collection commemorates one of the brand’s founders. The line is characterized by its traditional and timeless round cases and overall minimalist design. replica jules audemars watchesHowever, behind the simplicity of these watches is an array of impressive functions, such as tourbillons, moon phases, and chronographs. Designed with both men and women in mind, the Jules Audemars collection fully embodies both the range and restraint of the brand.

    ReplyDelete
  4. The Royal Oak Offshore collection replica watches uk has defied established conventions since 1993,replica royal oak watches giving an ever more sporty, masculine and powerful take on the iconic Royal Oak and its aesthetic codes.

    ReplyDelete
  5. “The Jimmy Choo woman is unanchored and transient, cheap jimmy choo constantly on the move, which makes her so of the moment,” repliche boots says Creative Director Sandra Choi – that explains why the brand’s shoes and accessories have graced countless red carpets and are loved by everyone from Rihanna to Kate Middleton. Our edit is specially curated with timeless and statement styles for every occasion. Don’t miss the shimmering pumps and sleek ‘Misty’ sandals.

    ReplyDelete
  6. Louis Vuitton himself was born the son of a miller in 1821 in Anchay, a hamlet in the Jura Mountains, not far from the Swiss border. Replica bagsThe region was a poor one - serfdom had only been abolished less than 40 years previously, so Louis left to seek his fortune when he was a teenager, arriving in the French capital aged 16. This was the Paris of Victor Hugo's Les Misérables, with nearly one million inhabitants. As the composer Chopin said in a letter to a friend at the time, "Here you find the greatest luxury and the greatest filth, the greatest virtue and the greatest vice."replica Louis Vuiton bags

    ReplyDelete
  7. La marque avec le motif emblématique du crane McQueen, réplique de alexander mcqueen y compris des pas cher homme alexander mcqueen foulards et une variété de produits avec des sacs à boucles, repousse les limites de la culture, de l'art et de la mode. En été, les entra?neurs surdimensionnés pour hommes et femmes continuent d'être les livres les plus vendus.

    ReplyDelete
  8. Welcome to cheap Soccer Jerseys Soccer Shop - The Best Wholesale cheap zlatan ibrahimovic Jerseys Jersey Suppliers on the Internet. We specialise in the best quality and cheap soccer jerseys.

    ReplyDelete
  9. Et kulturarvsmærke med en kultfølgende, moncler jakke salg mænd Moncler gør koldt vejr ubesværet med at manøvrere. køb Moncler jakke Superbløde pufferjakker og pakning med hætte-stilarter tilbyder en række valgmuligheder, der hver især vil være uundværlige i løbet af sæsonens stadig mere uforudsigelige klimaer.

    ReplyDelete
  10. Rolex watches are crafted from the finest raw materials and assembled with scrupulous attention to detail. cheap replica watchesEvery component is designed, replica rolex watchesdeveloped and produced in-house to the most exacting standards.

    ReplyDelete