• No results found

PART II TOWARDS A COMPUTER-MEDIATED MUSICAL EXPERIENCE

Chapter 5. Instrument Algorithms

5.3. Solo instruments

The solo instrument, commonly a monophonic instrument, like the saxophone or trumpet, is implemented as a set of dynamically changing scales that fit the currently playing harmony while the song is playing. Similarly to the piano algorithm, the solo part is not meant as an automatic generator. It is meant to be manually played by the user, and as such provide an experience, at least partially close to the actual experience of playing an instrument. The mapping algorithm of the solo part takes care of the calcula- tion of the notes to be used at any given moment in the harmonic sequence it receives from the sequencer. The solo receives a scale tag, which will correspond to an opti- mized scale template. These scale templates are pre-defined to better fit the musical contexts and the interface characteristics, and can be designed arbitrarily and included in the style-sheet. These scales are built dynamically during runtime, according to a custom algorithm that calculates the correct notes for each harmony, following the def- initions in the song style-sheet.

Fig. 36 Example solo instrument interface from "MyJazzBand" (tenor saxophone).

The control is made with control messages that trigger one of the mapped notes. Both PocketBand and MyJazzBand present the same approach of a two-dimensional

axis, as they were planned for touch events in a touch-screen. The control message in- dicates the horizontal and vertical position coordinates of each touch event. From the horizontal coordinate, the program calculates which key was pressed, triggering the corresponding note index. The vertical position is used for the dynamics.

The saxophone keyboard interface from MyJazzBand, shown in Fig. 36, has 12 vir- tual keys. Each key will play a note, but the note changes dynamically according to the harmonic changes and the definitions in the style-sheet.

Fig. 37 Example scale produced with an indication of the mixolydian scale.

Fig. 37 shows an example of a scale mapping of a mixolydian scale in a C7 chord in the harmonic sequence. The two top rows show the key index and the midi note as- signed to each one. The example tenor saxophone interface in Fig. 36 has twelve keys. In this case, the notes would range from index 0 (note C) to index 11 (note G). The range of the instrument is then taken to account, so that the octave lays within the playable range of the instrument.

In the vertical axis, we can control the dynamics of the played notes. The higher the touch in the key, the louder it sounds.

5.4. Drums

The algorithmic generation of the drums part is based on the stochastic recombina- tion of sub-beat-level rhythmic cells from a pre-defined set of rules and patterns for each of the drum elements. By combining a small number of elementary rhythmic pat- terns, tailored for Blues and Jazz, an effective drum part is obtained, which, as with the bass and piano algorithms, is meant as a comping device.

The algorithm is divided in two main branches. One for the generation of the kick and snare parts, and other for the ride, hi-hat and crash cymbals. The reason for this is the inter-dependency between these elements. The kick and snare usually combine and complement each other, and rarely play at the same time (see Fig. 38).

Fig. 38 Example jazz drum score (adapted from (Pickering, 1978, p.47)).

Snare/Bass drum

For the snare and bass drum, two sets of four sub-beat level patterns were defined, based on the playing technic in jazz drums. These patterns are one beat long (one quarter note), with a ternary sub-division, with each eight-note triplet represented by a binary array that can be 1 or 0, depending if it is a trigger or a rest (see Table 5). They are ordered according to the number of triggers, so the higher the index, the higher the number of triggers.

Main patterns Secondary patterns 0, 0 0 0; 1, 0 0 1; 2, 1 0 1; 3, 0 1 1; 0, 0 0 0; 1, 1 0 0; 2, 1 1 0; 3, 1 1 1;

Table 5 Snare and bass drum trigger patterns.

A probabilistic function then selects the patterns, according to a density parameter. For a given density value, a certain pattern has a greater probability of being selected, followed by its adjacent neighbors, in a Gaussian-like distribution. The two sets of pat- terns (main and secondary) are also selected according to a simple stochastic algo- rithm: the main patterns have a constant 80% probability of being selected, while the secondary have a probability of 20%. A non-repetition filter was implemented, to pre- vent the patterns from repeating. Although it is not uncommon for a jazz drummer to occasionally repeat a pattern, it is much more as an exception than as a rule. Also, the occasional repetition of patterns is usually due to some occasional melodic phrases or due to the interchange of phrases with another player. For this purpose, the use of the non-repetition filter proved to be more effective in providing interesting results. Follow- ing the filter, yet another probabilistic stage was implemented, to manage the selection between the snare and the bass drum. As explained before, the interchanging nature of the snare and bass drum roles in jazz playing create a complementary motion between

the two. For this stage, a stochastic algorithm was used. Each trigger event is routed to the snare or bass, according to a set of pre-defined probabilities, which, in this case are different for each beat of the bar.

Fig. 39 Snare/bass drum pattern selection algorithm.

Cymbals

The algorithm for the cymbals has many similarities, but also some important differ- ences. It is also based on the recombination of pre-defined patterns, but these patterns are, in this case, four beats long (one bar), instead of one beat. An initial version of the algorithm, using one-beat patterns revealed a poor quality of the results. This happens because the role of the cymbals is quite distinct from the snare/bass drum. The rhythm played on the cymbals are much more stable and repetitive. In fact, most of the time, the ride and/or hi-hat cymbals are frequently the more regular and repetitive elements in the whole band. Better results were attained using four-beat (one bar) patterns (Fig. 40).

Index selection pattern set selection non-repetition filter snare/bass selection Density value Output

Main patterns 0, 1 0 0 0 0 1 1 0 0 0 0 0; 1, 1 0 0 1 0 0 1 0 0 1 0 0; 2, 1 0 0 1 0 0 1 0 0 1 0 1; 3, 1 0 0 1 0 1 1 0 0 1 0 0; 4, 1 0 0 1 0 1 1 0 0 1 0 1; Secondary patterns 0, 1 0 0 0 0 0 1 0 0 0 0 0; 1, 1 0 1 1 0 0 1 0 0 1 0 0; 2, 1 0 1 1 0 0 1 0 0 1 0 1;

Fig. 40 Ride/Hi-Hat patterns.

The choice of the patterns reflects the regular character of these elements. The range of variations is not very wide, and some of the pulses - namely on the first and the third beat of the bar – are always triggered. Also, unlike the snare and bass drum, there is no complementarity between the ride and hi-hat. They are implemented to- gether because their behavior is similar, but they are used separately. The output is on- ly one of them.

When the cymbal being generated by this algorithm is the ride cymbal, a secondary hi-hat is used, but this time it is only playing one single pattern, with a trigger on the second and fourth beats of the bar.

All the solutions and values presented, were the result of several tests, based on the analysis and comparisons with existing repertoire and knowledge of jazz playing tradi- tion. These values were found to provide a balanced result between richness, variation and stability.