Ouverture d'un fichier de records

Résolu
Utilisateur anonyme - 1 mai 2008 à 00:23
L_art_ment Messages postés 302 Date d'inscription vendredi 21 septembre 2007 Statut Membre Dernière intervention 6 février 2013 - 2 mai 2008 à 08:34
Salut à tous,

Je suis entrain de faire de sauvegarder et ouvrir des records dans un fichier. Au niveau de l'enregistrement je n'ai aucun problemes (j'ai vérifié ) par contre au niveau de l'ouverture j'ai un décalage que je ne capte pas. Ca fait 6heures que je suis dessus et ca commence à me rendre dingue cette histoire .

Ecriture

Procedure Write_PatternFile(FileName:String);
Var
  IndexStr,IndexKey:Cardinal;
  FS:TFileStream;
  SizeRef1,SizeRef2: Cardinal;
  Info:String;
Begin
  FS:=TFileStream.Create(FileName,fmCreate);
  Try
    For IndexStr:=8 To High(Form1.PatternMidi.Instruments) Do
    FS.Write(Form1.PatternMidi.Instruments[IndexStr],SizeOf(Form1.PatternMidi.Instruments[IndexStr]));
    SizeRef1:=FS.Size;
    For IndexStr:=0 To High(Form1.PatternMidi.Instruments) Do   
    For IndexKey:=0 To (Form1.PatternMidi.NbCases-1) Do
    FS.Write(Form1.PatternMidi.Partition[IndexStr,IndexKey],SizeOf(Form1.PatternMidi.Partition[IndexStr,IndexKey]));
    SizeRef2:=FS.Size-SizeRef1;
    Info:=Format('%d-%d-%d-%d|',[SizeRef1,SizeRef2,High(Form1.PatternMidi.Instruments),Form1.PatternMidi.NbCases-1]);
    FS.Seek(-Length(Info),soFromBeginning);
    FS.Position:=0;
    FS.Write(PChar(Info)^,Length(Info));
  Finally
    FS.Free;
  End;
End;

Ouverture :

Procedure Read_PatternFile(FileName:String);
var
  FS : TFileStream;
  Instrument:TInstrument;
  SizeRef1,SizeRef2,LenghtInfo: Cardinal;
  ALine:array[0..255] of char;
  Info:String;
  ActiveKey:Boolean;
  NbInstr,NbKey,IndexInstr,IndexKey:Cardinal;
begin
 FS:=TFileStream.create(FileName,fmOpenRead);
 try
   FS.Read(ALine,Length(ALine));
   Info:=string(ALine);
   LenghtInfo:=Length(Copy(Info,1,Pos('|',Info)));
   SizeRef1:=StrToInt(Copy(Info,1,Pos('-',Info)-1));
   Delete(Info,1,Pos('-',Info));
   SizeRef2:=StrToInt(Copy(Info,1,Pos('-',Info)-1));
   Delete(Info,1,Pos('-',Info));
   NbInstr:=StrToInt(Copy(Info,1,Pos('-',Info)-1));
   Delete(Info,1,Pos('-',Info));
   NbKey:=StrToInt(Copy(Info,1,Pos('|',Info)-1));
   IndexInstr:=0;
   IndexKey:=0;

   FS.Position:=LenghtInfo;
   while FS.Position<>LenghtInfo+SizeRef1 do
     Begin
       FS.Read (Instrument, SizeOf(Instrument));
       Form1.PatternMidi.Add_Instrument(Instrument.Instrument,Instrument.Channel,Instrument.Note);
         With Form1.PatternMidi Do
           Begin
             Instruments[High(Instruments)].Active:=Instrument.Active;
             Instruments[High(Instruments)].Volume:=Instrument.Volume;
             Instruments[High(Instruments)].Velocity:=Instrument.Velocity;
             Instruments[High(Instruments)].PitchBend:=Instrument.PitchBend;
             Instruments[High(Instruments)].ChannelPressure:=Instrument.ChannelPressure;
             Instruments[High(Instruments)].Modulation:=Instrument.Modulation;
             Instruments[High(Instruments)].PortamentoTime:=Instrument.PortamentoTime;
             Instruments[High(Instruments)].PortamentoSwitch:=Instrument.PortamentoSwitch;
             Instruments[High(Instruments)].PortamentoNote:=Instrument.PortamentoNote;
             Instruments[High(Instruments)].Resonance:=Instrument.Resonance;
             Instruments[High(Instruments)].Pan:=Instrument.Pan;
             Instruments[High(Instruments)].Expression:=Instrument.Expression;
             Instruments[High(Instruments)].Sustain:=Instrument.Sustain;
             Instruments[High(Instruments)].Reverb:=Instrument.Reverb;
           End;
     end;
  FS.Position:=LenghtInfo+SizeRef1;
   while FS.Position<>FS.Size do
     Begin
       FS.Read(ActiveKey,SizeOf(ActiveKey));
       Form1.PatternMidi.Partition[IndexInstr,IndexKey]:=ActiveKey;
       Inc(IndexKey);
       If IndexKey>NbKey Then
         Begin
           IndexKey:=0;
           Inc(IndexInstr);
         End;  
       End;
 finally
  FS.Free;
  Form1.PatternMidi.Refresh;
 end;
End;

Si une ame charitable pouvait sauver le seul cheveux qui me reste .

Merci à tous

15 réponses

f0xi Messages postés 4205 Date d'inscription samedi 16 octobre 2004 Statut Modérateur Dernière intervention 12 mars 2022 35
1 mai 2008 à 09:00
ah oui pour en revenir a mon "1" :

cela permet de faire un dump plus facilement :

const
  ofs_Sign = $00000000;
  ofs_ItemsCount = ofs_Sign+8;
  ofs_TotalSize = ofs_ItemsCount+4
  ofs_ItemsDatasStart = ofs_TotalSize+4;

en fait faut visualiser l'imbrication des structures des elements du fichiers :

[file
  [header ->
    [header element 1]
    [header element 2]
    [header element n]
  ]
  [datas ->
    [data structure 1]
    [data structure 2]
    [data structure n]
  ]
]

type
  TMyFileHeader = record
    Sign : LongWord;
    ItemsCount : LongWord;
    TotalSize  : LongWord;
    Reserved   : array[0..n] of byte;
  end;

  TMyFileData = record
    DataSize : LongWord;
    { suite }
  end;

  TMyFileDatas = array of TMyFileData;

  TMyFile = record
    Header : TMyFileHeader;
    Datas : TMyFileDatas;
  end;

et avec TMemoryStream on peu faire encore plus!

je te mets sur la voie :

var MS : TMemoryStream;
    pM : pointer;
    pFileSign : pLongWord;
    pItemCount: pLongWord;
    pTotalSize: pLongWord;
begin
  MS := TMemoryStream.Create;
  try
    { reglage }
    MS.SetSize(256);
    pM := MS.Memory;
    FillChar(pM^, 256, #0);

    { offsetization des pointeurs ^_^ }
    pFileSign := pLongWord(integer(pM));
    pItemCount:= pLongWord(integer(pM)+8);
    pTotalSize:= pLongWord(integer(pM)+16);

    { Ecriture OnTheFly des données }
    pFileSign^  := $11111111;
    pItemCount^ := $22222222;
    pTotalSize^ := $33333333;

    { Sauvegarde }
    MS.SaveToFile('c:\test.bin');
  finally
    MS.Free;
  end;
end;

ps : si on rappel SetSize les données ne sont pas ecrasée si la nouvelle taille est plus grande!

ça evite de se prendre la tête avec des seek, des read et des write et
d'etre perdus en cours de route... pouf pouf pouf...

<hr size="2" width="100%" />
3
f0xi Messages postés 4205 Date d'inscription samedi 16 octobre 2004 Statut Modérateur Dernière intervention 12 mars 2022 35
1 mai 2008 à 19:43
       Info := Format('|%d-%d-%d',[SizeRef1,SizeRef2,NbCases]);
        MS.Write(PChar(Info)^,Length(Info));

    FS.Read(ALine,Length(ALine));
    Info:=Copy(ALine,Pos('|',ALine)+1,Length(ALine));
    SizeRef1:=StrToInt(Copy(Info,1,Pos('-',Info)-1));
    Delete(Info,1,Pos('-',Info));
    SizeRef2:=StrToInt(Copy(Info,1,Pos('-',Info)-1));
    Delete(Info,1,Pos('-',Info));
    NbKey:=StrToInt(Info);

PUTAIN! mais vire moi ce code de merde!

type
  TInfo = record
    SizeRefA : LongWord;
    SizeRefB : LongWord;
    NbKey    : LongWord;
  end;

const
  SizeOf_TInfo = SizeOf(TInfo);

{...}
  MS.WriteBuffer(Info, SizeOf_TInfo);

{...}
  FS.ReadBuffer(Info, SizeOf_TInfo);

c'est quoi la ce nawak avec tes format, delete, copy a la con ?

la je suis pas content du tout de toi.

<hr size="2" width="100%" />
3
f0xi Messages postés 4205 Date d'inscription samedi 16 octobre 2004 Statut Modérateur Dernière intervention 12 mars 2022 35
1 mai 2008 à 19:46
en plus a l'ecriture NbCases et la lecture pouf magie ça devient NbKey ...

evite de changer la denomination de l'un a l'autre.

on ecrit Couille
on relit Couille ... pas rectum.

grrrr!

aller, courage, organise moi ça correctement.

<hr size="2" width="100%" />
3
Utilisateur anonyme
1 mai 2008 à 00:24
Arfff j'ai oublié l'essentiel : C'est dans la seconde partie que j'ai un probleme

  FS.Position:=LenghtInfo+SizeRef1;
   while FS.Position<>FS.Size do
     Begin
       FS.Read(ActiveKey,SizeOf(ActiveKey));
       Form1.PatternMidi.Partition[IndexInstr,IndexKey]:=ActiveKey;
       Inc(IndexKey);
       If IndexKey>NbKey Then
         Begin
           IndexKey:=0;
           Inc(IndexInstr);
         End;  
       End;
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
f0xi Messages postés 4205 Date d'inscription samedi 16 octobre 2004 Statut Modérateur Dernière intervention 12 mars 2022 35
1 mai 2008 à 08:27
1) est-ce que tu t'es ecrit une description de la structure de ton fichier ?

exemple :

[0..3] File sign / long word
[4..9] null / reserved
[10..13] items count / long word
[14..19] null / reserved
[20] first item

item :
[x0..x3] item size / long word
[x4...x4+item size] item data
[next item]

si tu ne l'as pas fait, fait le.

2) ne stocke pas des chaine quand tu peu stocker des données brutes

