I am having a hard time understanding what exactly it means to be playing in a certain mode of a scale. I will try to pose my question in mathematical terms.
A given key has a set of notes, for example, the set of notes for the key of C would be:
key_c = {C, D, E, F, G, A, B}
I use the term set because order does not matter, and repetition is not allowed. That is to say, if one were to collect all of the notes they have played in the key of C and remove redundancy, assuming at some point they have played every note in the key, the set of notes will be reduced to the set above.
My understanding thus far is that to understand modes one must take order into account. Instead of using sets to define modes, I will use sequences.
Ionian = [C, D, E, F, G, A, B]
Dorian = [D, E, F, G, A, B, C]
Phrygian = [E, F, G, A, B, C, D]
Lydian = [F, G, A, B, C, D, E]
Mixolydian = [G, A, B, C, D, E, F]
Aeolian = [A, B, C, D, E, F, G]
Locrian = [B, C, D, E, F, G, A]
This post stated it as "the base note of an ascending sequence" is shifting one at a time along the key.
I understand this concept in theory, but what confuses me is how this works in practice. If a set of notes in a given riff all amounts to the same set of notes in the key, how can one tell what mode one is playing in?
One way that I have heard of it being described is that one is playing in a given mode if their phrasing is centered around the base note of that mode. I am not entirely sure what this means, but what it sounds like is where a riff starts and ends.
In that respect, it is easy to see how if one simply plays a Phrygian scale in ascending order over and over, they are playing in the Phrygian mode. But what if a riff starts on a D and ends on an E? Is that riff in Dorian or Phrygian? Or is it about the frequency of notes played? If the most frequently occurring note in a riff is G, does that make it in Mixolydian?
I guess I am looking for mathematical terms for how it is defined to be playing in a given mode, but perhaps it is not something strictly defined?