a Musical Generator in 10 lessons

1. Getting a feel for a Musical Generator

When the installation was succesful there has been a new section added to your start menu called a Musical Generator. Click on the symbol for a Musical Generator and the application starts. A Musical Generator consists of a section labeled DATA and a section labeled MIDI. The DATA section contains the data of a Musical Generator and the MIDI section contains information on how the music should sound. We will discuss the following subjects: Inserting data Seeing the data Hearing the data Exiting a Musical Generator

Inserting data

At the top right of a Musical Generator you see several tabs. Each tab is a group of fractals or function. Click the tab of the group you want to see, next click the fractal or function you want to insert in the DATA section. You see its icon appear. You have now loaded your first data, or as we call it from now on: vector into a Musical Generator.

Exercise Click on the tab Data, and press the button labeled F(x). A dialog box appears, asking you what function you want to select. Just press OK, so the sinus will be selected. It appears in the DATA section. We will call it a vector in the future.

Seeing the data

As you noticed, a small icon{bmc sinus.bmp}represents the vector when it is inserted in the DATA section. You can have a bigger picture when you plot the vector. It is always a good idea to plot vectors before you listen to them.

Exercise Right click with the mouse on the sinus and choose plot. The plotter comes up and the vector is plotted.

Hearing the data

The next phase consists of making music out of the vector. If you look at the lower left side of the MIDI section you see four buttons, the so-called MIDI aspects. They are labeled Notes, Duration, Speed and Time. By dragging a vector to one of these button, it's MIDI aspect is controlled by that vector.

Exercise Click at the sinus in the data section and drag it to the button labeled Notes. Drop it over there and the button assumes the name of the vector and the picture of the button changes to that of the sinus. You are ready now! Press the play button{bmc vcr_play.bmp} and you will hear the sinus. Before doing so, just wonder what kind of music you expect.

Exiting a Musical Generator

In the next lesson we will explain more about what you have done, but now: try to exit a Musical Generator. There are two ways to exit a Musical Generator:

  • Press alt-F4.
  • Click the close button of the window (the most upper right button of a Musical Generator window, marked with an X).

2. Doing more with the sinus

In this chapter you will learn how to use the other aspects of a note. We make an exception for the time aspect because it is more difficult. It will be treated in a separate lesson. You will learn the following topics:

  • What are aspects?
  • How to assign a vector to different aspects
  • How to unassign an aspect

What are aspects?

Notes are have several properties, called aspects in a Musical Generator. Aspects are pitch, duration, speed (the volume) and time of each note. When music is generated, a value should be assigned to each aspect. However, in lesson 1 you only assigned a vector to its notes aspect and you were able to play the music. That is because each aspect, except the pitch provides a default if no vector is provided. In the table below the aspects are explained.

  • Notes. A vector assigned to this aspect generates the pitch of the notes. There is no default provided so you must assign a vector to this aspect in order to hear music.
  • Duration. The values of a vector to this note generates the duration of each note. If no time vector is provided, the next note starts after the duration of the previous note. The higher the value, the longer the note lasts.
  • Speed. This is the speed with which a key on a keyboard is pressed. The higher the value provided by the vector, the faster the key is pressed and the louder the note will sound.
  • Time. Determines at which time the note should be played. If values go up and down, notes that are generated later in the sequence can sound earlier because thay are sorted according to their time value. This can cause confusion.

How to assign vectors to different aspects?

You can assign a vector by dragging. You drag a vector from the DATA section to the button that represents the aspect and drop it there. You will see the name of the vector at the button.

Excercise If you haven't done already, insert a sinus (see chapter one: inserting data). Assign it to the notes button and to the duration button. Now play the music. Because pitch and duration are provided with the same vector they have exactly the same values. When the pitch increases, the duration increases also and vice versa.

How to unassign a vector from an aspect?

This can be done by dragging the vector from the button to the middle of nowehere and drop it there. The vector will disappear.

Excercise 1 We want to study the effect of the sinus on the speed. Drag the vector from the duration button for example somewhere in the MIDI section and drop it there. It disappears from the button. Now drag the sinus from the DATA section to the speed button and drop it there. Press play. When the pitch increases the music becomes louder.

