Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1581 connectés 

  FORUM HardWare.fr
  Programmation
  Divers

  compositeur virtuel : comment gérer le paramètre "tempo"

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

compositeur virtuel : comment gérer le paramètre "tempo"

n°2128662
Profil sup​primé
Posté le 28-02-2012 à 13:05:44  answer
 

Bonjour, bonjour à tous.
 
J'ai donc réalisé un petit programme qui pour le moment se contente de répéter ce qui est joué sur les périphérique MIDI.
Mon objectif est de réaliser un compositeur virtuel interactif.
J'ai  immédiatement un soucis particulier, la gestion du tempo, que je souhaite modifier au cours du temps.
Le tempo et envoyé aux périphériques sous forme de séries de messages "tempo" toute les 1/24 de noire pour une signature 4/4, si je ne m'abuse (je ne compte pas modifier la signature, toujours 4/4).
 
Je cherche comment passer et exploiter le paramètre tempo depuis le composer et le scheduler.
 
Voici mon implémentation : Le code c'est Ada, mais le problème reste à mon sens entier au niveau supérieur.
Libmy.MIDI : spec

Code :
  1. with Interfaces.C;                      use Interfaces.C;
  2. with System;                            use System;
  3. with Ada.Containers.Vectors;
  4. package Libmy.MIDI is
  5.  
  6.  type Tempo_Type is delta 0.1 digits 4 range 20.0..300.0;
  7.  
  8.  package Long_Vectors is new Ada.Containers.Vectors(Positive,
  9.                                                         Long,
  10.                                                        Interfaces.C."=" );
  11.   use Long_Vectors;
  12.  
  13.   subtype Step_Index_Type is Positive range 1..16*256;
  14.  
  15.   type Sequencer is array (Step_Index_Type'Range) of Vector;
  16.  
  17.   type Seq_Page_Type is
  18.      record
  19.         Keyb  : Sequencer;
  20.         Input : Sequencer;
  21.         Output : Sequencer;
  22.      end record;
  23.  
  24.   type Seq_Page_Access is access all Seq_Page_Type;
  25.   type Scheduler_Type is array (boolean'Range) of Seq_Page_Access;
  26.  
  27.   type Byte_Type is mod 256;
  28.  
  29.   type Message_Type is
  30.      record
  31.         Status : Byte_Type := 0;
  32.         Data1  : Byte_Type := 0;
  33.         Data2  : Byte_Type := 0;
  34.      end record;
  35.   Null_Message : constant Message_Type := (0, 0, 0);
  36. end Libmy.MIDI;


 
Libmy.MIDI.Composer : spec

Code :
  1. with Calendar;                          use Calendar;
  2.  
  3. generic
  4.  
  5. package Libmy.MIDI.Composer is
  6.   task Composer is
  7.      entry Halt;
  8.      entry Start(Seq_Page : in Seq_Page_Access;
  9.                  Bpm : in Tempo_Type; Top : in Time);
  10.      entry Stop;
  11.      entry Switch(Seq_Page : in Seq_Page_Access);
  12.   end Composer;
  13. end Libmy.MIDI.Composer;


 
Libmy.MIDI.Composer : impl

Code :
  1. package body Libmy.MIDI.Composer is
  2.  
  3.   -- Copy all input on output for composed current page.
  4.   procedure In2out(Seq_Page : in out Seq_Page_Type) is
  5.   begin
  6.  
  7.      for Step in Step_Index_Type'range loop
  8.         if Last_Index(Seq_Page.Keyb(Step)) /= 0 then
  9.            for I in 1..Last_Index(Seq_Page.Keyb(Step)) loop
  10.               Insert(Seq_Page.Output(Step),
  11.                      Last_Index(Seq_Page.Output(Step)) + 1,
  12.                      Element(Seq_Page.Keyb(Step), i));
  13.            end loop;
  14.         end if;
  15.         if Last_Index(Seq_Page.Input(Step)) /= 0 then
  16.            for I in 1..Last_Index(Seq_Page.Input(Step)) loop
  17.               Insert(Seq_Page.Output(Step),
  18.                      Last_Index(Seq_Page.Output(Step)) + 1,
  19.                      Element(Seq_Page.Input(Step), i));
  20.            end loop;
  21.         end if;
  22.      end loop;
  23.  
  24.   end In2out;
  25.  
  26.  
  27.   task body Composer is
  28.      The_Step  : positive := 1;
  29.      End_Of_Task : Boolean := False;
  30.      Suspended : Boolean := False;
  31.      Step_Date : Time := Clock;
  32.      Step_Sync : Duration;
  33.      Message : Long := 0;
  34.      The_Seq_Page : Seq_Page_Access;
  35.   begin
  36.      while not End_Of_Task loop
  37.         select
  38.            accept Start(Seq_Page : in Seq_Page_Access;
  39.                         Bpm : in Tempo_Type; Top : in Time) do
  40.               Suspended := False;
  41.               Step_Sync  := Duration(60.0/Float(bpm)/16.0);
  42.               Step_Date  := Top;
  43.               The_Step := 1;
  44.               The_Seq_Page := Seq_Page;
  45.            end Start;
  46.         or
  47.            accept Halt do
  48.               Suspended := True;
  49.               End_Of_Task := True;
  50.            end Halt;
  51.         end select;
  52.         delay until Step_Date;
  53.         while not Suspended loop
  54.  
  55.            select
  56.               accept Stop do
  57.                  Suspended := True;
  58.               end Stop;
  59.            or
  60.               accept Halt do
  61.                  Suspended := True;
  62.                  End_Of_Task := True;
  63.               end Halt;
  64.            or
  65.               accept Switch(Seq_Page : in Seq_Page_Access) do
  66.                  The_Seq_Page := Seq_Page;
  67.               end Switch;
  68.               In2out(The_Seq_Page.all);
  69.            else
  70.               null;
  71.            end select;
  72.         end loop;
  73.      end loop;
  74.   end Composer;
  75. end Libmy.MIDI.Composer;


 
Libmy.MIDI.Scheduler : spec

Code :
  1. with Libmy.MIDI.Composer;
  2. with System;                            use System;
  3. generic
  4.   Keyb_Addr   : access Address;
  5.   Input_Addr  : access Address;
  6.   Output_Addr : access Address;
  7.   with package Composer is new Libmy.MIDI.Composer;
  8. package Libmy.MIDI.Scheduler is
  9.  
  10.   -- Master keybord driver.
  11.   task Keyboard is
  12.      entry Send(Message : out Long);
  13.   end Keyboard;
  14.  
  15.   -- Synth input driver
  16.   task input is
  17.      entry Send(Message : out Long);
  18.   end Input;
  19.  
  20.   -- synth output driver.
  21.   task Output is
  22.      entry receive(Message : in Long);
  23.   end Output;
  24.  
  25.   -- smal step sequencer.
  26.   task Scheduler is
  27.      entry Start;
  28.      entry Stop;
  29.      entry Halt;
  30.   end Scheduler;
  31. end Libmy.MIDI.Scheduler;


 
Libmy.MIDI.Scheduler : impl  

Code :
  1. with Calendar;                          use Calendar;
  2. with Libmy.MIDI.Portmidi;               use Libmy.MIDI.Portmidi;
  3. with Libmy.MIDI.Porttime;               use Libmy.MIDI.Porttime;
  4. with Text_Io;
  5. package body Libmy.MIDI.Scheduler is
  6.  
  7.   task body Keyboard is
  8.      Pm_Event : PmEvent;
  9.   begin
  10.      loop
  11.         Pm_Event.Message := Read_handler(Keyb_Addr.all);
  12.         accept Send(Message : out Long) do
  13.            Message := Pm_Event.Message;
  14.         end Send;
  15.      end loop;
  16.   end Keyboard;
  17.  
  18.   task body Input is
  19.      Pm_Event : PmEvent;
  20.   begin
  21.      loop
  22.         Pm_Event.Message := Read_handler(Input_Addr.all);
  23.         accept Send(Message : out Long) do
  24.            Message := Pm_Event.Message;
  25.         end Send;
  26.      end loop;
  27.   end Input;
  28.  
  29.   task body Output is
  30.      Pm_Event : PmEvent;
  31.      Pm_Error : PmError;
  32.      Date : Time := Clock;
  33.      Sync : Duration := 0.0;
  34.   begin
  35.      loop
  36.         accept receive(Message : in Long) do
  37.            Pm_Event.Message := Message;
  38.         end Receive;
  39.         if Pm_Event.Message > 0 then
  40.            Pm_Event.PmTimestamp := Pt_time;
  41.            Pm_Error := Pm_Write(Output_Addr.All, Pm_Event, 1);
  42.         end if;
  43.      end loop;
  44.      Text_Io.Put_Line("End_output_Drivers" );
  45.   exception
  46.      when others =>
  47.         Text_Io.Put_line("exception in output driver." );
  48.   end Output;
  49.  
  50.  
  51.   task body Scheduler is
  52.  
  53.  
  54.      task Tempo_Drive is
  55.         entry Start(Bpm : in Tempo_Type; Top : in Time);
  56.         entry Stop;
  57.         entry Halt;
  58.      end Tempo_Drive;
  59.  
  60.      task body Tempo_Drive is
  61.  
  62.  
  63.         Suspended, End_Of_Task : Boolean := False;
  64.         Tempo_Message : Message_Type;
  65.         Tempo_Date : Time := Clock;
  66.         Tempo_Sync : Duration;
  67.  
  68.      begin
  69.  
  70.         while not End_Of_Task loop
  71.  
  72.            select
  73.               accept Start(Bpm : in Tempo_Type; Top : in Time) do
  74.                  Suspended := False;
  75.                  Text_Io.Put_Line("start global." );
  76.                  Tempo_Sync := duration(60.0/Float(Bpm)/24.0);
  77.                  Tempo_Date := Top;
  78.               end Start;
  79.            or
  80.               accept Halt do
  81.                  Text_Io.Put_Line("Halt global." );
  82.                  Suspended := True;
  83.                  End_Of_Task := True;
  84.               end Halt;
  85.            end select;
  86.            while not Suspended loop
  87.               select
  88.                  accept Stop do
  89.                     Text_Io.Put_Line("Stop global." );
  90.                     Suspended := True;
  91.                     end Stop;
  92.               or
  93.                  accept Halt do
  94.                     Text_Io.Put_Line("Halt global." );
  95.                     Suspended := True;
  96.                     End_Of_Task := True;
  97.                  end Halt;
  98.               or
  99.                  delay until Tempo_Date;
  100.                  Tempo_Date := Tempo_Date + Tempo_Sync;
  101.                  Tempo_Message := (16#F8#, 0, 0);
  102.                  Output.Receive(Pm_Message(Tempo_Message));
  103.               end select;
  104.            end loop;
  105.         end loop;
  106.         Text_Io.Put_Line("End_Tempo_Drivers" );
  107.      exception
  108.         when others =>
  109.            Text_Io.Put("Exception in Tempo Driver" );
  110.      end Tempo_Drive;
  111.  
  112.  
  113.      The_Sched : Scheduler_Type := (new Seq_Page_Type, new Seq_Page_Type);
  114.      The_Step  : positive := 1;
  115.      The_Page : Boolean := False;
  116.      End_Of_Task : Boolean := False;
  117.      Suspended : Boolean := False;
  118.      Step_Date : Time := Clock;
  119.      Step_Sync : Duration;
  120.      Message : Long := 0;
  121.      Tempo : Tempo_Type := 240.0;
  122.   begin
  123.      while not End_Of_Task loop
  124.         select
  125.            accept Start do
  126.               Suspended := False;
  127.               Step_Sync  := Duration(60.0/Float(Tempo)/16.0);
  128.               Step_Date  := Clock;
  129.               The_Step := 1;
  130.               Tempo_Drive.Start(Tempo,
  131.                                 Step_Date);
  132.               Composer.Composer.Start(The_Sched(not The_Page),
  133.                                       Tempo,
  134.                                       Step_Date);
  135.            end Start;
  136.         or
  137.            accept Halt do
  138.               Suspended := True;
  139.               End_Of_Task := True;
  140.               Composer.Composer.Halt;
  141.               Tempo_Drive.Halt;
  142.            end Halt;
  143.         end select;
  144.         delay until Step_Date;
  145.         while not Suspended loop
  146.  
  147.            select
  148.               accept Stop do
  149.                  Suspended := True;
  150.                  Composer.Composer.Stop;
  151.                  Tempo_Drive.Stop;
  152.               end Stop;
  153.            or
  154.               accept Halt do
  155.                  Suspended := True;
  156.                  End_Of_Task := True;
  157.                  Composer.Composer.Halt;
  158.                  Tempo_Drive.Halt;
  159.               end Halt;
  160.  
  161.            else
  162.               -- Reading data in input while not end of step.
  163.               while Step_Date > Clock loop
  164.                  select
  165.                     keyboard.Send(Message);
  166.                     Insert(The_Sched(not The_Page).Keyb(The_Step),
  167.                            Last_index(The_Sched(not The_Page).Keyb(The_Step)) + 1,
  168.                            Message,
  169.                            1);
  170.                  else
  171.                     null;
  172.                  end select;
  173.                  select
  174.                     input.Send(Message);
  175.                      Insert(The_Sched(not The_Page).Keyb(The_Step),
  176.                            Last_index(The_Sched(not The_Page).Keyb(The_Step)) + 1,
  177.                            Message,
  178.                            1);
  179.                  else
  180.                     null;
  181.                  end select;
  182.               end loop;
  183.  
  184.               -- Writing Data for current step.
  185.               if Last_index(The_Sched(The_Page).Output(The_Step)) /= 0 then
  186.                  for I in 1..Last_index(The_Sched(The_Page).Output(The_Step)) loop
  187.                     Output.Receive(Element(The_Sched(The_Page).Output(The_Step), i));
  188.                  end loop;
  189.  
  190.                  Clear(The_Sched(The_Page).Output(The_Step));
  191.               end if;
  192.  
  193.               -- Step & page managment.
  194.               Step_Date := Step_Date + Step_Sync;
  195.               if The_Step = Step_Index_Type'Last then
  196.  
  197.                  Text_Io.Put(Character'Val(13) & "Step :" &
  198.                                Step_Index_Type'Image(The_Step));
  199.                  Text_Io.Put_Line(", change page..." );
  200.                  The_Step := 1;
  201.                  The_Page := not The_Page;
  202.                  Composer.Composer.Switch(The_Sched(not The_Page));
  203.               else
  204.                  Text_Io.Put(Character'Val(13) & "Step :" &
  205.                                Step_Index_Type'Image(The_Step));
  206.  
  207.  
  208.                  The_Step := The_Step + 1;
  209.               end if;
  210.  
  211.            end select;
  212.         end loop;
  213.      end loop;
  214.      abort Keyboard;
  215.      abort Input;
  216.      abort Output;
  217.      Text_Io.Put_Line("End_scheduler" );
  218.   exception
  219.      when others =>
  220.         Text_Io.Put_Line("Exception in scheduler driver" );
  221.   end Scheduler;
  222. end Libmy.MIDI.Scheduler;


Main : impl (initialize device address)

Code :
  1. with System;                            use System;
  2. with Interfaces.C;                      use Interfaces.C;
  3.  
  4. with Libmy.MIDI.Portmidi;               use Libmy.MIDI.Portmidi;
  5. with Libmy.MIDI.Composer;
  6. with Libmy.MIDI.Scheduler;
  7. with Libmy.MIDI;                        use Libmy.MIDI;
  8. with Text_Io;
  9. procedure Main is
  10.  
  11.  
  12.   use ErrorText_Conversion;
  13.   use DeviceInfo_Conversion;
  14.  
  15.   Keyb_In   : aliased Address;
  16.   Synth_In  : aliased Address;
  17.   Synth_Out : aliased Address;
  18. begin
  19.  
  20.   loop
  21.      declare
  22.         line : String(1..512) := (others => Character'Val(32));
  23.         Last,
  24.         Choice : Natural := 0;
  25.         The_Deviceinfo : DeviceInfo;
  26.         Name : T_ErrorText;
  27.      begin
  28.  
  29.         loop
  30.            Text_Io.Put_Line("Enter master Keyboard" );
  31.            Text_Io.Put_Line("ID, Device Name" );
  32.            for I in 0..Pm_CountDevices-1 loop
  33.               The_DeviceInfo :=
  34.                 DeviceInfo_Conversion.To_pointer(Pm_GetDeviceInfo(I)).all;
  35.               if The_Deviceinfo.input = 1 then
  36.                  Name := To_Pointer(The_Deviceinfo.name).all;
  37.                  Text_Io.Put(Integer'Image(I));
  38.                  Text_Io.Put_line(", " & To_Ada(Name));
  39.               end if;
  40.            end loop;
  41.            Text_Io.Put("Enter device ID : " );
  42.            Text_Io.Get_line(line, Last);
  43.            if Last /= 0 then
  44.               Choice := Natural'Value(Line(1..Last));
  45.               exit;
  46.            end if;
  47.         end loop;
  48.         Keyb_In := Input_Open_Handler(Choice);
  49.         exit;
  50.      exception
  51.         when others =>
  52.            null;
  53.      end;
  54.   end loop;
  55.  
  56.  
  57.   loop
  58.      declare
  59.         line : String(1..512) := (others => Character'Val(32));
  60.         Last,
  61.         Choice : Natural := 0;
  62.         The_Deviceinfo : DeviceInfo;
  63.         Name : T_ErrorText;
  64.      begin
  65.  
  66.         loop
  67.            Text_Io.Put_Line("Enter input for instrument" );
  68.            Text_Io.Put_Line("ID, Device Name" );
  69.            for I in 0..Pm_CountDevices-1 loop
  70.               The_DeviceInfo :=
  71.                 DeviceInfo_Conversion.To_pointer(Pm_GetDeviceInfo(I)).all;
  72.               if The_Deviceinfo.Input = 1 then
  73.                  Name := To_Pointer(The_Deviceinfo.name).all;
  74.                  Text_Io.Put(Integer'Image(I));
  75.                  Text_Io.Put_line(", " & To_Ada(Name));
  76.               end if;
  77.            end loop;
  78.            Text_Io.Put("Enter device ID : " );
  79.            Text_Io.Get_line(line, Last);
  80.            if Last /= 0 then
  81.               Choice := Natural'Value(Line(1..Last));
  82.               exit;
  83.            end if;
  84.         end loop;
  85.         Synth_in := input_Open_Handler(Choice);
  86.         exit;
  87.      exception
  88.         when others =>
  89.            null;
  90.      end;
  91.   end loop;
  92.  
  93.   loop
  94.  
  95.      declare
  96.         line : String(1..512) := (others => Character'Val(32));
  97.         Last,
  98.         Choice : Natural := 0;
  99.         The_Deviceinfo : DeviceInfo;
  100.         Name : T_ErrorText;
  101.      begin
  102.  
  103.         loop
  104.            Text_Io.Put_Line("Enter output for instrument" );
  105.            Text_Io.Put_Line("ID, Device Name" );
  106.            for I in 0..Pm_CountDevices-1 loop
  107.               The_DeviceInfo :=
  108.                 DeviceInfo_Conversion.To_pointer(Pm_GetDeviceInfo(I)).all;
  109.               if The_Deviceinfo.Output = 1 then
  110.                  Name := To_Pointer(The_Deviceinfo.name).all;
  111.                  Text_Io.Put(Integer'Image(I));
  112.                  Text_Io.Put_line(", " & To_Ada(Name));
  113.               end if;
  114.            end loop;
  115.            Text_Io.Put("Enter device ID : " );
  116.            Text_Io.Get_line(line, Last);
  117.            if Last /= 0 then
  118.               Choice := Natural'Value(Line(1..Last));
  119.               exit;
  120.            end if;
  121.         end loop;
  122.         Synth_Out := Output_Open_Handler(Choice);
  123.         exit;
  124.      exception
  125.         when others =>
  126.            null;
  127.      end;
  128.   end loop;
  129.  
  130.   declare
  131.  
  132.      package My_Composer is new Libmy.MIDI.Composer;
  133.      package My_Scheduler is new Libmy.MIDI.Scheduler(Keyb_In'Access,
  134.  
  135.  
  136.                                                       Synth_In'access,
  137.                                                       Synth_Out'Access,
  138.                                                       My_Composer);
  139.      Run : Boolean := False;
  140.      Char: Character;
  141.   begin
  142.  
  143.      loop
  144.         Text_Io.Put_Line("Press 'Esc' to quit or 'space' to start or stop." );
  145.         Text_Io.Get_Immediate(Char);
  146.         case Char is
  147.            when Character'Val(27) =>
  148.               My_Scheduler.Scheduler.Halt;
  149.               Text_Io.Put_Line("Active one Ctrl on all input device." );
  150.               exit;
  151.            when Character'Val(32) =>
  152.               if Run then
  153.                  My_Scheduler.Scheduler.Stop;
  154.                  Run := False;
  155.               else
  156.                  My_Scheduler.Scheduler.Start;
  157.                  Run := True;
  158.               end if;
  159.            when others =>
  160.               null;
  161.         end case;
  162.      end loop;
  163.   end;
  164. end Main;


 
Vous savez tout, à vos cerveau !
Si vous avez des interrogations, n'hésitez pas. Merci déjà de m'avoir lu.
 
 
edit : j'avais oublié le tempo_type et message_type dans la lib libmy.MIDI.


Message édité par Profil supprimé le 28-02-2012 à 13:56:33
mood
Publicité
Posté le 28-02-2012 à 13:05:44  profilanswer
 

n°2128678
rufo
Pas me confondre avec Lycos!
Posté le 28-02-2012 à 14:29:00  profilanswer
 

Retour aux sources : http://fr.wikipedia.org/wiki/Tempo
 

Citation :


On indique alors par des chiffres le tempo d'une musique, ou plus exactement le battement par minute. Par exemple ♪ = 120 signifie que l'on doit jouer en une minute l'équivalent de cent vingt croches, soit soixante noires, ou trente blanches, ou encore quinze rondes.


 
T'as ta réponse : tu dois intégrer partout où tu joues des notes la variable Tempo pour déterminer la durée que chaque note sera tenue ;)
 
Ps : plutôt que de nous balancer des 100ènes de lignes de codes en Ada (que je doute que qq'un lise), je pense que tu ferais mieux, avant le codage, de définir l'ensemble des algos qui te seront nécessaires + définir l'architecture de ton appli, bref faire de la conception :/ Après, le codage ira tout seul...


Message édité par rufo le 28-02-2012 à 14:32:22

---------------
Astres, outil de help-desk GPL : http://sourceforge.net/projects/astres, ICARE, gestion de conf : http://sourceforge.net/projects/icare, Outil Planeta Calandreta : https://framalibre.org/content/planeta-calandreta
n°2128682
Profil sup​primé
Posté le 28-02-2012 à 14:40:18  answer
 

Bonjour rufo,
 
Donc, je fais une piste supplémentaire dans mes page de séquenceur pour le tempo et je synchronise à chaque changement.
 
Pour le code, c'est la première chose que demande Gilou et franchement, j'ai rien d'autre à poster.
Si tu me donne ton adresse, je t'envoie les kilo de papier que j'écris.
Mais je suis complètement incapable de produire autre chose que du français ou Ada ici.

n°2128686
Profil sup​primé
Posté le 28-02-2012 à 14:54:48  answer
 

Lutin, si je concevais les chose de manière indiscutable je posterais pas, et personne d'autre d'ailleurs, tu serais tout seul sur le site.  :heink:


Message édité par Profil supprimé le 28-02-2012 à 14:55:09
n°2128687
rufo
Pas me confondre avec Lycos!
Posté le 28-02-2012 à 15:01:26  profilanswer
 

Je voulais pas te vexer. Mais à la vue de tes différents posts sur ce sujet (composer virtuel), j'ai l'impression que ton pb se situait plus au niveau archi et/ou algo que développement pur en Ada.


---------------
Astres, outil de help-desk GPL : http://sourceforge.net/projects/astres, ICARE, gestion de conf : http://sourceforge.net/projects/icare, Outil Planeta Calandreta : https://framalibre.org/content/planeta-calandreta
n°2128689
Profil sup​primé
Posté le 28-02-2012 à 15:13:58  answer
 

Je suis préoccupé par la partie "génération infini de fusion/fission de classique et de techno".
Mais chaque chose en son temps, donc, je me suis soulagé de la partie gestion des messages en boucle ici.
Reste à composer la musique et à la faire entrer dans les cases.
Je conçois/Analyse/Fais des choix/implémente en boucle depuis 15 ans, et je suis incapable de changer de méthode.

n°2128745
Profil sup​primé
Posté le 28-02-2012 à 20:19:19  answer
 

Merci rufo.
 
j'ai fait une piste tempo dans mes deux pages de séquence de pas.
J'ai ajouté une entrée sync à la tache "Tempo_Drive" que j'appelle depuis le scheduler.
 
Au cas ou ça intéresse, j'ai ajouter un groupe instruction en fin de select dans la boucle not suspended,
Comme ceci, en décalant en toute fin le mise à jour de Step_Date,  

Code :
  1. --
  2. if Tempo /= The_Sched(The_Page).Tempo(The_Step) then
  3.   Tempo := The_Sched(The_Page).Tempo(The_Step);
  4.   Tempo_Drive.Sync(Tempo);
  5.   Step_Sync  := Duration(60.0/Float(Tempo)/16.0);
  6. end if;
  7. Step_Date := Step_Date + Step_Sync;


 
 
(Gilou mon astuce pour conserver l'indentation marche plus...  :??:  :heink:  :whistle:  :lol:  :fou:  :o
edit: aben si ça marche, j'ai zuté quelque part.
Amoins que :
test :

Code :
  1. --
  2.               if Tempo /= The_Sched(The_Page).Tempo(The_Step) then
  3.                  Tempo := The_Sched(The_Page).Tempo(The_Step);
  4.                  Tempo_Drive.Sync(Tempo);
  5.                  Step_Sync  := Duration(60.0/Float(Tempo)/16.0);
  6.               end if;
  7.               Step_Date := Step_Date + Step_Sync;


Message édité par Profil supprimé le 28-02-2012 à 20:23:48

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Divers

  compositeur virtuel : comment gérer le paramètre "tempo"

 

Sujets relatifs
Quel(s) objet(s) pour un compositeur virtuel pour instrument MIDI[C]Gérer le env -i ?
iText pdfBox xmpBox : gérer des métadata xmp dans un pdf pdf/apassage de paramètre à une fonction
(VB.NET) Meilleure façon de gérer une liste de 230.000 lignes ?require_once et paramètre sous forme de variable
passage de parametre avec autocomplete de jquery uiprobleme de parametre avec requete préparéee dans une méthode MVC
Plus de sujets relatifs à : compositeur virtuel : comment gérer le paramètre "tempo"


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR