Generate random instrument names with the help of fzaninotto/Faker.
Names of instruments were pulled and parsed from MusicBrainz.
composer.json:
"require": {
"etelford/faker-instrument-names": "*"
}
Make an instance of Faker
and an instance of the InstrumentFaker
, add it as a provider and call the instrument method you want.
$faker = \Faker\Factory::create();
$generator = new \Etelford\InstrumentFaker($faker);
$faker->addProvider($generator);
// Get a random instrument name
echo $faker->instrument;
// Get a random wind instrument name
echo $faker->windInstrument;
// Get a random string instrument name
echo $faker->stringInstrument;
// Get a random percussion instrument name
echo $faker->percussionInstrument;
// Get a random electronic instrument name
echo $faker->electronicInstrument;