Excercise 2 Drag the sinus from the DATA section to the duration button. Now the notes, duration and speed button should have been assigned the sinus. Press play. Nifty eh?

3. Changing the interpretation of a sinus

Maybe you have wondered why the sinus sounds as it does now? Why is the pitch as it is and not higher or lower. In this lesson you will learn how to change the attributes of an aspect, more specifically:

  • How to change the minimum and maximum between which vector are scaled
  • How to change the default of an aspect
  • To rescale or not to rescale

How to change the dimension of an aspect

Start a clean Musical Generator (restart it or press File|New). Load the sinus and drag it to the notes button. Press the notes button and the notes editor comes up.

Changing the minimum and maximum

Exercise The values between which the notes are rescaled are listed below current. The allowable values are listed under the heading allowed. You may never enter a value below the allowable minimum or above the allowable maximum. Change the value for minimum to c2 and for maximum to c7. Press OK and next press play. The sinus now sounds an octave lower. Again press the notes button and replace c7 by c9 as maximum, press OK and play. The sinus now covers a much broader range.

Evaluation What you have learned now is that when you change the parameters of an aspect, exactly the same vector sounds different. This feature of a Musical Generator gives you even within a limited range of vectors a broad range of possibilities. As with the notes aspect, you can change the parameters of the other aspects as well. Experiment with it as much as possible.

Rescaling vectors

A vector is being rescaled between the minimum and maximum provided. You can switch off rescaling by unchecking rescale in the aspect editor. The result is that the vector values are directly used as input. However, if their values are below minimum or above maximum they will be assigned the minimum respectively the maximum (in order to prevent program crashes).

Default The default is provided for an aspect if no vector is provided for all aspects except the notes aspect. It is disabled for the time aspect however. The time default of a note is the time of the former note plus its duration. The first note starts at time zero. Dimension The dimension of vectors will be treated in the lesson about fractals.

4. Adding more vectors

Until now you have used one voice for music and assigned notes to various aspects. In this lesson you will learn:

  • How to create more voices in your music
  • How to display your music

A Musical Generator is based upon the MIDI concept. That means that there are 16 MIDI channels that you can consider as tracks. Each channel has its own aspects for pitch, duration, speed and time. Untill now, we have only used channel 1. Now you will learn to use other channels as well.

How to create more voices in your music

Exercise Start with a clean Musical Generator (restart it or use File|New). Now load two vectors: sinus.prn and cosinus.prn. Plot both of them so you can see how they differ. Assign the sinus to the notes button. Now click at channel 2. You will see that the notes button clears. There is no vector assigned to the notes aspect of channel 2. Assign the cosinus to the notes button. Press play. You will hear two pianos at the same moment.

Evaluation In the previous lesson you have learned how to change the aspects of music. To be more exact, changing aspects applies to only one channel. This adds to the flexibility with which you generate music. Suppose you want to have two flutes in your music (how to choose a flute you will learn in the next chaper), one flute an octave higher than the other. You can do this by changing the minimum and the maximum of the notes aspect of one MIDI channel to be an octave higher than the other.

How to display your music

Press the Piano Roll Window (click Window|Piano Roll) to have an overview of the music. A window pops up, showing all notes. Each channel has its own color. The longer the note, the longer the line representing it. We call this notation a piano roll because it looks like a roll of paper being put into a Pianola. Now press play again. A thin line on the Piano roll shows which notes are being played.

If you press the Piano roll button and you haven't pressed the play button before you will see an empty piano roll. You must first generate music before you see the piano roll filled.

5. How to put variation into music

In this lesson you will learn how to put more variation into your music. The folowing subjects are treated:

  • How to choose a synthesizer
  • How to change the sound of a channel
  • How to change the length of your music
  • How to change the tone scale
  • How tor change the tempo of the music

In this lesson you need the sinus and the cosinus. Assign the sinus to the notes of channel 1 and the cosinus to the notes of channel 2.

How to choose a synthesizer/Soundcard

The box labeled Soundcards lists the names of all soundcards -or synthesizers- that a Musical Generator found in your computer during startup. If you click at it the names are shown. If you have more than one synthesizer (as most soundblaster owners do) a list of synthesizers is presented. Choose the synthesizer you want to hear the playback from. All channels will be played back via this synthesizer.

