Академический Документы
Профессиональный Документы
Культура Документы
import
import
import
import
jm.JMC;
jm.music.data.*;//Import MIDI tools for JMusic(Pitches/Rhythms etc.)
jm.music.tools.*;//Import Mod Tools Library
jm.util.*;//Import Play/Read/Write/View etc. functions
//////////EMPTY SCORE
Score
aScore
= new Score("The Piano");//Creates a new Score with title
aScore.setTimeSignature(12, 8);//Sets the time signature for the score
//////////EMPTY PARTS
Part part1
= new Part("Piano1", PIANO, 0);//Creates new Parts with specified instrument and channel
Part part2
= new Part("Piano2", PIANO, 0);
//Part part1 = new Part("Xylophone1", XYLOPHONE, 0);//Optional instrument to replace the one above
//Part part2 = new Part("Xylophone2", XYLOPHONE, 0);
//////////EMPTY PHRASES
Phrase
phrase1 = new Phrase(0.0);//Creates new Phrases with specified starting point(0.0)
Phrase
phrase2 = new Phrase(0.0);///////////////////////////////////////////////////////
Phrase phrase3 = new Phrase(0.0);////////////////////////////////////////////////
Phrase phrase4 = new Phrase(0.0);///////////////////////////////////////
Phrase
phrase5 = new Phrase(0.0);////////////////////////////////
Phrase
phrase6 = new Phrase(0.0);///////////////////////////
Phrase phrase7 = new Phrase(0.0);//////////////////////
Phrase phrase8 = new Phrase(0.0);/////////////////
Phrase phrase9 = new Phrase(0.0);/////////////
Phrase phrase10 = new Phrase(0.0);//////////
Phrase phrase11 = new Phrase(0.0);////////
Phrase phrase12 = new Phrase(0.0);//////
Phrase phrase13 = new Phrase(0.0);////
Phrase phrase14 = new Phrase(0.0);///
Phrase phrase15 = new Phrase(0.0);//
//////////MAIN MELODY-PHRASE1
int[] MainMelodyArray ={E5,E5,E5,D5,C5,C5,E5,C5,E5,E5,E5,D5,C5,C5,A5,A5,A4,A4,A4,B4,A4,G4,E4,E4,C5,
C5,C5,E5,D5,C5,B4,C5,B4,A4,A4,E5,B4,A4,G4,E4,D4,C4,C4,D4,C4,D4,D4,E4,GS4,A4,A4,A4,A4,C5,E5,E5,E5,D5,
C5,C5,E5,D5,E5,E5,E5,D5,C5,C5,A5,A5};
//above= Array of integer type occupied by pitch values. Pitches are int because they are whole numbers
//below= Array of double type occupied by rhythm values. Rhytms are doubles to accomodate decimal values
//////////////////MOD1////
Mod.spread(phrase2);//randomly adjust pan
Mod.spread(phrase3);
//////////////////MOD2////
Mod.shake(phrase8, 40);//randomly adjust volume in a specified range
Mod.shake(phrase9, 60);
//////////////////MOD3////////
Mod.diminuendo(phrase12, 0.0, 3.12, 120, 50);//loud to quiet from specified time with
Mod.diminuendo(phrase13, 0.0, 3.12, 120, 50);///// specified values
//////////////////MOD4///////
Mod.crescendo(phrase14, 2.0, 4.12, 70, 120);//quiet to loud from specified time with
Mod.crescendo(phrase15, 2.0, 4.12, 70, 120);//// specified values
//////////////////MOD5/////
Mod.bounce(phrase14);//oscillate pan left to right every second note
Mod.bounce(phrase15);
//////////////////MOD6////
Mod.slurUp(phrase1);//rising notes are connected by extending
//////////////////MOD7//////
///// to the maximum value of the note
Mod.slurDown(phrase1);//descending notes are connected by extending
//////////////////MOD8/////
///// to the maximum value of the note
Mod.append(phrase2, phrase4);//add the second phrase to the end of the first
Mod.append(phrase2, phrase6);//////////////////////////////////////////////
Mod.append(phrase2, phrase8);///////////////////////////////////
Mod.append(phrase2, phrase10);//////////////////////////
Mod.append(phrase2, phrase12);///////////////////
Mod.append(phrase2, phrase14);///////////////
Mod.append(phrase3, phrase5);////////////
Mod.append(phrase3, phrase7);/////////
Mod.append(phrase3, phrase9);///////
Mod.append(phrase3, phrase11);/////
Mod.append(phrase3, phrase13);////
Mod.append(phrase3, phrase15);//
//////////////////////////
//////////////////MOD9/////
Mod.accents(part2, 2.0);//accent notes using a specified meter
Mod.append(part1, part2);//add the second part to the end of the first
///////////////////////////
//////////////////MOD10////////
Mod.tiePitches(aScore);//connects sequential notes of same pitch
//////////////////MOD11///////
Mod.normalise(aScore);//increases volume so loudest volume is the max
//////////////////MOD12//////
Mod.quantise(aScore, SQ);//allign rhythms to the nearest beat increment
//////////////////MOD13////
Mod.repeat(aScore);//repeat the specified subject
//////////////////MOD14////
Mod.fadeIn(aScore, 1.2);//fade in by specified value
//////////////////MOD15/////
Mod.fadeOut(aScore, 0.6);//fade out by specified value
////////////////////////////