How to get the max value of an array?
I tried to write a ksy file for the ProTracker mod file format. The problem is, that the number of patterns depends on the maximum value stored in the pattern sequence (`song_info.positions`).

Either a `max(array)` function or a way to filter/map/aggregate arrays would be nice. Another way to solve the problem would be the ability to pass arguments to `instances` functions.

This is what I have:

```yml
meta:
  id: mod_protracker
  file-extension: mod
  endian: be
  encoding: ISO-8859-1
seq:
  - id: header
    type: header
  - id: sample_infos
    type: sample_info
    repeat: expr
    repeat-expr: 31
  - id: song_info
    type: song_info
    size: 130
  - id: id
    contents: 'M.K.'
  - id: patterns
    type: pattern
    
types:
  header:
    seq:
      - id: song_name
        type: strz
        size: 20
  sample_info:
    seq:
      - id: sample_name
        type: strz
        size: 22
      - id: sample_words
        type: u2
      - id: reserved
        type: b4
      - id: finetune_signed_4
        type: b4
      - id: volume
        type: u1
      - id: repeat_offset_word
        type: u2
      - id: repeat_length_word
        type: u2
    instances:
      sample_length:
        value: sample_words * 2
      repeat_offset:
        value: repeat_offset_word * 2
      repeat_length:
        value: repeat_length_word == 1 and repeat_offset_word == 0 ? 0 : repeat_length_word * 2
      finetune:
        value: (finetune_signed_4 & 0x7) - (finetune_signed_4 & 0x8)
  song_info:
    seq:
      - id: song_length
        type: u1
      - id: restart_position
        type: u1
      - id: positions
        type: u1
        repeat: expr
        repeat-expr: song_length
  pattern_entry:
    seq:
      - id: upper_sample_nr
        type: b4
      - id: period
        type: b12
      - id: lower_sample_nr
        type: b4
      - id: effect_id
        type: b4
      - id: effect_value
        type: u1
    instances:
      sample_nr:
        value: ((upper_sample_nr << 4) + lower_sample_nr)
  pattern_line:
    seq:
      - id: entries
        type: pattern_entry
        repeat: expr
        repeat-expr: 4
  pattern:
    seq:
      - id: lines
        type: pattern_line
        repeat: expr
        repeat-expr: 64
```
