Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 4
0
 public UkuleleService(INoteService noteService, IStringInstrumentService frettedLuteInstrumentService)
 {
     NoteService = noteService;
     FrettedLuteInstrumentService = frettedLuteInstrumentService;
 }