...format('%d-%d-%d',[itemscount, filesize, itemsize]);
write(chaine_a_la_con_qu_il_faudrat_relire_comme_un_bourrin_aprés...);

fait plutot des records :

type
  pItemTrucMachin = ^TItemTrucMachin; // toujours, au cas ou...
  TItemTrucMachin = record
    itemscount : longword;
    filesize : longword;
    itemsize : longword;
  end;
...
const
  SizeOf_TItemTrucMachin = SizeOf(TItemTrucMachin); // une fois pour toute
...
writebuffer(ItemTrucMachin, SizeOf_TItemTrucMachin);

<hr size="2" width="100%" />
0
Utilisateur anonyme
1 mai 2008 à 13:23
Salut et merci

Voila ma structure

type
  TInstrument=Record
      Channel:Byte;
      Instrument:Byte;
      Note:Byte;
       Active:Boolean;
      Volume:Byte;
      Velocity:Byte;
      PitchBend:Byte;
      ChannelPressure:Byte;
      Modulation:Byte;
      PortamentoTime:Byte;
      PortamentoSwitch:Byte;
      PortamentoNote:Byte;
      Resonance:Byte;
      Pan:Byte;
      Expression:Byte;
      Sustain:Byte;
      Reverb:Byte;
      End;
0
Utilisateur anonyme
1 mai 2008 à 16:56
Salut,

