andrew@50: import oscP5.*; andrew@50: import netP5.*; andrew@50: import maxlink.*; andrew@50: andrew@50: OscP5 oscP5return; andrew@50: NetAddress ableton = new NetAddress("localhost", 12345); // OSC to ableton andrew@50: MaxLink link = new MaxLink(this, "midiCom"); andrew@50: import processing.opengl.*; andrew@50: int imageWidth = 1000; andrew@50: int imageHeight = 300; andrew@50: int fanWidth = 400; andrew@50: andrew@50: float rpulse; andrew@50: boolean rpulseup; andrew@50: boolean clickTrack; andrew@50: int currentPulse = 0; andrew@50: int grid = 32; andrew@50: int fractions = 4; andrew@50: int pulseFrequency = grid / fractions; andrew@50: int beatsPerBar = 4; andrew@50: int bar = 0, beat = 0, fraction = 0, pulse = 0; andrew@50: int pulsesPerBar = beatsPerBar * grid; andrew@50: andrew@50: color lineColour = color(150,150,150); andrew@50: color barLineColour = color(255,255,95); andrew@50: color backGround = color(50,81,191); andrew@50: int redC = 50; andrew@50: int greenC = 81; andrew@50: int blueC = 191; andrew@50: PImage screenImage; andrew@50: PGraphics img, imgNotes, imgNoteFan; andrew@50: PImage test; andrew@50: andrew@50: int barOfPixels = grid * beatsPerBar; andrew@50: int playArea = 200; andrew@50: int x= 0; andrew@50: int x2= 0; andrew@50: PFont arial; andrew@50: int arraySize = 800-playArea; andrew@50: int bpm = 130; andrew@50: int tempo = bpm/60*grid; andrew@50: int noOfBars = 2; andrew@50: int loopLength = grid*beatsPerBar*noOfBars; andrew@50: Track[] tracks = new Track[16]; andrew@50: Track chordsTemp; andrew@50: int trSelected; andrew@50: boolean[] noteOnArray = new boolean[16]; andrew@50: boolean[] displayNoteOnArray = new boolean[16]; andrew@50: int[] noteOnArrayLength = new int[16]; andrew@50: boolean chordSelecter, clickTrackOn; andrew@50: int lastTrack; andrew@50: int trackStorer, screenAni; andrew@50: boolean quantizeValueIn, loopLengthValueIn, haveQuestion, aniOut, muteValueIn; andrew@50: String screenQuestion; andrew@50: boolean eraseOn; andrew@50: andrew@50: int crneeded = 24; andrew@50: int noOfChords; andrew@50: boolean tonicNeeded; andrew@50: boolean chordAI = true; andrew@50: int lastChordChange; andrew@50: boolean lastMinor; andrew@50: int barCounter; andrew@50: