audio MIDI Music Algorithms Interfaces Programming Acoustics Context
> Audio > Synthesis > Noise bursts for notes    
 
   

Noise bursts for notes       

This class shows how a simple score can be rendered as an audio file. It produces a single note sine wave.

To hear the result download the MP3 file below.

WaveformExample5.mp3 [148K]

View / Download source

Lets have a closer look. 
import jm.music.data.*;
import jm.JMC;
import jm.audio.*;
import jm.util.*;
// this class introduces chiff noise
 
public class WaveformExample5 implements JMC {
	
	public static void main(String[] args) {
		new WaveformExample5();
	}
	
	public WaveformExample5() {
 
		// make a jmusic score
		Phrase melody = new Phrase();
		for(int i = 0; i < 24; i++) {
			Note n = new Note(
				(int)(Math.random() * 12) * 2 + 60, 
				(int)(Math.random()* 5) * 0.25 + 0.25);
			melody.addNote(n);
		}
		Score score = new Score(new Part(melody));
		
		// set up audio instrument
		Instrument wave = new ChiffInst(44100);
 	// for jMusic 1.1 or earlier put the instrument in an array
		// Instrument[] ensemble = {wave};
		
		// render audio file of the score
		Write.au(score, "WaveformExample5.au", wave);
		// for jMusic 1.1 or earlier substitute the line above with
		// Write.au(score, "WaveformExample.au", ensemble);
	}
}
 
A noise-based inmstrument is used in this example, the ChiffInst class. Its timbre is white noise from random sample values
but its amplitude envelope is diferent from the NoiseInst class which highlights the fact that jMusic instruments can have man
y properties with timbre and envelope being a couple of very obvious ones.
jMusic instruments can also vary in thier response to dynamics, pan position and other charracteristics.

The ChiffInst envelope has a quick attack and decay providing a burst of sound, followed by a low level of noise continuing through
the rest of the note's duration. This effect is similar to the noise characteristic of many blown instruments such as pipes and flutes.

 

jMusic Australia Council Queensland University of Technology Sitemap Contact Home Home http://www.qut.com http://explodingart.com/jmusic http://www.ozco.gov.au

Digital Instrument making Home