C'était un probleme d'offset : j'ai pas tout compris le pourquoi du comment mais j'ai fais un truc qui fonctionne

Procedure Write_PatternFile(FileName:String);
Var
  IndexStr,IndexKey:Cardinal;
  MS:TMemoryStream;
  SizeRef1,SizeRef2: Cardinal;
  Info:String;
Begin
  With Form1.PatternMidi Do
    Begin
      MS:=TMemoryStream.Create;
      Try
        For IndexStr:=0 To High(Form1.PatternMidi.Instruments) Do
        For IndexKey:=0 To (Form1.PatternMidi.NbCases-1) Do
        MS.Write(Partition[IndexStr,IndexKey],SizeOf(Partition[IndexStr,IndexKey]));
        SizeRef1:=MS.Size;
        For IndexStr:=0 To High(Form1.PatternMidi.Instruments) Do
        MS.Write(Instruments[IndexStr],SizeOf(Instruments[IndexStr]));
        SizeRef2:=MS.Size;
        Info := Format('|%d-%d-%d',[SizeRef1,SizeRef2,NbCases]);
        MS.Write(PChar(Info)^,Length(Info));
        MS.SaveToFile(FileName);
      Finally
        MS.Free;
      End;   
    End;
End;

Procedure Read_PatternFile(FileName:String);
var
  FS : TFileStream;
  Instrument:TInstrument;
  SizeRef1,SizeRef2: Cardinal;
  ALine:array[0..50] of char;
  Info:String;
  ActiveKey:Boolean;
  NbInstr,NbKey,CountInstr,CountKey:Cardinal;
