controlP5TextField+Keypressed event

Hey, so I’ve been having some problems with this: I want to have a box where I can write and the text appears while I write, so I used the TextField. The thing is, at the same time, when I press a key it’s supposed to make a sound, I got this part right, but when I put these two together it doesnt work-makes no sound. Can it be solved, or is there another way to do this?

the code so far:

import ddf.minim.;
import controlP5.
;
Minim minim;

AudioSample A;
AudioSample B;
AudioSample C;
AudioSample D;
AudioSample E;
AudioSample F;
AudioSample G;
AudioSample H;
AudioSample I;
AudioSample J;
AudioSample K;
AudioSample L;
AudioSample M;
AudioSample N;
AudioSample O;
AudioSample P;
AudioSample Q;
AudioSample R;
AudioSample S;
AudioSample T;
AudioSample U;
AudioSample V;
AudioSample W;
AudioSample X;
AudioSample Y;
AudioSample Z;

PFont myFont;
//font= createFont(‘apercu.ttf’);
//textFont (font);
//ControlP5 cp5;
//String text;

void setup() {
size(1920, 1080);
background(0);

myFont = createFont(“apercu”, 32);
textFont(myFont);

minim= new Minim(this);
A=minim.loadSample(“Blop.mp3”, 512);
B=minim.loadSample(“chinesegong.mp3”, 512);
C=minim.loadSample(“BatCall.mp3”, 512);
D=minim.loadSample(“glassping.mp3”, 512);
E=minim.loadSample(“ATone.mp3”, 512);
F=minim.loadSample(“BeepPing.mp3”, 512);
G=minim.loadSample(“CameraFlash.mp3”, 512);
H=minim.loadSample(“ClinkingTeaspoon.mp3”, 512);
I=minim.loadSample(“RattleSnake.mp3”, 512);
J=minim.loadSample(“PopCork.mp3”, 512);
K=minim.loadSample(“foghorn.mp3”, 512);
L=minim.loadSample(“FuzzyBeep.mp3”, 512);
M=minim.loadSample(“GunSilencer.mp3”, 512);
N=minim.loadSample(“HolePunch.mp3”, 512);
O=minim.loadSample(“IntruderAler.mp3”, 512);
P=minim.loadSample(“KeysInIgnition.mp3”, 512);//som muito longo
Q=minim.loadSample(“LargeMetalClippers.mp3”, 512);
R=minim.loadSample(“LaserBlasts.mp3”, 512);
S=minim.loadSample(“LightsaberTurnOff.mp3”, 512);
T=minim.loadSample(“marbles.mp3”, 512);
U=minim.loadSample(“MartianScanner.mp3”, 512);//som muito longo
V=minim.loadSample(“MetalGong.mp3”, 512);
W=minim.loadSample(“plop.mp3”, 512);
X=minim.loadSample(“WaterDrop.mp3”, 512);
Y=minim.loadSample(“SwordsCollide.mp3”, 512);
Z=minim.loadSample(“UFO.mp3”, 512);
}

/* cp5=new ControlP5 (this);

cp5.addTextfield(“text”)
.setPosition(100, 100)
.setSize(1000, 1000)
.setAutoClear(false)
.setColor(0);

cp5.addBang(“Submit”)
.setPosition(900, 900)
.setSize(100, 50)
.getCaptionLabel().align(ControlP5.CENTER, ControlP5.CENTER);
}*/
void draw() {
//background(0);
textSize(72);
//text(cp5.get(Textfield.class,“input”).getText(), 360,130);

//text(“a”, width/2,height/2);
}

void keyTyped() {

if ( key== ‘a’) A.trigger();
if ( key==‘a’)text(“a”, 400, 400);

if ( key== ‘b’) B.trigger();
if ( key==‘b’)text(“b”, 700, 700);

if ( key== ‘c’) C.trigger();
if ( key==‘c’)text(“c”, 300, 300);

if ( key== ‘d’) D.trigger();
if ( key==‘d’)text(“d”, 800, 800);

if ( key== ‘e’) E.trigger();
if ( key==‘e’)text(“e”, 350, 350);

if ( key== ‘f’) F.trigger();
if ( key==‘f’)text(“f”, 1000, 500);

if ( key== ‘g’) G.trigger();
if ( key==‘g’)text(“g”, 500, 800);

if ( key== ‘h’) H.trigger();
if ( key==‘h’)text(“h”, 900, 800);

if ( key== ‘i’) I.trigger();
if ( key==‘i’)text(“i”, 500, 200);

if ( key== ‘j’) J.trigger();
if ( key==‘j’)text(“j”, 500, 400);

if ( key== ‘k’) K.trigger();
if ( key==‘k’)text(“k”, 500, 600);

if ( key== ‘l’) L.trigger();
if ( key==‘l’)text(“l”, 500, 500);

if ( key== ‘m’) M.trigger();
if ( key==‘m’)text(“m”, 400, 600);

if ( key== ‘n’) N.trigger();
if ( key==‘n’)text(“n”, 400, 200);

if ( key== ‘o’) O.trigger();
if ( key==‘o’)text(“o”, 400, 900);

if ( key== ‘p’) P.trigger();
if ( key==‘p’)text(“p”, 700, 200);

if ( key== ‘q’) Q.trigger();
if ( key==‘q’)text(“q”, 700, 350);

if ( key== ‘r’) R.trigger();
if ( key==‘r’)text(“r”, 1200, 650);

if ( key== ‘s’) S.trigger();
if ( key==‘s’)text(“s”, 800, 900);

if ( key== ‘t’) T.trigger();
if ( key==‘t’)text(“t”, 1300, 200);

if ( key== ‘u’) U.trigger();
if ( key==‘u’)text(“u”, 1400, 500);

if ( key== ‘v’) V.trigger();
if ( key==‘v’)text(“v”, 1600, 800);

if ( key== ‘w’) W.trigger();
if ( key==‘w’)text(“w”, 1500, 600);

if ( key== ‘x’) X.trigger();
if ( key==‘x’)text(“x”, 1600, 500);

if ( key== ‘y’) Y.trigger();
if ( key==‘y’)text(“y”, 1300, 900);

if ( key== ‘z’) Z.trigger();
if ( key==‘z’)text(“z”, 1100, 200);
}