The selection you make in the global settings will be applied to all MIDI channels. You can assign a different synthesizer to each MIDI channel by double clicking the MIDI channel and using the MIDI channel editor. Note that when you press play, a Musical Generator grabs all synthesizers available and labels these with an asterisk (*). Not all synthesizers need be available, for example when you use a sequencer, this program may have selected one or more synthesizers. If you want to have more choice, close this program or deselect some synthesizers, using the MIDI base editor. When no synthesizer is available, a Musical Generator cannot play and will tell you so.

If you don't have any synthesizer, a Musical Generator will tell you so during startup. You can continue, but you cannot playback your music.

How to change the sound of a channel

Each channel can have a different instrument (in MIDI terms often called patch or program). The default is the Grand Piano for each channel.

Exercise Double click on a channel and a dialog pops up. You can change the patch of the specific channel. Also you can decide whether you want to silence this specific channel by checking silence channel.

How to change the length of your music

The length of the music in measured in measures, each with a certain denominator and a number of beats. All these parameters you can change in the section labeled measures (right below in the application window).

How to change the tone scale

A musical scale indicates which notes should be included in the music and which not. There are a lot of scales included in a Musical Generator and you can add your own scales (with the Tone scale editor). By choosing a different scale the atmosphere of the music changes. When changing the tone scale of the global settings, the tone scales of each MIDI channel are changed. You can assign a different tone scale to each MIDI channel by using the Aspect editor.

How to change the tempo of the music

The standard tempo is measures in beats per minute (bpm). You can change the tempo with the tempo slider. A number indicates how many quarter notes should be included in a minute. A lower number slows down the music, a higher one speeds it up.

6. How to convert text, bitmaps and numbers into vectors

In this section you will learn how to convert Text, Bitmaps and Numbers into music. You will learn:

  • Converting text into a vector
  • Converting bitmaps into a vector
  • Converting numbers into a vector

Converting text into a vector

Text can be typed into a vector, read from a file (select File|Open and choose text file) or pasted from the clipboard. Because the basic material of a Musical Generator consists of vectors and vectors consist of numbers, text must be translated into numbers. The rules of converting text to numbers are the following:

  • All non-letter symbols are stripped from the text
  • All remaining letters are uppercased
  • The letters are converted into their ASCII representation (A=65, B=66, .. Z=90).

After these rules have been applied, the text is converted into a data vector and the text cannot be recovered.

Exercise Select the Data tabe and press the T button. Now enter “John Kennedy” and press OK. A vector named “Text” should have appeared. Right click on it, select Rename and call it “John”. The next vector we'll read from file. Select File|Open. Go to the Examples directory and choose *.txt as file type and open the file Marilyn.txt. The text editor comes up with the contents of the file. Click OK again.

Select channel 1, drag John to the notes button, select channel 2 and drag Marilyn to the notes button. Press play: a stormy affair, isn't it?

Is it? That depends a lot on your controls. Select for example for both channels a string patch and a tempo of 128 bpm. Press play and listen to the change of music. How did it all end? Select the Chromatic tone scale and you'll feel it.

Converting bitmaps into a vector

Bitmaps can be read from file (select File|Open and choose bitmap file) or pasted from the clipboard. They are automatically converted into one or three data vector depending on the number of colors present in the bitmap.

  • Two colors. When there are exactly two colors in the bitmap and one of them is white, the bitmap is interpreted as a line on a white background. For each point along the horizontal axis the height of the first non-white pixel is computed and stored as a number in the data vector.
  • More colors. When there are more colors in the bitmap (or non of them is white), the picture is scanned pixel for pixel (for each horizontal point, all vertical points are scanned) and dissected into their three basic colors: Red Green and Blue. These three colors are inserted as vectors into the data section.

Exercise (two colors) Select File|Open. Go to the Examples directory, choose *.bmp as file type and select the file Graph.bmp. A vector is entered in the data section.

Exercise (more colors) Select File|Open. Go to the Examples directory, choose *.bmp as file type and select the file Earth.bmp. Now three vectors are entered in the data section: Red, Green and Blue. Make a plot of these vectors.

Converting numbers into a vector

Numbers can be typed directly into a vector (select the Data tab and click N) or read from file (select File|Open and select space delimited files (*.prn) as file type). Numbers should be ASCII text and delimited by spaces. You can save Excel files (and undoubtedly other spreadsheet files as well) by choosing save as in Excel and choose to save (parts of) your spreadsheet as a space-delimited file (these are *.prn files).

7. Introducing fractal

Fractals are mathematical expressions that yield interesting pictures. They are characterized by endless repetition and are often used for stunning pictures and landscapes. But they are also well suited for creating music, as you will learn in this lesson. In this lesson you will learn: * Inserting a fractal as a vector * About the dimensions of a fractal * How to edit a fractal * Build your own fractals

Inserting a fractal as vector

The tabs Dynamic systems and Complex maps contain fractals. Each type contains a lot of fractals. Experiment with these because they have quite different characteristics. Plot these first so you can see how they behave.

Exercise Select the Dynamic systems tab and click at the Martin fractal. Drag it to the notes button and play it. It is always a good thing to see what you hear, so plot the fractal.

Dimensions

A fractal can have more free dimensions than the vectors we have seen till now.

Exercise If you haven't assigned the Martin fractal to the notes button, do so. Click the notes button. You see that both the X and Y dimension can be chosen. Until now you have heard the Y dimension. Choose the X dimension and click close. Play the music again.

Editing a fractal

Fractals can be edited in the same way as other vectors. Each fractal has its own editor. You will notice different parameters for each fractal. You can play with these without any problem. Sometimes a fractal crashes when parameters are too weird, but mostly the program continues. If you have created an interesting piece of music, save before you start fiddling around with the parameters of a fractal. There are several types of fractals and for each type there exists a fractal editor.

Exercise Double click on the Martin vector. Change the parameter a from 3.1400 to 3.1700. Press OK. After some time you will see that the shape of the vector changes. Now play the music again.

Build your own Fractals

The most exciting thing (in my opinion) is trying to build your own fractals, but you must have some idea of common mathematics. Fractals are based on self referencing. That means that expressions like:

 x = a - sin (y)
 y = sin (x) - cos (y)
 z = x * y

are quite common. The X before the equals sign denotes the newly to be computed X. Note that in this example the X and Y after the equals sign refer to the current X and Y values. So in the expression y = sin (x) - cos (y), the current X is used, even when a new X was computed in the former equation.

A Musical Generator iterates the equations from 1 to N. N is a value you can provide. The iteration value is assigned to the variable T. So you have four variables: T (the iteration variable) and X, Y, Z: the variables for each dimension. The equation computed for Z is used for the color, you may omit this equation. An equation for Y must be supplied. If you omit the equation for X, the value for T will be assumed. That means that if you provide only the equation: y = sin (x), y will assume the value sin (1), sin (2) .. sin (N).

Apart from the variables you may provide up to five parameters: A .. E. These do not change during the computation of the formula, you can set these when you edit the formulas.

How to create your own fractal? Select the Dynamic Sytems tab and click the button Your own fractal {bml but_user.bmp} The user editor comes up, and you can supply the formulas, starting values of the fractal and the values for the parameters.

8. Exporting your music

Once you have generated music you can export it to other programs (i.e. sequencers) in two ways: * Save it as a MIDI file * Record it in another program

Save music in a MIDI file

Choose File|Save as. From the file type option box, choose MIDI file. All MIDI events will be saved as a MIDI file, format 1 type.

Record music in another program

A Musical Generator has the capability of synchronizing other programs that allow their clock to be controlled by the MIDI time clock. First you have to set your sequencer to be set its external clock. By pressing the synchronize button {bml synchronize.bmp} a start signal is sent. When music is played clock signals together with all MIDI messages are output to the MIDI output port. Which port that should be, is determined by the MIDI base editor (click Edit|MIDI connections). A Musical Generator defaults to a best guess.

In order that this should work however the MIDI output port must be connected to the MIDI input port. This can be done in hardware and maybe also in software, however I am not aware of such a solution.

9. Handling time

Time is rather difficult in a Musical Generator, that is why we have delayed discussing the subject so far. There are three ways to handle time. You can set a different way with different parameters for each channel using the time aspect button. * What is time * The standard way * Using a time window * Using a vector

What is time

