import java.awt.*; import java.awt.event.*; import java.io.*; import javax.sound.midi.*; public class noot extends Panel implements ActionListener, AdjustmentListener{ Scrollbar sbkorgus=new Scrollbar(Scrollbar.HORIZONTAL, 50, 0, 0, 100); Scrollbar sbvaljus=new Scrollbar(Scrollbar.HORIZONTAL, 50, 0, 0, 100); Scrollbar sbkordus=new Scrollbar(Scrollbar.HORIZONTAL, 10, 0, 1, 50); Scrollbar sbtempo=new Scrollbar(Scrollbar.HORIZONTAL, 1000, 0, 100, 10000); Label lakorgus=new Label("Kõrgus: "); Label lavaljus=new Label("Valjus: "); Label lakordus=new Label("Kordus: "); Label latempo=new Label("Tempo: "); Button kuula=new Button("Kuula"); int korgus; int valjus; int kordus; int tempo; public noot(){ Panel ylapaneel=new Panel(); ylapaneel.add(lakorgus); ylapaneel.add(sbkorgus); ylapaneel.add(lavaljus); ylapaneel.add(sbvaljus); ylapaneel.add(lakordus); ylapaneel.add(sbkordus); ylapaneel.add(latempo); ylapaneel.add(sbtempo); Panel alapaneel=new Panel(); alapaneel.add(kuula); setLayout(new BorderLayout()); add(ylapaneel, BorderLayout.NORTH); add(alapaneel, BorderLayout.SOUTH); kuula.addActionListener(this); sbkorgus.addAdjustmentListener(this); sbvaljus.addAdjustmentListener(this); sbkordus.addAdjustmentListener(this); sbtempo.addAdjustmentListener(this); } public void actionPerformed(ActionEvent e){ try{ Synthesizer synthesizer=MidiSystem.getSynthesizer(); synthesizer.open(); MidiChannel kanal=synthesizer.getChannels()[0]; //kanal 0; for(int i=0; i