import rwmidi.*; import controlP5.*; MidiOutput output; ControlP5 controlP5; ScrollList l; // Variables: int port = -1; // puerto midi no seteado int chan = 9; // canal midi 10 public int medidda = 16; // medida 4-24 (0=random) public int feeel = 2; // feel 2-3 public int repeticciones = 4; // repeticiones 1-8 public int temmpo = 220; int i; int f; int h; String estruct = ""; int num_grupet = 0; int grupetto []; int unidad; // estructuras B-T String est_2 = "BT"; String est_3 [] = {"BBT", "BTT", "BOT", "BTO"}; String est_4 [] = {"BOBT", "BOTO", "BTOT"}; // rellenos B-T String relleno [][] = {{"O", "B", "T", "b", "t", "!", "!", "!", "!", "!", "!"}, {"OO", "BO", "OB", "OT","Ob", "Ot", "BB", "!", "!", "!", "!"}, {"OOO", "BOO", "OBO", "OOB", "OOT","OOb", "OOt", "OBB", "TBO", "TOB", "BBO"}}; byte afir [][] = {{0, 1, 0}, {0, 1, 2}, {0, 1, 2}}; byte antiT [][] = {{0, 1, 3, 0, 0, 0, 0, 0}, {0, 2, 1, 6, 4, 0, 0, 0}, {0, 3, 2, 7, 5, 8, 9, 10}}; byte antiT2 [][] = {{0, 1, 3, 0, 0, 0}, {0, 2, 1, 6, 4, 0}, {0, 3, 2, 7, 5, 10}}; byte antiB [][] = {{0, 1, 2, 4, 0}, {0, 2, 1, 3, 5}, {0, 3, 2, 4, 6}}; byte antiB2 [][] = {{0, 2, 4}, {0, 3, 5}, {0, 4, 6}}; byte ambosB [][] = {{0, 1, 0, 0, 0, 0}, {0, 1, 2, 0, 0, 0}, {0, 1, 3, 2, 4, 6}}; byte ambosT [][] = {{0, 1, 0, 0, 0, 0, 0, 0, 0}, {0, 2, 1, 6, 4, 0, 0, 0, 0}, {0, 1, 3, 2, 7, 5, 8, 9, 10}}; // patterns de "brillos" byte brillo [] = {2,0,0,0,2,0,0,2,0,0,1,0,2,0,0,1,2,0,0,1,2,1,1,0,0,1,0,2,0,1,2,0,2,0,2,0,2,0}; void setup() { size(400,350); MidiOutputDevice devices[] = RWMidi.getOutputDevices(); controlP5 = new ControlP5(this); controlP5.addNumberbox("medida",medidda,100,160,100,14).setId(1); controlP5.addNumberbox("feel",feeel,100,200,100,14).setId(2); controlP5.addNumberbox("repeticiones",repeticciones,100,240,100,14).setId(3); controlP5.addSlider("Tempo",50,250,100,100,290,100,14); l = controlP5.addScrollList("myList",50,50,310,100); l.setLabel("Seleccione el puerto MIDI (pero primero setee las otras cosas)"); for(int i=0; i igual probabilidad; // casos = x, [de 0 a x-1] int numero = int (pow (random (casos), curvature) / pow (casos, curvature - 1)); return numero; }