1

I am working on the VST3 preset format. This is what I managed till now:

meta:
  id: vstpreset
  file-extension: vstpreset
  endian: le
seq:
  - id: magic
    contents: 'VST3'
  - id: version
    type: u4
  - id: class_id
    type: str
    size: 32
    encoding: ASCII
  - id: ofs_chunk_list
    type: u8
instances:
  chunk_list:
    pos: ofs_chunk_list
    type: chunk_list
    size-eos: true
types:
  chunk:
    seq:
      - id: blob
        size-eos: true
  chunk_list:
    seq:
      - id: magic
        contents: 'List'
      - id: len_entries
        type: u4
      - id: entries
        repeat: expr
        repeat-expr: len_entries
        type: entry
    types:
      entry:
        seq:
          - id: id
            type: u4
          - id: offset
            type: u8
          - id: length
            type: u8
        instances:
          chunk:
            io: _root._io
            pos: offset
            size: length

This kind of works; however, I cannot figure out how to implement the section labelled DATA AREA in the illustration shown in the link above. Isn't it kinda unintuitive to store the CHUNK LIST after the DATA AREA?

demberto
  • 489
  • 5
  • 15
  • I guess you may not want to "implement" it (it is possible to create a field for it and reuse its `_io` if you want stricter bounds checking, hut it will cause memory overhead of the size of that area in the current versions of KS runtimes) at all, it seems `entry.chunk` should do the job well. – KOLANICH Dec 05 '21 at 10:06

0 Answers0