Вы находитесь на странице: 1из 5

//Name: Shane Barriscale

//Class: IMedia 2011


//JMUSIC Project 1- Creating and Modifying a MIDI Track
//Student: Number 0540641
//NOTE: I deliberataly chose MODs that didn't affect the pitch of the song

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

public class JM1 implements JMC


{

public static void main (String [] args)//Main Method


{

//////////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

double[] MMRhythmArray = {DQ,DQ,DQ,DQ,DQ,DQ,DQ,DQ,DQ,DQ,DQ,DQ,DQ,DQ,DQ,DQ,C,Q,C,Q,C,Q,DQ,DQ,C,Q,C,Q,C,


Q,C,SQ,SQ,C,Q,C,Q,C,Q,C,SQ,SQ,C,SQ,SQ,C,Q,C,Q,C,Q,C,SQ,SQ,DQ,DQ,DQ,DQ,DQ,DQ,DQ,DQ,DQ,DQ,DQ,DQ,DQ,DQ,DQ,DQ};
//PHRASE2 AND PHRASE3
int[] RHIntroArray = {E5,E4,A4,E5,E4,A4,E5,E4,A4,D5,E4,A4,C5,E4,A4,C5,E4,A4,E5,E4,A4,C5,E4,A4,E5,E4,A4,
E5,E4,A4,E5,E4,A4,D5,E4,A4,C5,E4,A4,C5,E4,A4,A4,D4,FS4,A4,D4,FS4};
int[] LHIntroArray = {C4,A3,E3,A3,C4,A3,B3,G3,D3,G3,B3,G3,A3,E3,C3,E3,A3,E3,A3,E3,C3,E3,A3,E3,C4,A3,E3,
A3,C4,A3,B3,G3,D3,G3,B3,G3,A3,E3,C3,E3,A3,E3,A3,D3,FS3,A3,D3,FS3};
//PHRASE4 AND PHRASE5
int[] RH1Array = {A4,B3,C4,E4,A4,B3,A4,B3,C4,E4,B4,B3,A4,B3,C4,E4,G4,B3,E4,B3,C4,E4,B3,C4};
int[] LH1Array = {A2,E3,A3,E3,A3,E3,A2,E3,A3,E3,A3,E3,A2,E3,A3,E3,A3,E3,A2,E3,A3,E3,A3,E3};

//PHRASE6 AND PHRASE7


int[] RH2Array = {C5,E4,F4,A4,C5,E4,C5,E4,F4,A4,E5,E4,D5,E4,F4,A4,C5,E4,B4,E4,F4,A4,C5,B4};
int[] LH2Array = {F2,C3,F3,C3,F3,C3,F2,C3,F3,C3,F3,C3,F2,C3,F3,C3,F3,C3,F2,C3,F3,C3,F3,C3,};
//PHRASE8 AND PHRASE9
int[] RH3Array = {A4,B3,C4,E4,A4,E4,E5,E4,G4,A4,B4,G4,A4,B3,C4,E4,G4,B3,E4,A3,C4,A3,D4,C4,C4,A3,C4,A3,D4,C4};
int[] LH3Array = {A2,E3,A3,E3,A3,E3,A2,E3,A3,E3,A3,E3,A2,E3,A3,E3,A3,E3,A2,C3,E3,C3,A2,E3,A2,C3,E3,C3,A2,E3};
//PHRASE10 AND PHRASE11
int[] RH4Array = {D4,A3,B3,A3,D4,A3,E4,B3,C4,D4,GS4,B3,A4,B3,C4,E4,A4,E4,A4,B3,C4,E4,A4,C4};
int[] LH4Array = {E2,B2,E3,D3,B2,E2,E2,B2,E3,D3,B2,E2,A2,E3,A3,E3,A3,E3,A2,E3,A3,E3,A3,E3};
//PHRASE12 AND PHRASE13
int[] RH5Array = {E5,E4,A4,E5,E4,A4,E5,E4,A4,D5,E4,A4,C5,E4,A4,C5,E4,A4,E5,E4,A4,D5,E4,A4};
int[] LH5Array = {C4,A3,E3,A3,C4,A3,B3,G3,D3,G3,B3,G3,A3,E3,C3,E3,A3,E3,A3,E3,C3,E3,A3,E3};
//PHRASE14 AND PHRASE15
int[] RH6Array = {E5,E4,A4,E5,E4,A4,E5,E4,A4,D5,E4,A4,C5,E4,A4,C5,E4,A4,A4,D4,FS4,A4,D4,FS4};
int[] LH6Array = {C4,A3,E3,A3,C4,A3,B3,G3,D3,G3,B3,G3,A3,E3,C3,E3,A3,E3,A3,D3,FS3,A3,D3,FS3};

//////////ADD NOTES TO PHRASES


phrase1.addNoteList(MainMelodyArray, MMRhythmArray);//Adds specified arrays to specified phrase
phrase2.addNoteList(RHIntroArray, SQ);//Adds specified pitches to a phrase. Applies uniform rhythm
phrase3.addNoteList(LHIntroArray, SQ);////////////////////////////////////////////////////////////
phrase4.addNoteList(RH1Array, SQ);/////////////////////////////////////////////////////
phrase5.addNoteList(LH1Array, SQ);//////////////////////////////////////////
phrase6.addNoteList(RH2Array, SQ);/////////////////////////////////
phrase7.addNoteList(LH2Array, SQ);//////////////////////////
phrase8.addNoteList(RH3Array, SQ);/////////////////////
phrase9.addNoteList(LH3Array, SQ);/////////////////
phrase10.addNoteList(RH4Array, SQ);/////////////
phrase11.addNoteList(LH4Array, SQ);//////////
phrase12.addNoteList(RH5Array, SQ);///////
phrase13.addNoteList(LH5Array, SQ);/////
phrase14.addNoteList(RH6Array, SQ);///
phrase15.addNoteList(LH6Array, SQ);//

//////////////////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);//
//////////////////////////

//ADD PHRASES TO PARTS


part1.addPhrase(phrase1);//Adds specified phrases to specified parts
part1.addPhrase(phrase2);///////////////////////////////////////////
part1.addPhrase(phrase3);/////////////////////////////
part2.addPhrase(phrase1);////////////////
part2.addPhrase(phrase2);////////
part2.addPhrase(phrase3);//

//////////////////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
///////////////////////////

//ADD PARTS TO SCORE


aScore.addPart(part1);//Adds specified parts to the main Score
aScore.setTempo(100.0);//Sets the tempo/speed of the main Score

//////////////////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
////////////////////////////

//Write.midi(aScore, "ThePianoJMPhrase1.mid");//Write score to the .mid track specified


Play.midi(aScore);//Play through terminal the entire score
}
}

Вам также может понравиться