syntax = "proto2";

import "google/protobuf/descriptor.proto";

package midi;

extend google.protobuf.FieldOptions {
  optional int32 maxval = 50001;
  optional int32 minval = 50002;
  optional float fmaxval = 50003;
  optional float fminval = 50004;
}

message ContinuousFeature {
  optional float av_polyphony = 1;
  optional float av_silence = 2;
  optional float note_duration = 3;
  optional float note_duration_norm = 4;
}

message TrackFeatures {
  optional int32 min_pitch = 1;
  optional int32 max_pitch = 2;
  optional float av_polyphony = 3;
  optional int32 note_density = 4;
  optional int32 note_density_v2 = 5;
  optional int32 max_polyphony = 6;
  optional bool should_prune = 7;
  optional int32 order = 8;
  optional float note_duration = 9;
  optional string genre_str = 10;
  optional int32 min_polyphony_q = 11;
  optional int32 max_polyphony_q = 12;
  optional int32 min_note_duration_q = 13;
  optional int32 max_note_duration_q = 14;
  repeated int32 polyphony_distribution = 15;
  optional float note_density_value = 16;
}

message Note {
  optional int32 start = 1;
  optional int32 end = 2;
  optional int32 pitch = 3;
}

message ValidTrack {
  repeated int32 tracks = 1;
}

message Dataset {
  message Item {
    required uint64 start = 1;
    required uint64 end = 2;
    required uint64 src_size = 3;
  }
  repeated Item train = 1;
  repeated Item valid = 2;
  repeated Item test = 3;
}

message ModelMetadata {
  optional string encoder = 1;
  optional int32 num_layers = 2;
  optional int32 num_heads = 3;
  optional int32 num_hidden = 4;
  optional int32 model_dim = 5;
  optional bool new_state = 6;
}

message GenreData {
  optional string discogs = 1;
  optional string lastfm = 2;
  optional string tagtraum = 3;
}