public IStringInstrument Custom([FromServices] IStringInstrumentService service, [FromServices] INoteService noteService, string notes, int semiToneCount, string name) { var realNotes = notes.Split(',').Select(t => noteService.GetNoteByName(t)).ToArray(); var instrument = service.CreateInstrument <StringInstrument>(semiToneCount, realNotes); instrument.Name = name; return(instrument); }
public IUkulele Custom([FromServices] IStringInstrumentService flus, [FromServices] INoteService noteService, int fretCount, string notes) { var splittedNotes = notes.Split(','); var openStrings = splittedNotes.Select(n => noteService.GetNoteByName(n)).ToArray(); var guitar = flus.CreateInstrument <Ukulele>(fretCount, openStrings); return(guitar); }
public IStringInstrumentChord Chord( [FromServices]INoteService noteService, [FromServices]IStringInstrumentService stringInstrumentService, [FromServices]IStringInstrumentChordService stringInstrumentChordService, string stringNotes, int semiToneCount, string root, Chords type) { var sn = stringNotes .Split(',') .Select(noteName => noteService.GetNoteByName(noteName)) .ToArray(); var rootNote = noteService.GetNoteByName(root); var instrument = stringInstrumentService.CreateInstrument<StringInstrument>(semiToneCount, sn); var ret = stringInstrumentChordService.GetChord(instrument, rootNote, type); return ret; }
public UkuleleService(INoteService noteService, IStringInstrumentService frettedLuteInstrumentService) { NoteService = noteService; FrettedLuteInstrumentService = frettedLuteInstrumentService; }