CDP GrainMill HTML Help File

Please select a topic:

GrainMill Reference

  • What is GrainMill?
  • Getting a basic understanding of GrainMill
  • How to RUN GrainMill
  • Using RANGE to set a group of changing values
  • SHAPING grains to avoid clicks
  • TIMESTRETCH to extend the duration
  • Altering the DENSITY of the sound texture
  • Adjusting the SIZE of the grains
  • Location of grains in source file WANDERs about
  • Moving the grains up and down in PITCH
  • Controlling LOUDNESS
  • Randomizing output grain timing with SCATTER
  •  SPATIAL location: granular panning
  • Problems?
  • BrkEdit Reference

  • Startup, Save & Compare
  • Operation
  • Zoom/Scroll
  • Edit
  • Settings
  • Help
  • Return to top

    Glossary Items

    If working without a frame-based browser, only link to the glossary items from here, not from within the main part of the text. Those links go to another frame.
  • The input soundfile: the sound with which you begin
  • The output soundfile: the sound you create
  • What is a 'grain' of sound?
  • Decibels: a measure of loudness
  • Milliseconds: a measure of time
  • Timbre: a description of tone quality
  • Splices: butt and sloping joins
  • Panning a sound
  • Mono and stereo soundfiles
  • Default settings
  • Attack - Sustain - Decay: envelope shapes
  • Return GrainMill contents


    What is GrainMill?

    GrainMill has been prepared as the first of CDP's powerful programs to have a graphic interface. It is derived from GRANULA, written by Trevor Wishart and available in the CDP System in various versions since 1990. The intention is to make these comprehensive facilities for granular synthesis and sound transformation accessible to a wider range of users, faster and easier to use. We are pleased to acknowledge the support of the Sonic Arts Network, which kick-started this project, the Arts Council of England, which supported the preparatory phase with a generous grant, and the Esmée Fairbairn Charitable Trust, which provided a large grant, enabling us to complete the work.

    NB – GrainMill also uses conventional integrated Help documentation, on which this HTML documentation is based. Microsoft intends all help to be HTML-based, eventually, but we are retaining the old Winhelp format for the moment (built-in HTML Help requires Internet Explorer v 4, which not everybody is using yet!).

    GrainMill transforms a sound by cutting it into small pieces, called grains, then reassembling the grains to reconstruct a new sound. If we simply cut a sound into chunks, then rejoin them end-to-end in the same order, we will end up with the sound we started with! To transform the sound, we need to reassemble the grains in a new way. The simplest grain waveform is a sine wave of arbitrary pitch. However, any input sound can be used, including Frequency Modulated (FM) waves, and sounds such as chirp waves (a sine wave of rapidly increasing pitch), as well as acoustically sampled waveforms.

    GrainMill provides us with several 'new ways' to explore: we can stretch out the original sound in time (TIMESTRETCH), we can alter the density of the grains (DENSITY), we can define a 'searchfield' area in the infile from which to select each grain (WANDER), we can change the size (duration) of the grains (GRAINSIZE), we can change the pitch or loudness of each grain (PITCH and LOUDNESS), and we can move them about in space (SPACE). We can also vary the regularity of their spacing in the outfile (SCATTER). Each of these ways to change the sound can be used separately or in combination.

    NB - If moving back and forth in the same file, you can successfully use 'Back' on your Browser to return to your previous position(s). If moving about between files with the Quick Reference listing, use the direct links.
    Return to GrainMill contents
    Return to Quick Reference


    Getting a basic understanding of GrainMill

    It is useful to appreciate that GrainMill is able to reproduce the original sound nearly exactly. It will do this if the DENSITY is at least 2 and no other random factors are called upon.

    For example one can use GrainMill to perform a simple transposition without changing the duration or other sonic characteristics of the outfile. To do this, DENSITY is set to at least 2, TIMESTRETCH is set to 1, a fixed PITCH Pitch change is selected and no random factors are invoked (e.g., by using RANGE(S)). The original sound will be smoothly reconstructed at a different pitch. A somewhat more sophisticated and effective result would be produced if DENSITY were set to about 8 (or preferably a Range between 4 and 12), and a Range of GRAINSIZES was also used.

    You can create a simple granulation effect by setting DENSITY to 1. Now the grains are end-to-end and one can hear the way the SHAPING of the grains causes fluctuations in the loudness of each grain.

    True granular effects begin to occur when DENSITY is much higher (e.g., 50 to 200), whereby there will be many grains in the outfile where there was just one in the infile. However, to achieve an audible granulation effect, the timing (WANDER and/or SCATTER) and/or pitch level (PITCH) and/or stereo spread (SPACE) needs to be varied randomly, in the case of the latter two by using them with the RANGE option. Without these random changes, grains are simply copied onto themselves and, however high the DENSITY, the outfile will still sound identical to the infile. When each of these many grains is different in e.g. pitch or loudness or source location (WANDER), and the sound is also being stretched out considerably, a complex sonic stream is produced.

    GrainMill provides a vast scope of possibilities to explore between smooth reconstruction and massively dense, complex textures in which the granulation effects are dramatically audible.

    Return to GrainMill contents
    Return to Quick Reference


    How to RUN GrainMill

    RUN topics:
  • A sense of exploration
  • Starting up GrainMill
  • The Toolbar facilities
  • Processing with fixed values
  • Activating a range of values
  • Settings for your working environment
  • Time-varying values & BrkEdit
  • Make and Play the new sound
  • Continuing with the existing settings
  • Restarting with new or saved settings
  • Explore with an adventurous spirit

    Using the program is straightforward, but requires both careful thought and an adventurous spirit, because it offers many and varied possibilities. Many of the typical sounds of granular synthesis are very different from those heard on most commercial synthesizers or effects devices. It is a good idea to explore it freely, trying out various settings and combinations of settings 'just to see what happens' - and observing just what does happen. After a time, you will observe how certain settings produce certain results, and you will then gain more understanding of and control over the results.

    Return to RUN topics
    Return to GrainMill contents
    Return to Quick Reference
     

    Startup

    The program is usually run by double-clicking on the GrainMill icon. The main window is displayed. Start by going to the File menu and choose a soundfile, using the Open Soundfile dialog. The soundfile which must be MONO. You can do the same thing by clicking the appropriate Toolbar button. GrainMill may ask you if you want to 'Change to a new Working Directory' - i.e. to the directory containing your selected soundfile. Generally, you will say 'Yes'; but you can always change it later. You would say 'No' if, for example, you were already in your chosen Working Directory, and just wanted to use a different input sound. The 'Working Directory' is where you keep all your .grn files and Time Contour files for a project.
    (You may need to change directories to get to the directory and sound with which you want to work. Click on the  'Working directory' button on the Toolbar.)
    The existing soundfile which you open in this way and which you will then process with GrainMill to make a new sound, is called the 'infile'. The resulting new sound is called the 'outfile'.

    You may  want to load settings saved during a previous working session, or one of the examples supplied with GrainMill. Use Open grnfile on the Toolbar (or Load Settings in the File drop-down menu) to load the binary data file for the project. Select the .grn file you want to use – later on, it will also be on the 'most recently used files' portion of the File menu.

    You can also launch GrainMill by double-clicking on an existing .grn file, or by dragging a .grn file or soundfile to the GrainMill icon.. With a .grn file, GrainMill will look for an associated soundfile, if given, and attempt to load it. If no soundfile is specified in the .grn file, GrainMill will still start, but will not be able to load the settings.

    Finally, it is possible to launch GrainMill from a command line (DOS Console), with a .grn file or soundfile as an optional argument. This method requires GrainMill either to be in your current directory, or in a folder specified in your PATH as given in AUTOEXEC.BAT (recommended).

    Return to RUN topics
    Return to GrainMill contents
    Return to Quick Reference
     

    Toolbar 

    The Toolbar at the top of the main window  has 10 buttons. Each button corresponds to a  menu option. In order, left to right: Return to RUN topics
    Return to GrainMill contents
    Return to Quick Reference

    Processing a sound with fixed values

    After you open the infile, a large dialog box will appear, filling the screen. The dialog contains a number of horizontal sliders, which are used to set fixed values for a parameter.  The main menu is still available, awaiting, for example, a different infile to be selected without quitting the dialog box.

    Parameters  are named on the left of the dialog, starting with TIMESTRETCH at the top of the screen and ending with SPACE at the bottom of the screen. To the right of these  names are two or three 'radio' buttons, marked L M H for Low, Medium, and High value spans:

    You can click on these buttons to select one of three default spans between the lowest and highest values which can be used for that processing option.
    The High span will display the highest possible value that can be given. The Medium span enables you to use the slider bar to select among a span of midrange values. And the Low span enables you to move the slider bar through a span of small values.

    The value selected in this way is a FIXED value which stays the same as the sound is created.

    Return to RUN topics
    Return to GrainMill contents
    Return to Quick Reference

    Activating RANGE to use a range of values

    It is possible to make sounds in which these values vary randomly within a user-defined RANGE of values.

    When you click on the box to the right of the word RANGE,  a second set of controls appears above the original one. Now the lower (original) slider bar is used to set the lower of the two values in this range, and the upper (new) slider bar is used to set the upper of the two values in this range.

    You will notice that the program will not let you set a High value (upper slider) which is lower than the Low value (lower slider), nor a Low value (lower slider) higher than the High value (upper slider). The slider just clicks back to the value in the other slider when you try to move it to these illogical positions.

    Return to RUN topics
    Return to GrainMill contents
    Return to Quick Reference
     
     

    System Settings

    There are two main options in the SETTINGS dialog box accessible via the Toolbar. These define the overall system environment in which you would prefer to work. The settings are remembered when GrainMill is closed, so that next time, it will start just as you left it.

    The first of the main options concerns how you save the soundfiles you make. This can be done:

    The second main option asks you whether or not you want to 'keep the dialog visible'. Return to RUN topics
    Return to GrainMill contents
    Return to Quick Reference

    Time-varying values & BrkEdit

    It is also possible to vary most of the the parameter values over time. This involves creating a Time Contour ( 'breakpoint file' - extension .brk) which specifies a time and the parameter value at that time. Programs such as GrainMill work out values for intermediate times by using 'interpolation' (in effect, looking up the value on a graph).

    This is an example of the simplest possible Time Contour:
    0.0 0.0
    2.0 2.5

    Here, the value rises steadily ('linearly') from zero at the start to 0.5 over 2 seconds. The interpolated value at  time = 1.0 is 1.25.

    The time-varying section of the GrainMill dialog box is on the right hand side of the page:

    You can enter or browse for the name of an existing .brk file, or you can click on the 'E' (Editor) button to invoke BrkEdit to create or edit a  file graphically. For each parameter, GrainMill sends BrkEdit a default contour, fitting the duration of the infile, which BrkEdit will use if a named file does not exist, or if you select New from the BrkEdit File menu.

    Time Contour files can also be written by hand, using a text editor, as in the example above. The one rule about a Time Contour file is that in the first column, giving times, the values must be increasing, and start at zero (GrainMill cannot do time travel!). It is also a good idea (though not, strictly speaking, illegal) to avoid having two successive lines with the same time. This implies an instantaneous change, which usually results in a nasty click or 'glitch' in the sound.

    GrainMill and BrkEdit also support  a  new 'extended format' with additional textual information regarding the type of line span (logarithmic or exponential). These tell programs to interpolate using a special curve, rather than a straight line. See the BrkEdit documentation for more information.

    If in doubt, use BrkEdit to create a .grn file, and look at that with a text editor (such as Windows 'Notepad') to see what it has done.

    Return to RUN topics
    Return to GrainMill contents
    Return to Quick Reference

    Make ­ Play ­ Continue ­ Restart

    MAKE
    After the various settings have been made, the sound is created by clicking on the MAKE IT button. You see the main screen fill up with the grains you have made, one mark for each grain, colour-coded for loudness. Sometimes you may unintentionally have settings which will make many thousands of grains and take a long time to process. The Stop Processing button on the Toolbar is your way out.

    PLAY
    You can now PLAY the sound you've made. Select Play Outfile from the Options menu, from the toolbar button, or (most conveniently) from the Spacebar. If you see that it's going to be very long and you've heard enough, you can Stop Playback in the same way.

    CONTINUE
    If you click on the dialog toolbar button, or select View->Show Dialog from the main menu,  GrainMill will restore the dialog box with all your settings and you can carry on making alterations. Alternatively, you can ask GrainMill to keep the dialog box visible all the time by selecting that option via the Options->Settings menu. The dialog will also be redisplayed if you select your current infile from the ‘Most recently used’ list of files under the File menu. If you use the ‘Keep Dialog Visible' option, you can move both the dialog and the main window independently so that the latter is not obscured. The main window can also be resized.

    Note that because ‘try and retry’ is likely to be the most common way of using GrainMill, we have tried to minimize the degree of interruption from warning messages. Thus, when you redo a sound, you will not be warned that your current soundfile is not saved.  However, if you are using the ‘Write Directly to Disk’ option, and set the name of an existing file, you will asked be whether you want to overwrite it.

    You can change parameters (assuming you are keeping the dialog visible) and click MAKE IT even while a sound is still being played back (this is fastest when using the default temporary-file system) - a series of small changes can be explored very quickly this way.

    RESTART
    You can select a new infile from the menu so long as no processing is going on; this will reset the dialog box parameters to their default settings. To keep your settings when loading a new soundfile, they will need to be saved to a .grn file. As noted above, GrainMill will not warn you that settings need to be saved!

    SAVE SETTINGS
    This will create a binary file with the extension .grn which contains the fixed parameter settings and the names of any breakpoint files used to create your sound. Optionally, it can 'associate' your infile name with the settings. A .grn file including an infile association can be used to launch GrainMill - so long as the infile is where it is claimed to be! You might like to think of a generic .grn file without an infile association as  a 'preset', and  a .grn file with an association as a 'project'.

    LOAD SETTINGS
    Load a .grn file, as created above.

    SAVE AS TEXT
    This saves the settings in the dialogue box as a text file as a way of documenting your work. It cannot be re-loaded. The binary .grn file is intended for re-loading.

    Return to RUN topics
    Return to GrainMill contents
    Return to Quick Reference


    Using Range to set a a group of changing values

    The Range option is absolutely essential if good results are to be achieved with GrainMill. When you activate this option by clicking on the little box next to the word 'Range', a second set of controls appears for that particular parameter. The lower slider bar is used to set a low limit and the upper slider bar is used to set a high limit for a range of numbers. GrainMill then, for each grain, selects a value at random from somewhere between these limits. This grain-by-grain randomization of values adds the essential qualities of variety and plasticity to the final result - the special sound of granular synthesis.

    Return to GrainMill contents
    Return to Quick Reference


    Shaping grains to avoid clicks

    Creating sounds with grains raises the question as to how the grains are joined together. You can run GrainMill in such a way that it creates audible gaps between grains ­ a staccato or hiccuping effect. However, if the new sound you make is to have no silent gaps between the grains, it seems obvious that the grains must either overlap one another, or 'just touch' one another. In practice, however, the grains must always overlap just a little bit, to produce a continuous output sound. Why is this?

    It is not possible simply to chop up sound as if with a knife. If you do this, you will produce a click where the cut sound ends, because the volume is likely to fall off a cliff, as it were: from high to nothing within an instant. Among other things, the physical mechanism reproducing the sound for our ears cannot cope with such an abrupt change. To avoid this, we use a tapered cut, called a 'splice slope':

    A splice crescendos from silence at the start of the sound (its 'attack'), or decrescendos into silence at the end of the sound (it's 'decay') ­ though butt joins are also possible (no sloping envelope at all). In this case, the 'sound' is a single grain. However, we usually don't want to hear these little crescendos and decrescendos in our new sound because of the tremolo effect produced by the (very) rapid fall-rise-fall-rise etc. in volume. It is for this reason that the program overlaps the grains a little, so that the crescendo on the following grain comes in as the previous grain decrescendos, thus maintaining a certain consistency of volume.

    Return to GrainMill contents
    Return to Quick Reference


    Stretching time with GrainMill

    TIMESTRETCH alters the length (duration) of the outfile.

    When the TIMESTRETCH slider bar is set to a value greater than 1, grains which overlap are cut from the infile and then reassembled in the outfile in such a way that they do not overlap as much, thus stretching out the sound.

    When the TIMESTRETCH value is 1, there is no change.

    When the TIMESTRETCH value is less than 1, grains which do not overlap are cut from infile (there may even be gaps between these grains: bits of soundfile missed out) and then reassembled in such a way that they do overlap, thus shrinking the sound.

    The upper limit of TIMESTRETCH can be very high and should be used with caution (i.e. not with a long infile!). If you find you have done this by accident, it is always possible to stop processing - you are not required to wait for it to complete!

    The 'Length' box at the bottom of the dialog box shows the effect of changing both TIMESTRETCH and GRAINSIZE. The duration is a maximum estimate, and can be edited if necessary.

    Return to GrainMill contents
    Return to Quick Reference


    Altering the density of the sound texture

    When DENSITY is 1, the grains are placed end to end (a butt edit) and the original sound pulsates slightly at a speed related to the grainsize.

    As DENSITY becomes increasingly greater than 1 (more dense), the grains overlap more and more, producing a continuous to smooth/dense sound. For example, when DENSITY is set to 5, there will be 5 grains in the outfile where there was 1 grain in the infile, i.e., 5 grains overlapped where previously there was only 1 grain. When one or more of the RANGE options are activated, each of these 5 grains will be separately processed. This is how the outfile becomes more and more complex. Densities of 50, 100, or even 200 simply make the outfile texture more and more complex ­ depending on the other settings. The upper limit in this program is 256. High densities are most likely to be needed when creating stereo sounds, or when spreading over a very wide pitch range.

    As DENSITY becomes progressively less than 1, we begin to hear silences between the grains. If the grains are very short, and the density is only just below 1, this will appear as a kind of grittiness in the new sound. But if the density is nearer to 0, the new sound will contain a sparse texture of isolated grains or droplets.

    Return to main GrainMill contents
    Return to Quick Reference


    Adjusting the size of the grains

    The size (i.e., duration) of each grain has a major effect on the result. In the first place, the fact that each grain of sound has splice slopes sets some limits which cannot be over-stepped. The fact that we need two of these splices for every grain (one ascending from silence and one descending to silence) limits the size of the grains we can use: the smallest grain cannot be shorter than the two splices ­ don't worry, the program makes this impossible. The smallest grain allowed by the program is currently 12.5 milliseconds (0.0125 sec), and this provides the space needed for the splice slopes at the beginning and end of each grain.

    Furthermore, if the grains are very, very, very short, they will contain so little information from the original sound that its qualities will be destroyed. So there is a lower limit on the size of the grains. If your grains are about 50 milliseconds in length (0.05 of a second), they will happily capture the qualities of your sound.

    Once the grains become much longer than this, we create a different effect. Almost every natural sound changes through time: it changes pitch, loudness, and its timbre. If you are using grains to timestretch a sound to double its length, the grains you cut from the original sound will use overlapped portions of the original sound. In fact, each grain will contain a copy of half the previous grain.

    If the original sound is itself changing, and your grain is sufficiently long, the sound inside the grain will itself be changing. When you now place the next grain after the first, you will hear that change in the sound being repeated ... the output sound will seem to backtrack to a place earlier in the change-process. There will be a kind of very fast echo inside the sound.

    These 'internal echoes' may be a very interesting effect if this is what you want to hear. However, if you just want to make your original sound longer, you need to minimize this echoing. It turns out that a grainsize of around 50 milliseconds (0.05 sec) captures enough of your sound to retain its special sound quality, but not so much of it that you are able to hear any change in the sound within the grain. Using grains of about 50 to 60 ms allows the sound to be stretched without any sense of internal echoes. As complete regularity in grains can sometimes lead to undesirable phasing effects, a good idea is to use a RANGE to select grainsizes between, say, 40 and 90 milliseconds.

    Grainsizes longer than 50 ms allow more of the original sound to come through. A sandy beach reveals very little of the shape and quality of the original stones from which the sand was ground, but shingle is much closer to the original shape and texture of the rock from which it was formed. Note that there is a relationship between the type of input sound and the effect a given grainsize will have. The sharper (faster) the attack transient in the infile, the more it will be present in the grain, even with a fairly short grainsize, and certainly with a grainsize as long as or longer than this attack transient.

    Return to GrainMill contents
    Return to Quick Reference

    Using a range of grainsizes

    The RANGE option enables you to set a range of grainsizes. When activated by clicking on the box next to the word RANGE, a second slider appears. The lower slider is used to set the low limit of the range, and the upper slider is used to set the high limit of the range. Now the program will pick out grainsizes at random between these two ranges, a different grainsize for each grain. Introducing this random suppleness into the texture improves the result considerably:   it is more lively and feels more natural.

    A very good range to choose is between 50 ms and 80 ms. Ranges greater than 100 ms (0.01 sec) will begin to produce collage-type textures, i.e., sounds in which portions of the infile are distinctly recognizable.

    On internal echoes

    Echoes inside the new sound can be useful. Room reverberation is produced when the sound waves from some event in a room bounce back off walls, floors, ceilings and other surfaces, producing a multitude of slightly different copies of the original sound - each arriving at our ears at a slightly different time. There are so many of these different echoes that we hear them not as true echoes, but as reverberation, which enlivens and enriches the original sound.

    If you:

    ... then you will produce an effect like the reverberation of a room.

    Once your grains start to become any larger than 50 ms (0.05 sec), you will generate obvious echoes inside your reconstructed sound. If your grains are 'very' long (e.g., 1 second) and if you use the WANDER process over a very large span, you will produce a kind of random collage of pieces of your original sound.

    Return to GrainMill contents
    Return to Quick Reference


    Wandering grain locations

    WANDER defines a length of soundfile within which the next grain is to be selected at random. The longer the length, the more likely it is that the new grain will come from a location ever more further away from the previous grain. This length is sometimes called a 'searchfield', i.e., the span of sound to search when selecting a grain. A small searchfield to 'wander' about in will result in a somewhat blurred image, whereas a large searchfield will result in scrambling the original sound.

    With WANDER set to 0, grains are selected from the  infile in the strict order in which they were cut in the first place With WANDER set to (say) 0.1 sec (100 ms), a grain is chosen from the infile within a range of 0.1 seconds before the 'true' position. In other words, there is a certain vagueness about the order of the grains chosen for use in your new sound. The larger the WANDER, the more vagueness there is!

    And if you set WANDER to cover the entire length of the original sound, then the vagueness will be complete: your original sound will become completely scrambled. It is useful to know that the searchfield gradually expands when it is set to the length of the entire soundfile. GrainMill reads through the infile, and as it does so its 'here' position is moving through the file. The searchfield is from the beginning of the file to 'here' and thus gradually gets larger and larger. This means that the scrambling effect will be somewhat minimal at the start and then increase steadily. This transitional process from smooth to chaotic can be useful musically.

    In this extreme case, the infile is not so much a single source sound, but a sort of database - any part of it may appear anywhere in the outfile!

    Return to GrainMill contents
    Return to Quick Reference


    Moving the pitch of grains up or down

    Each individual grain can be altered in pitch. When you set PITCH to a (fixed) position along the pitch span slider bar, all the grains are transposed by this amount.

    The span of pitch change values is roughly based on 12, so that each integer change represents a transposition of more or less 1 semitone.

    Values less than zero (i.e., negative values, such as -0.5) transpose the grains downwards in pitch. Remember to precede the number with a minus sign!

    Note that altering the pitch also alters the length of the grains (higher pitch shortens grains, lower pitch lengthens grains. However, if you set TIMESTRETCH to 1, the duration of the outfile will remain the same as the infile, because of the way the grains are reassembled.

    When you activate the RANGE button, a second slider appears and you can set lower and upper limits to a range of transposition values. The program will then, for each grain, select a transposition value at random from somewhere within this range. The sonic results of these random jumps of pitch can vary remarkably as the size of the range is increased.

    GrainMill works hard to ensure that the quality of transposed grains is as high as possible, but with extreme transpositions, some loss of quality (or, at least, some change in character) is likely. Most importantly, GrainMill does not filter each grain (it would add too much time to the processing), so if the infile contains  a lot of high-frequency sound, and you set a high upwards transposition, those high frequencies may end up too high for the sampling rate of the file. This is called 'aliasing', and is heard as unexpected low frequencies appearing in the sound, and sometimes a sort of added buzziness. If this becomes a problem, then you may need to use an external sound editor (or the filtering programs in the CDP system, of course!) to filter out the higher frequencies in your source sound.

    Return to GrainMill contents
    Return to Quick Reference


    Controlling the loudness of the grains

    Each individual grain can be altered in loudness (also known as 'amplitude'). When you set LOUDNESS to a (fixed) position along the slider, all the grains become correspondingly louder or softer. The LOUDNESS span works with the decibel (dB) scale and extends from almost silence (-60dB) to full (original) volume (0 dB). Note that it is not possible to amplify the infile - only to reduce it.

    When you activate the RANGE button,  you can set lower and upper limits to a range of loudness values. The program will then, for each grain, select a  level at random from somewhere within this range. Having a range of random loudness values in the texture adds a great deal to the character of a granular sound. It is especially worth experimenting with GRAINSIZE, to get different effects.

    Return to GrainMill contents
    Return to Quick Reference


    Timing scatter of output grains

    TIMING SCATTER is adjusted by moving the slider control. SCATTER creates small random fluctuations in the timing of the grains in the soundfile created by GrainMill. It is a simple percentage scale, relative to the size of the grain.This may produce a more supple, natural feel in the flow of the grains. If it is set to zero, modulation and pitch artefacts (very similar to some 'comb filter' effects) may result from the regular timing of the grains - this may of course be just what you want! Careful control of SCATTER can be important when trying to do fairly 'clean' timestretching or pitch shifting - i.e. when trying to minimize audible granulation. Some worthwhile effects can be achieved when both SCATTER and WANDER are set to zero, but grains are nevertheless randomized in some other way, such as through PITCH or SPACE. The control comes up with a default setting which may be retained until a reason do otherwise becomes apparent.

    Return to GrainMill contents
    Return to Quick Reference


    Spatial location

    Here we are processing the movement of sound through space: to be more precise, the Left <­  ­> Right movement of a stereo image across a horizontal plane, known as 'panning'. The SPACE process positions each grain in the horizontal stereo field. It is important to appreciate the difference between grain panning and conventional audio panning. With grain panning, the whole grain (however long) occupies a particular fixed position in the stereo field. With small grains, a diffuse ambient soundfield is created; with long grains, individual sounds can be heard in various positions, but a single grain will not move from one position to another.

    When RANGE is activated, a second slider bar appears and a specific range can be selected, usually using the lower bar for the Left limit, and the upper bar for the Right limit.

    Full Left on the lower slider bar + full Right on the upper slider bar sets the full stereo field as the range within which each grain is randomly positioned. This can be tightened by moving the sliders more to the middle.

    If both sliders are set to Centre (the defaults), the program will produce a mono outfile (making it pointless to use the RANGE option). Note that any non-zero SPACE value will cause the program to produce a stereo outfile. However, the sound can be located on only one channel of this stereo soundfile if either:

    a single (fixed) value to the Left or Right of Centre is used,
    OR
    both sliders are close to the Left or Right.
    Return to GrainMill contents
    Return to Quick Reference
     
     

    Problems?

    Most of the difficulties the user will encounter in using GrainMill willarise from the use of Time Contours.  Apart from simple things like using the wrong file, there are some less obvious traps for the unwary: The most likely other problem will be disk space. By default, GrainMill uses the Windows TEMP directory for temporary files. It follows that there must be enough disk space on the drive for  the largest sound you want to create, as well as for Window's own needs (which can be considerable). You will know this is a problem if you receive an error message referring to the 'temporary file'. The solution is to use the SETTINGS dialog to select a directory on a different logical Drive (e.g. D:), which has enough space. You can also change to the 'Write Direct to Outfile' system, which does not use a temporary file.

    If you do discover a problem that does appear to be a bug, well, of course, we want to know about it! We will need to have quite a lot of information form you about your system (processor, speed, memory, OS, etc.), and also (depending on the nature of the bug) information about your source sound (such as duration, sample rate, peak amplitude) and parameters. Ideally, we would need your .grn file and any Time Contour files you are using, so that we have the best chance of reproducing the problem.
     
     
     



    BrkEdit Reference Manual

    by Archer Endrich

    Startup, Save & Compare Using  the Editor Zoom/Scroll Play (Audition)
    The Edit Menu The Settings Menu The Help Menu

    Introduction

    The BrkEdit program was written by Richard Dobson, building on an initial program coded by Martin Atkins. In addition to being integrated into GrainMill, it is available as a separate program for general use with the CDP System, which provides a large number of time-varying parameters with which to shape sound. In particular, note the VERTICAL RANGE facility in the EDIT menu. This enables you to adapt the numerical range to that of the parameter for which you are creating the file. Also note the Get length from soundfile option in LENGTH of the EDIT menu, with which you can have the program automatically scale your breakpoint file to the length of a specific soundfile.

    The FILE Menu – Startup, Save & Compare

    In GrainMill you activate the breakpoint section by ticking the box to the left of the Time Contour filename box. You can leave the filename box blank or enter a name, using .brk as the extension. Now click on the 'E' (for 'Edit') and the BrkEdit display screen comes up, with a default breakpoint file in place as a starting point if it can't find the file you have specified. If you entered a filename, it is recognized and you can simply Save the file you make. Otherwise, use Save As, entering the name you want to use. Assuming you have saved your .brk file in your current GrainMill Working Directory, the file will appear in the Time Contour drop-down list boxes. If for some reason you have put it somewhere else, you will need to use the Br... (BROWSE) button to find it.

    As shown by the File dropdown menu, you can proceed in three ways:

    1. NEW – create a new breakpoint file, or
    2. OPEN – open an existing breakpoint (text) file, or
    3. EXTRACT FROM SFILE – extract an amplitude envelope from an existing soundfile. Note the Hide Span Handles option above the main display. Ticking this option will remove the black squares ('handles') marking the breakpoints. An extracted soundfile may have 10's or 100's of these all bunched together, so it is sometimes useful to see the breakpoint shape without them. Ticking on 'Hide Span Handles' again will remove the tick and restore the black squares: the button is a toggle.
    There are three different ways in which your breakpoint file can be saved:
    1. SAVE – saves as a text file of separate lines containing the data pair time value. Any non-linear segments (logarithmic or exponential) will automatically be converted to linear segments which approximate the curve.
    2. SAVE EXTENDED – save in extended format, which defines non-linear segments using additional text fields.  For example, you will see a line such as the following:
    3. 0.476079 0.411255 exp 5.500000
      These show, from left to right: time, value, line type, and line setting. The default linear line type requires just the time and the value.
      The extended format is new, and not yet fully supported by other CDP programs, though it is of course recognized by GrainMill.

      In both save options, you are prompted to enter a filename. The default extension is '.brk'. This is not mandatory, but has the advantage that all .brk files are automatically displayed when OPEN is selected, and will be found by GrainMill..

      You can save to the same name if you wish. You are notified that the file already exists and asked if you wish to overwrite it.
       

    4. SAVE AS AUDIO – saves the breakpoint shape as an audio soundfile. This will save in the mode (Amplitude or Frequency) in which you are currently auditioning the shape. You can set the Sample Rate and the Sample Type in the SETTINGS menu under OPTIONS. Sample rates available are 96000, 88200, 48000, 44100, 32000, 22050, 18000 and 11025. Sample type can be 16-bit short or 32-bit float.
    It is also possible to compare the breakpoint shape you are making with one which has been made and stored previously.
    1. COMPARE WITH ...
    2. CLOSE COMPARE – enables you to remove the (red) comparison file from the display.
    Return to Brkedit contents
    Return to GrainMill contents
    Return to Quick Reference

    Using the Breakpoint Editor

    The operation of the breakpoint editor can be illustrated by selecting NEW as a starting point. A default breakpoint file (supplied by GrainMill appropriately for the parameter and for the duration of the infile) is displayed. Now there are several actions you can take:
    1. Select and move a point – place the tip of the cursor arrow on a point 'handle' (the small black square), click and hold down the left button. You can now drag that point left or right, up or down. As you do so you will see the displayed time and value of this point change.
    2. Insert a new point – double-click on a line at about the right time location along the line. This will insert a point at that location. You can now move it as in Action 1.
    3. Delete a point – a single click will select a point for deletion. It will turn red in colour. To delete it, then click on the Delete Point button. If you change you mind while the point is red (selected for deletion), but before you actually delete it, just click somewhere else within the breakpoint file display screen and the point will turn black again, thus cancelling the Delete Point action.
    4. Select a line span – a single click on or close to a line with the left button will select it. A selected span will turn green, and will be drawn as a dotted line. You can cancel this action by clicking somewhere else within the breakpoint file display.
    5. Alter the type of line span – first select a line span as in Action 4. Now go to span settings and click on the radio button for the type of line you want. You will see the line change shape when you select a different type. The slider to the right of the line types can be used to increase the intensity of the shape: you will see the shape change as you move it. Note that the curve of the logarithmic line starts with a fast rate of change and then slows down, while the exponential line starts with a slow rate of change and then speeds up. You can also move the end points of the line while it is still green and see how this affects its shape. These curves enable you to make your breakpoint shapes more fluid, and musically more 'natural' - especially for Amplitude (Loudness) and Pitch Contours.
    Return to Brkedit contents
    Return to GrainMill contents
    Return to Quick Reference

    Zoom/Scroll

    You can zoom in to different parts of the data. This may appear to be like scrolling through the file, but is actually zooming in on it. There are two trackbars beneath the breakpoint display, one on the left and one on the right. If the file contains on a small number of points, the motion of the slider will appear jumpy - it is trying to show the position in time relative to the whole file, but can only step according to the location of the points in the file.
    The zoom function makes it easier to insert points and see the effect of logarithmic or exponential line types.

    PLAY/STOP (Audition)

    You will see two buttons above the breakpoint shape display window: 'PLAY' and 'Amplitude'. The Amplitude button toggles (alternates) with 'Frequency'. With PLAY you can audition the breakpoint shape, either in an Amplitude mode or in a Frequency mode. With the STOP button, you can terminate playback.
    In the Amplitude mode you hear a single pitch, the volume of which changes according to the breakpoint shape on the screen, over the length of time set for the breakpoint file. This is especially useful when, for example, you have extracted the amplitude envelope from a soundfile and want to hear it in the abstract, imagining what it might be like imposed on another soundfile. It is a very clean and simple way to hear what the shape is really like. The vertical range (whatever it may be) of the breakpoint window is converted internally to the range  0 to 1 to control the amplitude of the internal oscillator. The frequency of the single tone can be set from the SETTINGS dialog. You will hear, for example, that logarithmic and exponential spans tend to have a more 'natural' sound than linear ones.

    In the Frequency mode you hear a pitch glissando moving through the breakpoint shape on the screen, over the time of the file. In SETTINGS, you can set High and Low limits in Hz for the frequency range to be heard.

    Several benefits arise from the ability to hear the breakpoint shape: Return to Brkedit contents
    Return to GrainMill contents
    Return to Quick Reference

    The Edit Menu

    The EDIT Menu provides several additional facilities:
    1. LENGTH – there are three ways to alter the length of the breakpoint file. For the first two of these, you first enter the length you would like it to be. Then you select either:
      1. Truncate/Extend the file ­ if the length you have specified is shorter than the existing breakpoint file, the file will be truncated by removing one or more segments from the end of the file; if the length you have specified is longer than the existing breakpoint file, a new segment will be added to the end of the file to bring it up to the required length. Or,
      2. Shrink/Stretch the file ­ in this case, all the segments of the breakpoint file are made proportionately smaller or larger so that the whole file fits – is scaled to – the new length specified.
      3. Get length from soundfile ­ alternatively, your existing breakpoint file can be rescaled to match a specific soundfile. In this case you may need to browse your directories for the right soundfile. Click on the 'BR' button to begin browsing. When you have selected the soundfile and have clicked on OK, the breakpoint file will be rescaled to fit the soundfile you've selected.
    2. ALL SPANS TO LINES – this function converts the logarithmic or exponential curves into a series of linear segments.
    3. VERTICAL RANGE – the default vertical range for the breakpoint file is from 0.0 to 1.0. The Maximum value can be raised, and the Minimum value can be lowered (into the minus range). This is useful to get the values produced by the editor to match the range of values required by a specific parameter. For example, some of these are from the -1.0 to 1.0 range, so you would adjust the vertical range. You will notice that if you do this for an existing breakpoint file made with the vertical range set at 0.0 to 1.0, it will at first only occupy the upper half of the display: because the lowest value so far was 0.0. However, you can now drag points down into the negative part of the range.
    4. REDUCE – this reduces the number of points used to express the shape of the breakpoint file. This facility has been provided because sometimes, when the breakpoint file has been extracted from a soundfile (i.e., is the shape of its amplitude envelope), the screen ends up jam-packed with points. Reduce removes points to the degree specified by the threshold, preserving as intelligently as possible the original shape. This makes the file easier to handle and adapt. The value you set for threshold defines the range within which points are reduced. It should normally be a small fraction of the overall vertical range. Anything in the Amplitude range (0 to 1) is treated specially, to preserve low-level detail.
    5. TRANSFORM VALUES – calls a dialog box with a list box with four methods:
    6. UNDO – the program records your operations on the file so that it is possible to backtrack through a series of UNDOs. Note that this does not apply to adding and deleting points, which you can easily do on the screen. Rather, it applies to major global changes to the files, such as New and the EDIT menu: Length, Span to lines, Reduce, Reciprocate and Scale – not Vertical scale, which only affects the display.
    7. REDO – this steps back through your UNDOs, restoring the previous state of the file.
    Return to Brkedit contents
    Return to GrainMill contents
    Return to Quick Reference

    The Settings Menu

    SETTINGS – this calls up a dialogue box in which you can adjust the audio settings, as described above under PLAY (Audition): Sample Rate, Sample Type, Frequency Range of a pitch glissando through the breakpoint file, or frequency of the single tone on which the amplitude shape is imposed. The 'A/D ramp msecs' option in Frequency mode defaults to 50. This tailors the beginning and end of the sound with a somewhat exponential shape, thus smoothing out clicks which may otherwise occur. It can be set between 0 and 925 ms.

    Return to Brkedit contents
    Return to GrainMill contents
    Return to Quick Reference

    The Help Menu

    Under ABOUT, this will display the version number for the BrkEdit you are using.

    Return to Brkedit contents
    Return to GrainMill contents
    Return to Quick Reference


    Glossary

    The infile

    The infile is the currently selected soundfile to be processed. It must be a mono soundfile (one channel), 16-bit (in the current version), and either WAV or AIF format. As with any sound processing, the qualities of the infile greatly influence the  result.

    Back to list of glossary definitions
    Return to top


    The outfile

    The outfile is produced by GrainMill. It will be mono or stereo depending on the options selected. The program automatically provides a name for the outfile by adding 'OUT' to the name of the infile.  For example, if your infile was called 'piano.wav', the default outfile name would be 'pianoOUT.wav'. You could name a second version, 'pianoOUT1.wav', etc.

    Back to list of glossary definitions
    Return to top


    What is a 'grain' of sound?

    A 'grain' is a tiny bit of something - in this case sound rather than e.g., sand or corn. A sound made up of lots of small 'grains' usually has a somewhat uneven texture. It can sound just a bit rough-textured or bumpy, or may sound fiercely repetitive. Similarly to the paintings of Seurat, who used tiny dots of paint rather than the usual brush stroke, the sound is made up of lots and lots of tiny pieces. A sound made up of grains is described as 'granular', and creating sounds like this is called 'granular synthesis'.'

    Back to list of glossary definitions
    Return to top


    Decibels: a measure of loudness

    The scale of loudness calculated in decibels (abbreviated as dB) is a logarithmic scale. The logarithmic scale is used for decibels because this is how the ear works. What this means is simply that equal divisions of the scale will sound to us as equally louder or softer, whereas mathematically the values are actually doubling. Logarithms are a way of linking linear and geometric values (such as 1, 2, 3,4 and 2,4, 8, 16): a single (i.e., equally spaced) step in the linear scale involves a doubling of the previous value in the geometric scale. If the loudness scale were to be represented on the screen as a linear scale (and the same is true of pitch), most of the changes that we can perceive with our ears would be bunched together at one end of the scale. Textbooks on acoustics provide a full mathematical explanation of these matters, and often include a chart illustrating where familiar sounds normally come on the scale of decibels.

    Back to list of glossary definitions
    Return to top


    Milliseconds: a measure of time

    A millisecond (abbreviated as ms) is one thousandth part of a second. The thousandth decimal place is the third to the right of the decimal point (tens-hundreds-thousands). So 1 millisecond can also be written as 0.001 sec, 50 ms can be written as 0.050 sec, and 100 ms is the same as 0.1 sec. To convert from milliseconds to seconds, move the decimal point three places to the left (adding zeroes if necessary), and to convert from seconds to milliseconds, move the decimal point three places to the right.

    Back to list of glossary definitions
    Return to top


    Timbre: a description of tone quality

    Timbre means the 'colour' of a sound, which in turn is described technically by its 'spectrum' -  how many and which frequencies are present as the sound flows through time. This frequency content is constantly changing, in some sounds more than in others. For example, a flute has a clear luminous tone, while an oboe has a considerably more complex sound, and a locomotive engine has a very rich sound indeed! 'Colour' is but one of the many words borrowed from the visual arts to describe sonic differences; they all come down to the ever-changing frequency content of a sound.

    Back to list of glossary definitions
    Return to top


    Splices: Butt and sloping joins

    In the 'classical tape studio', analog tape was spliced by cutting off selected pieces with a razor blade and then joining up the pieces with a special white splicing tape. These cuts were usually made with the help of a splicing block, and there was a groove at 45% for a 'smooth' join (the two pieces of tape would overlap) and a vertical groove for what was called a butt edit (no overlap at all). Similarly, in GrainMill, the grains are 'abutted' when there is no overlap. However, note that there is in this case still the tapering of the sound from and to zero volume, with which each grain is shaped in order to avoid clicks.

    Back to list of glossary definitions
    Return to top


    Panning a sound

    The terminology 'to pan a sound', 'panning a sound', or just 'panning', refers to the psycho-acoustic effect whereby sound appears to move through space. To illustrate: a (stereo) sound can 'move' from left to right. In this case, the stereo image is actually coming out of both speakers, but the right hand speaker starts with zero volume and the left hand speaker with full volume. Then the right hand speaker gets progressively louder as the left hand speaker gets progressively quieter. To the ear of the listener (positioned centrally in front of both speakers), the sound appears to move from left to right.

    Back to list of glossary definitions
    Return to top


    Mono Soundfile

    'Mono' is short for 'monophonic' -  literally, 'one sound'. A mono soundfile has only 1 'channel'. If there are two loudspeakers, the (same) sound signal is output by both of them.

    Back to list of glossary definitions
    Return to top


    Defaults

    Programs frequently use 'defaults'. A default is a pre-set 'typical' or 'recommended' value, or simply a parameter setting to get started with. The defaults in GrainMill allow you to start the program, load a soundfile, click on MAKE IT and get something interesting!

    Back to list of glossary definitions
    Return to top


    Attack - Sustain - Decay

    These terms refer to the loudness shape (amplitude 'envelope') of the sound. They describe some of the most noticeable and important features of a sound. The attack describes how the sound begins, in particular how quickly the loudness increases; the Sustain portion refers to the loudness characteristics of the main part of the sound the Decay portion is how it ends, for example whether it stops abruptly or gradually trails off into silence. Each grain created by GrainMill has a simple, symmetrical, ASD shape. Note that the more familiar acronym ADSR, standing for Attack-Decay-Sustain-Release, while acknowledging that the attack of many sounds reaches a peak point from which it falls back  (decays) to the Sustain level (e.g. many brass sounds), is  named specifically for keyboards - the Release refers literally to the release of a key, triggering the final Decay of the sound.

    Experimenting with BrkEdit is one of the best ways of exploring amplitude envelopes.

    Back to list of glossary definitions
    Return to top



    Last updated: 26 April 1999

    Editor: Archer Endrich
    Authors: Trevor Wishart, Richard Dobson & Archer Endrich
    Any comments or observations will be appreciated
    © Copyright 1998-1999 CDP
    CDP
    c/o 12 Goodwood Way
    Chippenham, Wiltshire
    SN14 0SY
    Tel. 01249 461361, 0117 903 1147, 01373 452928
    Email 1: archer@trans4um.demon.co.uk
    Email 2: archer@pact.srf.ac.uk
    Email 3: rwd@cableinet.co.uk
    WWW: http://www.bath.ac.uk/~masjpf/CDP/CDP.html