| 1 | <?php |
||
| 9 | abstract class InstrumentBase implements InstrumentInterface |
||
| 10 | { |
||
| 11 | protected $defaultStopLength; |
||
| 12 | |||
| 13 | private $stringFrequencies = []; |
||
| 14 | private $stringLength; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Violin constructor. |
||
| 18 | * |
||
| 19 | * @param array|null $stringFrequencies |
||
| 20 | * @param float $stringLength |
||
| 21 | */ |
||
| 22 | public function __construct(array $stringFrequencies = null, float $stringLength = null) |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @return string[] The default strings of the instrument, as note names |
||
| 39 | * (e.g. 'A4', 'D3'). |
||
| 40 | */ |
||
| 41 | abstract protected function getDefaultNames(): array; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return float The default vibrating string length of the instrument (mm). |
||
| 45 | */ |
||
| 46 | abstract protected function getDefaultStringLength(): float; |
||
| 47 | |||
| 48 | /** |
||
| 49 | * {@inheritdoc} |
||
| 50 | */ |
||
| 51 | public function getStringFrequencies(): array |
||
| 55 | |||
| 56 | /** |
||
| 57 | * {@inheritdoc} |
||
| 58 | */ |
||
| 59 | public function getStringLength(): float |
||
| 63 | } |
||
| 64 |