begin
  FS:=TFileStream.Create(FileName,fmOpenRead);
  Try
    FS.Position:=FS.Size-SizeOf(ALine);
    FS.Read(ALine,Length(ALine));
    Info:=Copy(ALine,Pos('|',ALine)+1,Length(ALine));
    SizeRef1:=StrToInt(Copy(Info,1,Pos('-',Info)-1));
    Delete(Info,1,Pos('-',Info));
    SizeRef2:=StrToInt(Copy(Info,1,Pos('-',Info)-1));
    Delete(Info,1,Pos('-',Info));
    NbKey:=StrToInt(Info);

    FS.Position:=SizeRef1;
    CountInstr:=1;
    while FS.Position<>SizeRef2 do
     Begin
       FS.Read (Instrument, SizeOf(Instrument));
       If CountInstr>8 Then
       Form1.PatternMidi.Add_Instrument(Instrument.Instrument,Instrument.Channel,Instrument.Note);
       With Form1.PatternMidi Do
         Begin
           Instruments[CountInstr-1].Active:=Instrument.Active;
           Instruments[CountInstr-1].Volume:=Instrument.Volume;
           Instruments[CountInstr-1].Velocity:=Instrument.Velocity;
           Instruments[CountInstr-1].PitchBend:=Instrument.PitchBend;
           Instruments[CountInstr-1].ChannelPressure:=Instrument.ChannelPressure;
           Instruments[CountInstr-1].Modulation:=Instrument.Modulation;
           Instruments[CountInstr-1].PortamentoTime:=Instrument.PortamentoTime;
           Instruments[CountInstr-1].PortamentoSwitch:=Instrument.PortamentoSwitch;
           Instruments[CountInstr-1].PortamentoNote:=Instrument.PortamentoNote;
           Instruments[CountInstr-1].Resonance:=Instrument.Resonance;
           Instruments[CountInstr-1].Pan:=Instrument.Pan;
           Instruments[CountInstr-1].Expression:=Instrument.Expression;
           Instruments[CountInstr-1].Sustain:=Instrument.Sustain;
           Instruments[CountInstr-1].Reverb:=Instrument.Reverb;
         End;
       Inc(CountInstr);
     end;

    FS.Position:=0;
    CountInstr:=1;
    CountKey:=1;
    while FS.Position<>SizeRef1 do
     Begin
       FS.Read (ActiveKey, SizeOf(ActiveKey));
       Form1.PatternMidi.Partition[CountInstr-1,CountKey-1]:=ActiveKey;
       Inc(CountKey);
       If CountKey>NbKey Then
         Begin
           CountKey:=1;
           Inc(CountInstr);
         End;
     End;
 finally
  FS.Free;
  Form1.PatternMidi.Refresh;
 end;
