metadata.py (1772B)
1 # File: metadata.py 2 # Created Date: Wednesday April 12th 2023 3 # Author: Steven Atkinson ([email protected]) 4 5 """ 6 Metadata about models 7 """ 8 9 from enum import Enum as _Enum 10 from typing import Optional as _Optional 11 12 from pydantic import BaseModel as _BaseModel 13 14 15 # Note: if you change this enum, you need to update the options in easy_colab.ipynb! 16 class GearType(_Enum): 17 AMP = "amp" 18 PEDAL = "pedal" 19 PEDAL_AMP = "pedal_amp" 20 AMP_CAB = "amp_cab" 21 AMP_PEDAL_CAB = "amp_pedal_cab" 22 PREAMP = "preamp" 23 STUDIO = "studio" 24 25 26 # Note: if you change this enum, you need to update the options in easy_colab.ipynb! 27 class ToneType(_Enum): 28 CLEAN = "clean" 29 OVERDRIVE = "overdrive" 30 CRUNCH = "crunch" 31 HI_GAIN = "hi_gain" 32 FUZZ = "fuzz" 33 34 35 class Date(_BaseModel): 36 year: int 37 month: int 38 day: int 39 hour: int 40 minute: int 41 second: int 42 43 44 class UserMetadata(_BaseModel): 45 """ 46 Metadata that users provide for a NAM model 47 48 :param name: A "human-readable" name for the model. 49 :param modeled_by: Who made the model 50 :param gear_type: Type of gear. 51 :param gear_make: Make of the gear. 52 :param gear_model: Model of the gear. 53 :param tone_type: What sort of tone the gear has. 54 :input_level_dbu: What analog loudness, in dBu, corresponds to 0 dbFS input to the 55 model. 56 :output_level_dbu: What analog loudness, in dBu, corresponds to 0 dbFS outputted by 57 the model. 58 """ 59 60 name: _Optional[str] = None 61 modeled_by: _Optional[str] = None 62 gear_type: _Optional[GearType] = None 63 gear_make: _Optional[str] = None 64 gear_model: _Optional[str] = None 65 tone_type: _Optional[ToneType] = None 66 input_level_dbu: _Optional[float] = None 67 output_level_dbu: _Optional[float] = None