Time has a lot of philosophical implications which will not be treated here, but we can say something on how a Musical Generator handles time. The shortest unit of time in a Musical Generator is the 32nd note. In a Musical Generator it has a value of 1. This means a 16th note has a duration value of 2, and a quarter note of 8. The length of a piece is determined by its number of measures times the number of 32nd's in each measure. A standard 4/4 measure contains 32/32nd's, so ten measures of 4/4 has a maximum length of 320 time units.

The standard way of handling time

This is very straightforward. The piece begins at time 0 and continues to the maximum time. A note starts when the former note has finished.

Using a time window

You can put a time window over the vector, meaning that it can begin at a later time and ends earlier. When you click at the time button, look at the values for minimum and maximum. These are initially empty, meaning they are provided by default. Behind the maximum is the current maximum listed, but this can change as you change parameters. When you type in a number in the minimum box i.e. 32, the channel starts at time 32, in a 4/4 piece one measure later. Likewise, typing in a number for maximum will this channel cease to sound when that time has come.

Exercise We will create a four channel piece, with the same vector starting one measure later.

Start with a clean Musical Generator. Insert the Chip vector. Assign it to the notes of channel 1 to 4. Our piece has a 4/4 measure, so we know that the duration of a measure is 32 time units. Click at the time button of channel two, type in 32 at the minimum and click Ok. Insert 64 as the minimum of channel 3 and 96 for channel four. Show the piano roll. Click play. You have defined a fugue with a Musical Generator.

Using a vector

The vector values are rescaled and each note of the notes vector will be played at the time which comes from the time vector. This means that the notes are not successively following each other but might be mixed in a complete different order. I am not sure about the value of this feature. Maybe you can find a good use for it. In the examples section are some samples that use the time aspect.

10. Handling Drums

Handling drums is by no means different than handling music with a Musical Generator. However, especially for those who would like to have strict control over their rhythms, there follows an extended lesson.

Some drum examples can be found in the Examples directory. They are implementations from “Teach yourself rock drumming” from Mike Finkelstein. The examples are the filenames preceded by “Drums – “. Try these, look at the different aspects duration, time) and try to understand why they play as you hear. * Fractalizing drums * Exact timing * Calculating rhythms

Fractalizing drums

To add drums, just click the drums tab. You see 16 drum channels at your disposal. They have been supplied with a default drum, but you can change any drum by just double clicking at a drum channel and select another drum. As you note there is no notes button in this tab, because drums concern rhythm, not pitch. You can fractalize a drum by just dragging a vector to the duration, speed and time aspect.

Exact timing

The difficulty is in the exact timing of drums when you wish to establish a strict drumming pattern. This is possible with a Musical generator, but requires some calculations. Maybe this will change in the future but this will depend on user input, as I am no drum expert.

How to get a drum? When you click the drums tab you see the 16 drum channels, each with an unchecked checkbox. The first channel is labeled High tom 1, check its checkbox and press play. Why do you hear what you hear? The sound is the sound that your soundcard provides for the sound of a High tom 1. If you wish to change the sound double click at drum channel 1 and change the drum. Click play again. Why is it drumming so fast? Click at the duration button and change the default (4) to 8. It has slowed down quite a lot.

Calculating rhythms

Now some calculations. This is the unpleasant part of a Musical Generator, but as said before: any suggestions will be appreciated. When in doubt consult the section on time. The default duration is 4, meaning an eighth note. If you change it to 8, you change it to a quarter note.

Exercise Suppose you wish a syncopated rhythm, for example an eighth nothing and three strikes of a eighth note. You need a vector with 8 8 16. You create that vector by clicking at the vector tab Data, entering these numbers, drag it to the duration aspect of the Kick drum 1. To understand the result better, click the checkbox of the High tom 1 and set its default duration to 16. Press play and you will find that the result is wrong. Why?

If you click at the duration aspect, you will see the rescale option is on. In this particular case, now you have computed painfully the right notes, you just don’t want that. Switch rescale of, press ok and click play again.

Still it sounds wrong, there is no syncopation. The piece starts with a beat at the moment you want to hear nothing. This can be remedied by changing the time at which this vector starts to play. Click at the time button, change the minimum to 8, click ok and play again.

tutorial.txt · Last modified: 2011/02/28 15:59 by arnold0_dokuwiki
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki