LoopMash is an innovative virtual instrument that presents you with a new way to blend simultaneously up to four two-bar loops together by juggling similar elements across looped beats and tunes. Now ported to the iOS platform, this sizzling hot instrument lets you choose from over 40 presets and 250 included loops ranging all the way from. Sweco, A Business Unit of M-I L.L.C. Tel: (859) 371-4360 8029 U.S. Highway 25 Fax: (859) 283-8469 P.O. Box 1509 www.sweco.com Florence, KY 41042 [email protected] We Put Technology In MotionTM.
Code Help and Videos >
Java Arrays and LoopsThis page introduces arrays and loops in Java with example code, on creating, accessing, and looping with arrays.See also the associated CodingBat java array problems, to practice array ideas or study for an exam.Written by Nick Parlante.
An 'array' is a way to store a collection of 'elements'.Arrays use square brackets [ ] for their syntax.Each array is declared with a type that indicates the type of element that it stores, like this: the 'int[]' type is an array of int elements, a 'String[]' type is an array of string elements.Arrays are allocated in the heap with the 'new' operator and accessed through pointers (just like objects). The following line declares a variable 'values' that can point to an int array. The code does not allocate the array yet:The expression 'new int[100]' allocates a new array in the heap, sized to hold 100 int values.:In the heap, the array is a block of memory made of all the elements together. Each element in the array is identified by a zero-based index number: 0, 1, 2, ... and so on. An attempt to access an index outside the 0..length-1 range will fail with a runtime exception. When first created, all of the elements in the array are set to zero. So the memory drawing for the code above looks like:
Arrays use square brackets as a convenient syntax to refer to individual elements: 'values[2]' is the element at index 2 within the 'values' array. This square bracket syntax is an easy way to get or set any particular element in the array.Here is a longer example that declares an array variable, allocates the array with 'new', and then uses the [ ] syntax to access particular elements:
The length of an array is set when it is created with 'new' and that length never changes for the lifetime of the array. In contrast, Java Lists can grow and shrink over time -- this is a big feature that Lists have that arrays do not. The length of an array can be accessed as a special '.length' attribute. For example, with the above 'values' array, we can access the size of the array as 'values.length'. It is common to use a 0...length-1 for-loop to iterate over all the elements in array:Note that the the syntax to access the length is just 'values.length', not 'values.length()'. Why do we need .length? Don't we know how big the array is from when we created it -- length 100 or whatever? The answer is that .length is useful, since it allows us to write a method that takes an array parameter, where the array is of any size. For example, the method computeSum() below takes an int[] array argument, and computes the sum of the ints in the array:Since the code uses the .length of the array passed in, it will work for any size array that we pass in.
Example Array CodeHere is code that iterates over a non-empty array to find the index of the smallest element:Object Array CodeLoop Mash Up Pro 1 0 40 OzSuppose we have an Account class that has a constructor with zero arguments. Here's some example code that allocates an array of 100 Account objects:Array Literals![]() Array Code PatternsA 'pattern' or 'idiom' is a phrase or section of code that we see or use often since it solves a common problem. With arrays, there are a few very common patterns for iterating over the elements in an array. You want to be familiar with these basic patterns since many array problems can be solved with variations and combinations of these basic patterns.1. For-All LoopThe 'for-all' or 'for-each' loop, as we have already seen, is a very common idiom for arrays. The goal is to iterate over all the elements from 0 to length-1, doing some operation once for each element.We can change the init/test/increment in the for-loop to iterate through the elements backwards, from length-1 down to 0. With this sort of code, we have to be careful with the exact specification of the for-loop to hit the right elements in the array. It's easy to be off-by-one -- for example, the backwards loop above has to init i to 'length-1' instead of 'length' to start with the last element. The test should be 'i>=0' instead of 'i>0' to include the 0th element. Oftentimes in loop and array problems, getting these 'edge' cases correct is the trickiest part. When writing a loop, look at the code and think how it will behave for the very first and very last elements. If it works for those, it will most likely work for all the elements in between. In Java, if the running code tries to access an index that is too big or too small to fit in the array, the program will get an ArrayOutOfBounds exception on that line.Other examples of for-all operations that look at every element in the array include: sum up the int values in an array, call a method on every object in an array, count the number of times a particular value appears in an array.2. Search LoopAnother common problem is searching through all the elements in an array to find a particular 'target' value. The code is basically the standard for-all loop with an if-statement inside looking at each element. The example code below takes array and target arguments and searches through the array for an element that is the same as the target. The method returns the index where the target appears in the array, or -1 if the target does not appear in the array.
In the loop, an if-statement checks if each element is the same as the target value. If the test is true we have found the target and can stop looking. In the example below, the if-statement uses a 'return' to exit the loop and method immediately when a matching element is found. Another solution might use a 'break'. The point is, once the target is found, we do not need to keep iterating the loop.
How do we know if the target does not appear in the array? This requires a little logic. The search-loop looks at every element in the array, tests each one, and exits the method when a match is found. Therefore, the only way the program can get to the line just after the search-loop is if none of the elements matched. Therefore, the code just after the search-loop only runs when no elements match. In this example, the 'return -1;' will run in the case that none of the elements matched.For search problems, we generally write the loop in the standard way to go through all the elements, and then add if/break/return logic inside the loop to react to each element.As a matter of style, the search-loop solves two problems. It must iterate over all the elements, and it must figure out if the target is found or not. One of those problems – iterating over all the elements -- is just the standard for-all problem, and we are happy to use the standard pattern code to handle it. Or put another way, if part of a problem is common and part is unique, use standard code for the common part and add in code for the unique part. The strength of standard code is, after all, that it is familiar and easy to use, so we use it where we can.
What would it mean to disregard the above advice? We could make up a while-loop that mixes together the logic of the for-all and the search into one:The above loop works, but I think it is not as good as the earlier version that uses the standard for-all loop. The beauty of the for-all idiom is that it is easy to write, easy to read, and hard to get wrong. We should take advantage of that clarity where we can.
Heads/Tails Array Loop ExampleHere is a more complex search loop problem. Given the results of a series of heads/tails coin tosses as a boolean[] array (true=heads, false=tails), figure out if there were ever 10 heads in a row. This is essentially the search problem again: we go through the array looking for a something, stopping if we find it:3. Min/Max LoopA Max or Min loop searches through all the elements looking for an element that is the most or least among all the elements according to some metric. The max-loop differs from the search-loop since the max-loop must look at every element, while the search-loop can exit as soon as it finds a match.
The basic idea with the max-loop is to keep a local variable that stores max-so-far as we go through the loop, and each element is compared to the max-so-far. If an element is larger than the max-so-far, its value becomes the new max-so-far. At the end of the loop, we have looked at every element and remembered the largest.
What should the initial value of max-so-far be before we look at anything? One possibility is to just use the first value from the array. Although probably not the largest in the array, it will be compared to every element by the time the loop is done, so it's a fine starting candidate.A slightly different strategy is to use an extremely small value as the initial max-so-far, such as the constant Integer.MIN_VALUE which is the most negative possible int value, about -2 billion.Finding a max or min value in an array does not make sense if the array is empty (length of zero) -- there are no elements, so the question of which element is biggest does not make sense. Sometimes, a method will stipulate that empty arrays may not be passed in and the method does not promise to behave correctly given an empty array. The burden is on the caller not to pass in an empty array. Sometimes, the method may back up this stipulation by actually detecting an 'illegal' argument and raising a descriptive exception, such as the IllegalArgumentException.How do the two versions of findMax() above behave if passed an empty array? (The first will crash with an ArrayOutOfBounds exception. The second will return the value -2 billion.)A final variant of find-max returns the index of the max element in the array, rather than the value of the max element. The easiest solution is probably to use two local variables -- one for the max value and one for the index.
CodingBat.com code practice. Copyright 2012 Nick Parlante.
Please note that we will phase out LoopMash Free, LoopMash and LoopMash HD. As a courtesy to our customers, the apps will remain available in the Apple App Store until January 8, 2018.
Choose page content
LoopMash HD is a fresh new iPad app for making music no matter where you are. With its innovative approach to mixing music, LoopMash HD simultaneously merges up to eight four-bar loops by matching and replacing comparable elements. Featuring 19 live performance effects such as tape stop and stutter effects, LoopMash HD comes with over 30 presets and 258 loops ranging all the way from ethno to electro. Based on a technology introduced by Yamaha, LoopMash HD is a stripped-down version of the popular LoopMash virtual instrument featured in Cubase.
Top Features
Mash it up!![]()
Load high-quality audio loops into your eight tracks and start mashing up tunes to your heart’s content! With over 250 finest audio loops, we’ve got you covered, no matter what styles you want to blend together. The loop browsing works intuitively and allows you to listen in on the loops before you select one. Move the Track Similarity Gain faders of the slave tracks until you find the right groove. Then, pull up the Similarity Threshold to limit the amount of slices to be played. Play around with the Similarity Gains yet again to change the kaleidoscope of sounds — all this, of course, with multi-touch support!
Loop Mash Up Pro 1 0 40 LbsEnter the slice matrix
At the heart of LoopMash HD is the Slice Matrix page showing eight tracks — each four bars long. Tap any of the eight tracks to make it your master track and the other tracks will follow the assigned track. The Slice Matrix includes basic playback functions such as start/stop and tempo control. There’s also access to the help page in the upper left-hand corner. The Settings page provides powerful key controls for performance tweaks, such as Number of Voices, Selection Grid, Selection Offset, Staccato, Similarity Method and Adapt Mode.
Tweak your loops
The Mix page features a straightforward mixer to easily adjust the volume of the individual tracks. Spice up your performance with the included studio-grade effects: Lowpass Filter and Hipass Filter, Flanger and Phaser. All the dance floor classic effects are here to make your music sound even gnarlier!
Pitch Transpose
Tap the button to the left of a volume slider and select a semitone from the displayed panel to transpose the pitch of the selected track.
Bring it to the stage
LoopMash HD ships with over 30 factory presets to get you started immediately. With the included performance pads you can trigger beat mashing effects in real time to focus on your performance. Tape stops, scratches, cycles, backspins and more. Try them all and get addicted!
Loop Mash Up Pro 1 0 40 Mm
The preset management is really easy to use: each preset can store up to 24 scenes, and each scene can contain up to eight different loops, effects, similarity and adapt values, volumes, transpose semitones, tempos and settings. Use the pads to save and trigger your scenes. And with an unlimited number of user presets, there are simply endless possibilities for you to explore.
Exchange presets
With LoopMash HD you can even exchange your presets with friends. It’s so simple — just connect your iPad to iTunes, click on the left menu on your device, and then click on the top menu on 'Apps'. Scroll down to the 'Apps' section and select LoopMash HD. You will find all your presets on the right window. Click on 'Save to...' to store your presets to your computer. If you want to load presets from a friend, simply click on the 'Add...' button.
Swift 3-D page navigation
LoopMash HD features a new and intuitive form of navigating through the app’s pages. Not only is the slice matrix shown in a three-dimensional manner on the adjacent pages, but arrows are displayed on each page in order for you to swipe effortlessly from one page to another.
Loop Mash Up Pro 1 0 400New in Version 1.1: Record and Export
The 1.1 update update lets you record and export your mashup.
When LoopMash is running, simply tap the red button on the upper right-hand corner of the app to start recording. Tap the button again to stop recording. Once you've stopped you are prompted to give your creation a name. All your recorded WAV files are stored in the iTunes Share folder of LoopMash.
Important: this update requires iOS 5.1. If you don't have iOS 5.1 installed on your device, don't install this update as it won't work.
New in version 1.2
Audiobus is an innovative iOS protocol that offers realtime audio streaming between multiple apps. Now, you can use LoopMash HD and record the audio output signal directly in Cubasis or other apps.
Before sending the audio signal to Cubasis, you can even route it to another app and use that app as an effect processor — there are plenty of possibilities!
Upgrade your LoopMash HD library with content sets for even more great-sounding loops in your favorite music style. Each content set includes over 50 first-class audio loops that have been shaped by professional producers and chosen by some of the best ears in the industry.
The LoopMash HD Content Sets are exclusively available as In App purchases. After the download, the loops are instantly accessible and arranged in the loop browser, making it a breeze to find the right sound. The Pump up the mash! volumes one through four bring an inspiring collection of electronic sounds to your iPad — a must-have for any LoopMash HD user! Ranging from minimal to ambient and prog house to electro, each of the sets delivers a variety of exclusive loops for leading-edge electronic music productions.
LoopMash is also available for your iPhone and iPod touch — in a fully fledged paid version and a stripped-down free version. Pick the app that suits you best!
Feature Comparison
Comments are closed.
|
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |