Skip to content

I can not get notes with this code #308

Discussion options

You must be logged in to vote

Visual Studio has the clear message about what's going on: there is Note class in both namespaces - Melanchall.DryWetMidi.Interaction and Melanchall.DryWetMidi.MusicTheory. If you search the error (c# is an ambiguous reference between), you'll find that it's a common situation in .NET world and there are several ways to resolve it.

In your short example you can just write:

IEnumerable<Melanchall.DryWetMidi.Interaction.Note> notes = file.GetNotes();

or

var notes = file.GetNotes();

or

using InteractionNote = Melanchall.DryWetMidi.Interaction.Note;

...

IEnumerable<InteractionNote> notes = file.GetNotes();

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@2311627BorisBacic
Comment options

@2311627BorisBacic
Comment options

@melanchall
Comment options

Answer selected by melanchall
Comment options

You must be logged in to vote
2 replies
@melanchall
Comment options

@2311627BorisBacic
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Just question about the library
2 participants