End;
0
Utilisateur anonyme
1 mai 2008 à 20:27
la je suis pas content du tout de toi.====>

Oui Papa

Merci f0xi : Effectivement ce n'était pas élégant ces delete et copy mais jamais j'aurais pensé à passer par un record pour faire ca . J'ai appris une nouvelle technique . Merci beaucoup .
0
f0xi Messages postés 4205 Date d'inscription samedi 16 octobre 2004 Statut Modérateur Dernière intervention 12 mars 2022 35
1 mai 2008 à 20:43
bon je vois bien dans tes yeux humide qu'il te le faut en texte :

[InfoStr
  [0] DataA size
  [1] DataB size
  [2] DataC size
  [3] Datas total size
  [Datas
    [0] separator
    [1..ds] DataA
    [op] separator
    [op..ds] DataB
    [op] separator
    [op..ds] DataC
  ]
]

type
  TInfo = record
    SizeRefA : LongWord;
    SizeRefB : LongWord;
    NbKey    : LongWord;
  end;

  TInfoStr = record
    Sizes : array[0..3] of byte;
    Datas : record
      __s0  : char;
      DataA : array of char;
      __s1  : char;
      DataB : array of char;
      __s2  : char;
      DataC : array of char;
    end;
  end;

procedure ReadInfoStrFromStream(Stream: TStream; var InfoStr: TInfoStr);
begin
  Stream.ReadBuffer(InfoStr.Sizes, 4);
  SetLength(InfoStr.Datas.DataA, InfoStr.Sizes[0]);
  SetLength(InfoStr.Datas.DataB, InfoStr.Sizes[1]);
  SetLength(infoStr.Datas.DataC, InfoStr.Sizes[2]);
  Stream.ReadBuffer(InfoStr.Datas, InfoStr.Sizes[3]);
end;

procedure WriteInfoStrToStream(Stream: TStream; const InfoStr: TInfoStr);
begin

  Stream.WriteBuffer(InfoStr, InfoStr.Sizes[3]+4);
end;

procedure InfoStrToInfo(const InfoStr: TInfoStr; var Info: TInfo);
begin
  Info.SizeRefA := StrToInt(Copy(PChar(InfoStr.Datas.DataA), 0, InfoStr.Sizes[0]));
  Info.SizeRefB := StrToInt(Copy(PChar(InfoStr.Datas.DataB), 0, InfoStr.Sizes[1]));
  Info.NbKey    := StrToInt(Copy(PChar(InfoStr.Datas.DataC), 0, InfoStr.Sizes[2]));
end;

procedure InfoToInfoStr(const Info: TInfo; var InfoStr: TInfoStr);
var SA,SB,SK: string;
begin
  InfoStr.Datas.__s0 := '|';
  InfoStr.Datas.__s1 := '-';
  InfoStr.Datas.__s2 := '-';

  SA := IntToStr(Info.SizeRefA);
  SB := IntToStr(Info.SizeRefB);
  SK := IntToStr(Info.NbKey);

  with InfoStr do
  begin
    Sizes[0] := Length(SA);
    Sizes[1] := Length(SB);
    Sizes[2] := Length(SK);
    Sizes[3] := Sizes[0]+Sizes[1]+Sizes[2]+3;

    SetLength(Datas.DataA, Sizes[0]);
    SetLength(Datas.DataB, Sizes[1]);
    SetLength(Datas.DataC, Sizes[2]);

    move(SA[1], Datas.DataA[0], Sizes[0]);
    move(SB[1], Datas.DataB[0], Sizes[1]);
    move(SK[1], Datas.DataC[0], Sizes[2]);
  end;
