1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
| with Mal.MIDI;
with Ada.Text_Io;
use Mal.MIDI;
use Ada;
with Calendar;
use Calendar;
use Mal;
procedure Midi_Test is
List : Devices_List_Access;
Id : Natural := 0;
begin
Mal.MIDI.Initialize;
Add_Instrument(Id);
List := Outputs_List;
for I in List'Range loop
Text_Io.Put(Natural'Image(I) & " " & List(I).Name.all);
Text_Io.New_Line;
end loop;
Initialize_Output(Id, List(10));
Add_Instrument(Id);
Initialize_Output(Id, List(8));
Text_Io.Put_Line("Openning device");
for I in 1..Orchester_Last loop
MIDI.Open(Orchester(I).Device_Driver.Output.all);
Text_Io.Put_Line("Output " & Positive'Image(I) & " openned!");
delay 0.1;
end loop;
Text_Io.Put_Line("starting tempo sync");
for I in 1..Orchester_Last loop
Orchester(I).Tempo_Sync.Start(Clock+ 1.0, Tempo_Type(120.0));
end loop;
Text_Io.Put_Line("wait 20s");
for I in reverse 1..20 loop
Text_Io.Put(Integer'Image(I) & Character'Val(13));
delay 1.0;
end loop;
Text_Io.Put_Line("Stopping tempo sync");
for I in 1..Orchester_Last loop
Orchester(I).Tempo_Sync.Halt;
end loop;
Text_Io.Put_Line("Closing device");
for I in 1..Orchester_Last loop
MIDI.Close(Orchester(I).Device_Driver.Output.all);
Text_Io.Put_Line("Output " & Positive'Image(I) & " closed!");
end loop;
end Midi_Test; |
Partager