Você está na página 1de 6

Instituto Tecnológico Superior

Vida Nueva
DMQ, 29 de octubre de 2018

Dr.
Wilfrido Robalino
Rector
INSTITUTO TECNOLÓGICO SUPERIOR VIDA NUEVA
Presente. -

De mis consideraciones:

Por medio de la presente pongo en conocimiento las actividades realizadas durante el


mes de julio en el proyecto de investigación: “Diseño y construcción de un sistema de
monitorización remota de los sensores y actuadores del sistema de inyección
electrónica de gasolina, usando tarjetas de adquisición de datos”, detallando las
actividades de cada uno de los docentes que participan en el desarrollo de dicho
proyecto. Cabe mencionar que el avance va acorde con el cronograma presentado por
lo tanto en este mes corresponde la adquisición de la tarjeta de adquisición de datos
final para realizar el acondicionamiento de las señales en el computador.
DOCENTE ACTIVIDADES
Ing. Darwin Arias M  Construcción de interfaces en JAVA y
LabView para la adquisición de datos en los
vehículos
 Programación de los controles

Av. Maldonado y 4ta transversal (Guamaní – antiguo peaje) Teléfono: 3076032 / 3653212
www.istvidanueva.edu.ec Tecnológico Vida Nueva
Instituto Tecnológico Superior
Vida Nueva
INFORME DEL PROCESO DE CONEXIÓN ENTRE JAVA Y LABVIEW

1. Obtención de las ondas con los complementos de netbeans Java

a. Complementos para la adquisición de datos con Java

Av. Maldonado y 4ta transversal (Guamaní – antiguo peaje) Teléfono: 3076032 / 3653212
www.istvidanueva.edu.ec Tecnológico Vida Nueva
Instituto Tecnológico Superior
Vida Nueva

PROGRAMACION DE LA INTERFACE DE JAVA PARA LA OBTENCION DE ONDAS


import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.sound.midi.ShortMessage;
import midi.MidiKeyboard;
import net.beadsproject.beads.core.AudioContext;
import net.beadsproject.beads.data.Buffer;
import net.beadsproject.beads.ugens.BiquadFilter;
import net.beadsproject.beads.ugens.Envelope;
import net.beadsproject.beads.ugens.Function;
import net.beadsproject.beads.ugens.Gain;
import net.beadsproject.beads.ugens.LPRezFilter;
import net.beadsproject.beads.ugens.WavePlayer;

public class juno_60_01


{
WavePlayer square, saw;
WavePlayer lfo;

Envelope envelope;
Gain vca;

BiquadFilter hpf;
LPRezFilter lpf;

int lastKeyPressed = -1;

public static void main(String[] args)


{
juno_60_01 synth = new juno_60_01();
synth.setup();
}

Av. Maldonado y 4ta transversal (Guamaní – antiguo peaje) Teléfono: 3076032 / 3653212
www.istvidanueva.edu.ec Tecnológico Vida Nueva
Instituto Tecnológico Superior
Vida Nueva
// construct the synthesizer
public void setup()
{
AudioContext ac = new AudioContext();

// the square and saw generators - this leaves out the sub generator and PWM
square = new WavePlayer(ac, 440.0f, Buffer.SQUARE);
saw = new WavePlayer(ac, 440.0f, Buffer.SAW);

// the single envelope on a Juno 60


envelope = new Envelope(ac, 0.0f);

// set up a custom function to convert the envelope to frequency range


Function filterEnvelope = new Function(envelope)
{
@Override
public float calculate()
{
// x[0] = envelope
// 5000.0f = maximum frequency
// 20.0f = minimum frequency
return (x[0] * 5000.0f) + 20.0f;
}
};

// set up the high pass filter and add the square and saw generators as input
hpf = new BiquadFilter(ac, BiquadFilter.BESSEL_HP, 100.0f, 1.0f);
hpf.addInput(square);
hpf.addInput(saw);

// set up the low pass filter and connect the hpf as input
lpf = new LPRezFilter(ac, filterEnvelope, 0.95f);
lpf.addInput(hpf);

// set up the Gain and connect it to the main output


vca = new Gain(ac, 1, envelope);
vca.addInput(lpf);
ac.out.addInput(vca);

// set up the keyboard input


MidiKeyboard keys = new MidiKeyboard();
keys.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e)
{

Av. Maldonado y 4ta transversal (Guamaní – antiguo peaje) Teléfono: 3076032 / 3653212
www.istvidanueva.edu.ec Tecnológico Vida Nueva
Instituto Tecnológico Superior
Vida Nueva
// if the event is not null
if( e != null )
{
// if the event is a MIDI event
if( e.getSource() instanceof ShortMessage )
{
// get the MIDI event
ShortMessage sm = (ShortMessage)e.getSource();

// if the event is a key down


if( sm.getCommand() == MidiKeyboard.NOTE_ON && sm.getData2() > 1 )
keyDown(sm.getData1());
// if the event is a key up
else if( sm.getCommand() == MidiKeyboard.NOTE_OFF )
keyUp(sm.getData1());
}
}
}
});

ac.start();
}

private float pitchToFrequency(int midiPitch)


{
/*
* MIDI pitch number to frequency conversion equation from
* http://newt.phys.unsw.edu.au/jw/notes.html
*/
double exponent = (midiPitch - 69.0) / 12.0;
return (float)(Math.pow(2, exponent) * 440.0f);
}

public void keyDown(int midiPitch)


{
if( square != null && saw != null && envelope != null )
{
lastKeyPressed = midiPitch;
square.setFrequency(pitchToFrequency(midiPitch));
saw.setFrequency(pitchToFrequency(midiPitch));

// attack segment
envelope.addSegment(0.5f, 0.1f);
// decay segment
envelope.addSegment(0.3f, 0.1f);
}

Av. Maldonado y 4ta transversal (Guamaní – antiguo peaje) Teléfono: 3076032 / 3653212
www.istvidanueva.edu.ec Tecnológico Vida Nueva
Instituto Tecnológico Superior
Vida Nueva
}

public void keyUp(int midiPitch)


{
if( envelope != null && midiPitch == lastKeyPressed )
{
// release segment
envelope.addSegment(0.0f, 0.5f);
}
}
}

Av. Maldonado y 4ta transversal (Guamaní – antiguo peaje) Teléfono: 3076032 / 3653212
www.istvidanueva.edu.ec Tecnológico Vida Nueva

Você também pode gostar