end;

hihihi

<hr size="2" width="100%" />
0
f0xi Messages postés 4205 Date d'inscription samedi 16 octobre 2004 Statut Modérateur Dernière intervention 12 mars 2022 35
1 mai 2008 à 20:44
pffff que de code pour 3x4 octets de données :)

<hr size="2" width="100%" />
0
f0xi Messages postés 4205 Date d'inscription samedi 16 octobre 2004 Statut Modérateur Dernière intervention 12 mars 2022 35
1 mai 2008 à 20:55
       Form1.PatternMidi.Add_Instrument(Instrument.Instrument,Instrument.Channel,Instrument.Note);
With Form1.PatternMidi Do
Begin
  Instruments[CountInstr-1].Active:=Instrument.Active;
  Instruments[CountInstr-1].Volume:=Instrument.Volume;
  Instruments[CountInstr-1].Velocity:=Instrument.Velocity;
           Instruments[CountInstr-1].PitchBend:=Instrument.PitchBend;
           Instruments[CountInstr-1].ChannelPressure:=Instrument.ChannelPressure;
           Instruments[CountInstr-1].Modulation:=Instrument.Modulation;
           Instruments[CountInstr-1].PortamentoTime:=Instrument.PortamentoTime;
           Instruments[CountInstr-1].PortamentoSwitch:=Instrument.PortamentoSwitch;
           Instruments[CountInstr-1].PortamentoNote:=Instrument.PortamentoNote;
           Instruments[CountInstr-1].Resonance:=Instrument.Resonance;
           Instruments[CountInstr-1].Pan:=Instrument.Pan;
           Instruments[CountInstr-1].Expression:=Instrument.Expression;
           Instruments[CountInstr-1].Sustain:=Instrument.Sustain;
           Instruments[CountInstr-1].Reverb:=Instrument.Reverb;
         End;



attention ! pas d'utilisation directe des variables de fiches!
seul Delphi lui même a le droit de les utiliser en interne!

soit tu passe une reference de la fiche en parametres (si en dehors de la fiche elle même) :
(FormSender : TForm)
soit tu utilise Self.

ensuite pour l'allocation des instruments :

Self.PatternMidi.Add_Instrument(Instrument.Instrument,Instrument.Channel,Instrument.Note);

With Self.PatternMidi Do
  Move(Instruments[CountInstr-1], Instrument, SizeOf(TInstrument));

mais j'ai l'impression que la encore, le francky code a encore frapper...

AddInstrument ne devrait t'il pas prendre en parametres un TInstrument ? ou alors overloader ce Add en version
parametres par parametres et version TInstrument ?
ce qui eviterai de se taper a chaque fois ce nombre improbable d'allocation de valeur ?

PatternMidi.Add(Instrument: ...; Channel: ...; Note: ...); overload;
PatternMidi.Add(Instrument: TInstrument); overload;

on pourrait encore transformer TInstrument en TPersistent pour qu'il contienne des methodes et evenements propre a lui même et surtout la trop fameuse methode Assign / AssignTo ...

<hr size="2" width="100%" />
0
Utilisateur anonyme
1 mai 2008 à 21:24
Pour l'appel des fiches : Il s'agit juste d'un test que je réalisais. Dans le projet les choses sont un peu différentes .
Pour la procedure Add_Instrument : en fait j'ai fais un pattern style Fruity Loops . Le but est de pouvoir rajouter un instrument dans cette pattern. L'ajout se fait via des valeurs par défauts qui seront modifiables. Donc pas besoin de définir un TInstrument avec ces 150 propriétés puis de faire un


Add(Instrument: TInstrument). Par contre je suis obligé de définir la valeur de la note car pour les percussions, chaque note correspond à une percussion données (Alors que pour un piano par exemple, chaque note correspond à la note lol). Idem pour le channel car par défaut le channel des percussions est définit à 10. Le midi est assez tortueux, pour etre honnette.

Ce projet est un peu complexe : j'en suis pas encore à la phase de finalisation mais de conception donc si il y a des maladresses c'est normal. Une fois finit j'aurais suffisamment de recul pour le remanier comme il faut t'inquete pas .
0
f0xi Messages postés 4205 Date d'inscription samedi 16 octobre 2004 Statut Modérateur Dernière intervention 12 mars 2022 35
1 mai 2008 à 23:57
houla, remanie a fur et a mesure!

000 n+1
010 nouvelle fonctionnalitée ? 080 : 020 [si non : si oui]
020 corrections
030 tests ? 020 : 040
040 ameliorations Alpha 
050 tests ? 040 : 060
060 optimisations Alpha
070 tests ? 060 : 010
080 ameliorations globale Beta
090 tests ? 080 : 100
100 optimisations globale Beta
110 tests ? 100 : 120
120 Release Candidate RCn ? 000 : 130
130 Stable release

sinon ce que tu fait c'est :

000 caféine-overdosator
010 repeat 150 nouvelles fonctionnalitées
020 test ? c'est quoi toutes ces lignes de codes ?
030 release pourrave, changer de cerveau ? Y/N

<hr size="2" width="100%" />
0
f0xi Messages postés 4205 Date d'inscription samedi 16 octobre 2004 Statut Modérateur Dernière intervention 12 mars 2022 35
2 mai 2008 à 00:46
et puis quand tu pense un composant, pense "simple".

simple = organisation papier au préalable

simple = simulation papier du composant

simple = structure
simple = hierarchie
simple = un objet, une tache

les objets multi-fonction sont trop chiant a stabiliser et plus difficile a manipuler.

faudrait que tu test la demo de SimSynth  pour te rendre compte comment tout ça fonctionne ensemble, qu'il faut bien séparer tout ça.

Rendus : DirectSound, Asio etc
Message/Controllers : propre au protocol VST/DXi/ReWire/Midi, propre au programme
Instrumentisation : VST, DXi, ReWire, Midi
Instrument : Sound generator, SoundFont, Midi, FM, Wave etc
Sequencer : nombre des patterns, tempo, evenements
Pattern : durée, notes, evenements
Playlist : organisation, ordre des patterns, evenements

ce qui donne a peu prés :

[Sequencer] O-----------+ <<----------------------------+
 |                      |                               |
 +-->[PlayList] O-------+ <<----------------------------+
      |                 |                               |
      +-->[Patterns] O--+ <<----------------------------+
                        |                               |
                        +-->[messages/controlers]--+    |
                                                   |    |
      [Instrumentisation]<-------------------------+ <<-+
       |                                                |
       +-->{IN} [Instrument] {OUT}---+                  |
                                     |                  |
  [Mixer]<---------\                 |                  |
                   |                 |                  |
  [Sortie audio]<--\--[rendus]<------+                  |
                   |                 |                  |
  [Codec audio]<---\                 |                  |
                                     |                  |
       +-------[Instrumentisation]<--+                  |
       |                                                |
       +--->[messages/controllers]----------------------+
                       

<hr size="2" width="100%" />
0
L_art_ment Messages postés 302 Date d'inscription vendredi 21 septembre 2007 Statut Membre Dernière intervention 6 février 2013
2 mai 2008 à 08:34
         J'savais que lire un topic posté par Francky de bon matin serai nocif pour ma santé... J'retourne me couché...
0
Rejoignez-nous