sugarlabs / musicblocks

Music Blocks -- A musical microworld
https://musicblocks.sugarlabs.org/
GNU Affero General Public License v3.0
583 stars 810 forks source link

Proposal for changes to Set Key #832

Closed pikurasa closed 6 years ago

pikurasa commented 7 years ago

I have been thinking a lot about the system that we have. Where I am at right now is that I think we should consider:

Having "Set Key" by itself not change any of the notes. This would be similar to our "set meter" block and would be very similar to how a key signature works for standard notation**.

How it works

If a transposition to a particular key is desired, a user could use one of the mode names, but inside of a transpose block. The default, when no "set key" blocks are before a transposition block with a mode name, would be to assume transposing from c major (or its respective modes). However, if a "set key" block is before a transposition block with a different mode name the transposition would be made from the "set key" block's mode to the transposition block's mode.

**Another idea that would give the "set key" block the same usefulness of standard notation: When "set key" block is in a stack--or perhaps just clicked--there could be some conveniences for selecting the sharps/flats that are in that key/mode. For example, if we are "in E major"--with a "set key" block set to "E major"--and we use, somewhere later in the stack, a transpose block with the key of "B major" it would transpose everything within the said transpose clamp up a major 5th.

So what is the issue as I see it? Why consider a change?

I think the current design conflates the empirical with the analytical. The proposed design teases the two apart with some added conveniences and functionality.

walterbender commented 7 years ago

I am not sure I understand what you are suggesting. Can you write some pseudo code with the expected output?

pikurasa commented 7 years ago

...would just play the same pitches (C#4, ti3, re#4, mi4); no modification of pitches. Perhaps when we are in an "e major" stack, or when the set key block is clicked with "e major" argument, then the dropdown gives "e major" pitches by default (i.e. e, f#, g#, a, b, c#, D#).

start transposition = e major { note value = 1/4 la4 note value = 1/4 sol4 note value = 1/4 ti4 note value = 1/4 do5 }

...would transpose from C major (since no "set key" block is above in the stack, it assumes C major) to E major. The result is C#5, ti4, re#5, mi5. All the pitches have been transposed up a major third, which is closest distance from C to E.

start set key = e major transposition = e major { note value = 1/4 do#4 note value = 1/4 ti3 note value = 1/4 re#4 note value = 1/4 mi4 } %NOTE: still at "set key = e major" transposition = c major { note value = 1/4 do#4 note value = 1/4 ti3 note value = 1/4 re#4 note value = 1/4 mi4 }

The resulting pitches would be: C#4, ti3, re#4, mi4, la3, sol3, ti3, c4

walterbender commented 7 years ago

I guess I don't understand what the point of the set key block is in this design. It seems that what it was the functionality of the set key block is now the transpose key instead and the set key doesn't really do anything.

pikurasa commented 7 years ago

I guess I don't understand what the point of the set key block is in this design. It seems that what it was the functionality of the set key block is now the transpose key instead and the set key doesn't really do anything.

Well, it could do something that I propose in description above: It could make finding the notes in the key more convenient by changing the default notes in the pitch dropdown. I suppose this would be after it is clicked, but we can discuss choices.

One could argue that a key signature in a score also does not "do anything"--it just indicates that certain pitches should be read as sharp or flat unless otherwise indicated by a natural symbol. The fact that a key signature does not actively do anything to the pitches is actually nice for many reasons (time signature does not "do anything" either in a score)** The key signature is more an analytical tool than "a verb".

That being said, being able to transpose to other keys is also helpful, so I propose that be done with the transpose block. The combination of the two is also nice--somewhat analogous to instruments that are in other keys(e.g. a Bb instrument would be "set key" = C major with transpose = "Bb major"; one could get even more complex by showing/performing relationships between instruments in varying keys)

**Maybe the best analogy is to meter. Our design with meter is nice because choosing a meter does not affect where the rhythms lie within the measures, but acts as a framework for other things to be done (e.g. do this on 1 and 4). It is good to have this separated into two steps.

Does this make better sense?

pikurasa commented 7 years ago

This short piece by Bach is deceptively complex. This is an analysis that I wrote up just now (mostly harmonic and key, but other aspects are annotated as well) and even this is a simplified analysis of what could be done, just to show the broadest strokes: Bouree-BWV-996-Bach-Analysis.pdf

In particular measures 7, 15, and 20 seem to be in "two keys at once". When the listener first hears the first beat of each of those measures, they would probably say they are in the previous key (key analysis is notated in the PDF). However, upon hearing the next chord, they would probably say they are in the new key (or at least very much visiting it) as the proceeding chords defy the expectations of the previous key.

So one might say, "Okay, music is complex--so what? You figured out which key labels to give each section, so what does it matter. Just tell MB which key each of those sections is and we are done."

But the problem with this is:

Basically, I would like empirical first and then analysis.

It kind of feels like we are asking the user to choose the name of a set of colors before painting.

A notated lilypond score with "play by play" for voice leading.

% Bourreé in E minor
\version "2.12.3"

\header {
  title = "Bourrée in E Minor"
  composer = "J. S. Bach"
  mutopiacomposer = "BachJS"
  opus = "BWV996"
  date = "1700s"
  style = "Baroque"
  instrument = "Lute or Lute-Harpischord (Lautenwerk)"
  copyright = "Public Domain"
  source = "Band I: J.S. Bach: Compositionen für die Laute, Denkmäler alter Lautenkunst Wolfenbüttel: Julius Zwißlers Verlag, 1921. Plate Band I. (among other sources)"
  maintainer = "Rudy Matela"
  % with contributions and corrections from:
  %   Thomas Scharkowski
  %   Paul Umfahrer-Vass
  maintainerEmail = "rudy [dot] matela [at] gmail [dot] com"
  maintainerWeb = "http://matela.com.br/"
  moreInfo = "Other Public Domain Sheet Music: http://imslp.org/wiki/Lute_Pieces,_BWV_995-1000_(Bach,_Johann_Sebastian)"

 footer = "Mutopia-2011/04/01-1743"
 tagline = \markup { \override #'(box-padding . 1.0) \override #'(baseline-skip . 2.7) \box \center-column { \small \line { Sheet music from \with-url #"http://www.MutopiaProject.org" \line { \teeny www. \hspace #-1.0 MutopiaProject \hspace #-1.0 \teeny .org \hspace #0.5 } • \hspace #0.5 \italic Free to download, with the \italic freedom to distribute, modify and perform. } \line { \small \line { Typeset using \with-url #"http://www.LilyPond.org" \line { \teeny www. \hspace #-1.0 LilyPond \hspace #-1.0 \teeny .org } by \maintainer \hspace #-1.0 . \hspace #0.5 Reference: \footer } } \line { \teeny \line { This sheet music has been placed in the public domain by the typesetter, for details see: \hspace #-0.5 \with-url #"http://creativecommons.org/licenses/publicdomain" http://creativecommons.org/licenses/publicdomain } } } }
}

% Up-Transposed
ut = {
  \change Staff = "down" \stemUp
}

% Up-Normal
un = {
  \change Staff = "up" \stemNeutral
}

% Down with Up-Transposed
dt = {
  \stemDown
}

% Down with Up-Neutral
dn = {
  \stemNeutral
}

% Each variable consists of 3 bars
% Each line consists of a bar

\parallelMusic #'(trebleA bassA) {
  e'8 fis |
  g8 fis |
  g4   fis8 e dis4   e8 fis |
  e4 a b a |
  b,4  cis8 dis e4   d8 c |
  g4 fis e fis |
  b4 \ut   a8 g fis4   g8 a |
  g4 \dt a b a |
  b8 a g fis e4  \un e'8 fis |
  g4 b  e,8 fis g fis |
  g4   fis8 e dis4   e8 fis |
  \dn e4 a b a |
  b,4   cis8 dis e4   d8 c |
  g4 fis e fis |
  b4 % is this the moment that g major starts? We have not heard anything yet to indicate anything other than e minor  
  \ut a8 % now it sounds like a different key; the previous beat's chord also seems to be reunderstood, but only /after/ hearing this beat
  g fis4.   g8 |
  g4  \dt c d d, | % yep, we are totally in G major -- are we going to stay here (no, because we repeat)
}

% These could be put inside the above parallel music, but it would fail the
% barcheck. The same happens with part "B"
trebleAend = { 2. \un }
bassAend = { g2. \dn }

\parallelMusic #'(trebleB bassB) {
  \ut b'8 g | % well, this time (after the first part repeats two times), we stay in g major
  \dt g4 |

  d'4   a8 c b4   \un g'8 d |
  fis4 d g b \dn |

  % 10th
  e4   b8 d c4  \ut b8 a |
  c4 gis % oh wait, this does not sound like g major anymore (why would we have a g# in g major? Is it a sharp tonic?)
  a \dt % maybe we are in a minor?
  d | 

  gis4 % g# again; makes me think a minor
  a8 b c4   b8 a |
  e4 a, e' e, |

  a2.  % finally, I am certain that we are in a minor right now; weren't we in g major?
  d8 a |
  a8 b a g  fis4  d |

  b4 \un   g'8 d e4   b8 d |
  g4 % sounds like g major again!
  b c \dn gis | % are we in a minor again?

  c4   a'8 e fis4   cis8 e |
  a4 % yes, I think we are in a minor
  cis d % why would we have a c# in a /minor/? Are we in D major?
  ais | % now I am really confused... an a# and a c# -- these have nothing to do with our previous keys.

  %15th bar
  d4   cis8 b ais4. \prall % oh, I get it...
  b8 |
  b4 e fis fis, |

  b2.  % ... we were going to b minor (the third chord from g major). Got a little g major, a minor, b minor thing going on
  b'8 fis |
  b8 ais b cis   dis4 % I thought this was b minor and now we have a d#?? This contradicts the D natural we had in the first beat of measure 15...
  b |

  gis4 % okay, well the d# led us to this e major chord very nicely, but what was it -- sounded like b minor, then "revealed" itself as b major (which, by the way, has little to do with g major--but /does/ have more to do with e minor... does that mean... we are headed back... back to e minor?)
  fis8 e a4   e8 g | % c# and g natural make me think d major...
  e4 d cis a |

  fis4    e8 d g4   d8 f | % f natural... like, give me a break, I thought this piece was in e minor... with musings to g major...
  d4 c b g |

  e4 % well, it did bring us to "c major"-ish sonority nicely
  a8 e fis4  cis8 % c# -- well, at this point I have just learned to expect the unexpected
  e |
  c4 b a fis |

  %20th bar
  dis4 b2 % here is our good ol' b major chord... now I really think we are headed back to e minor "once and for all"! I can just feel it -- b major as the dominant of e minor
  e8 b |
  b4.  c8 b a gis4 | % g# again... no I am certain we are going to e minor, regardless of "sharp tonics"

  c4   \stemUp d8 \ut a b4 % ...or the ii of I in g major
  c8 g |
  \dt a8 % whew, the g# resolves to a and c in upper voice, which sounds like the iv of i in e minor...
  e' fis4   g,8 dis' % d#! yep, sounds like e minor
  e4 |

  a4   b8 fis g4  fis8 e |
  fis,8 cis' dis4 % interesting voice leading here ( no c natural, c# comes from an f#)
  e, a |

  dis4   e8 fis g4   fis8 e |
  b4  a4  b2 | %well, the last two measures were straightforward cadence in e minor... finally.

}
trebleBend = { e2.  }
bassBend = { e,2.  }

treble = { 
  \repeat volta 2 { \trebleA \trebleAend }
  \repeat volta 2 { \trebleB \trebleBend }
}
bass = {
  \repeat volta 2 { \bassA \bassAend }
  \repeat volta 2 { \bassB \bassBend }
}

commands = {
  \key e \minor
  \time 2/2
  \partial 4
  \tempo 4=132
  % Do not output tempo marking on pdf
  \set Score.tempoHideNote = ##t
}

\score {
  \new PianoStaff <<
    \new Staff = "up" {
      \clef treble \commands 
      \new Voice \relative c { \partial 4 \treble %{\bar "|."%} }
    }
    \new Staff = "down" {
      \clef bass \commands
      \new Voice \relative c { \partial 4 \bass }
    }
  >>
  \layout{ }
  \midi{ }
}

pikurasa commented 7 years ago

With the current design, I cannot write music using a piece's specific pitches (indicate their sharps and/or flats) and use the current set key and get output that has the actual key unless the key happens to be C major.

That is why I changed the key by hand in the lilypond output for the "Simple Crab Canon" (below).

Our current design makes this impossible to do.

\version "2.18.2"

% ****************************************************************
% 
% WHAT IS THIS? -- This is a LilyPond file generated from Music
% Blocks software (Read about it at www.musicblocks.net).
% 
% DOWNLOAD LILYPOND -- In order to create notation with this file,
% you will need to download and install LilyPond software onto your
% computer (http://lilypond.org/download.html). Frescobaldi
% software is also handy for editing LilyPond files
% (http://frescobaldi.org/download).
% 
% LILYPOND INSTRUCTIONS -- For instructions on how to further
% manipulate musical notation using LilyPond software, please
% read the Introduction (http://lilypond.org/text-input.html) and
% the Manual
% (http://lilypond.org/doc/v2.18/Documentation/learning/index.html).
% 
% GLOSSARY -- A glossary with helpful examples may be found here
% (http://www.lilypond.org/doc/v2.19/Documentation/music-glossary/).
% 
% MUTOPIA -- You may also benefit from studying scores from the
% Mutopia Project website, which has freely sharable music notation
% generated with LilyPond (http://www.mutopiaproject.org/).
% 
% LILYBIN -- You can explore your Lilypond output in a web browser at
% (http://lilybin.com/).
% 
% COMMENTS -- Some of the code below is commented out. You can
% enable it by deleting the % that precedes the text or, in the
% case of a commented section, deleting the %{ and %} that surrounds
% the section.
% 
% ****************************************************************

% Please add your own name, the title of your musical creation,
% and the intended copyright below.
% The copyright is great for sharing (and re-sharing)!
% Read more about it here (http://creativecommons.org/licenses/by-sa/4.0/).
% Of course, you can use any copyright you like -- you made it!
\header {
   dedication = \markup {
      \abs-fontsize #8 \sans "Made with LilyPond and Music Blocks" \with-url #"http://walterbender.github.io/musicblocks/" {
         \abs-fontsize #8 \sans "(http://walterbender.github.io/musicblocks/)"
      }
   }
   title = "My Music Blocks Creation"
%   subtitle = "Subtitle"
%   instrument = "Instrument"
   composer = "Mr. Mouse"
%   arranger = "Arranger"
   copyright = "Mr. Mouse (c) 2017 -- CC-BY-SA"
   tagline = "Made from Music Blocks v.2.0"
   footer = \markup {
      \with-url #"http://walterbender.github.io/musicblocks/" "Made with Music Blocks Software v.2.0." Engraved on \simple #(strftime "%Y-%m-%d" (localtime (current-time)))
   }
   currentYear = \markup {
      \simple #(strftime "%Y" (localtime (current-time)))
   }
   copyTag =  " free to distribute, modify, and perform"
   copyType = \markup {
      \with-url #"http://creativecommons.org/licenses/by-sa/3.0/" "Creative Commons Attribution ShareAlike 3.0 (Unported) License "
   }
   copyright = \markup {
      \override #'(baseline-skip . 0 ) \right-column {
         \sans \bold \with-url #"http://musicblocks.net" {
            \abs-fontsize #9  "Music " \concat {
               \abs-fontsize #12 \with-color #white \char ##x01C0 \abs-fontsize #9 "Blocks "
            }
         }
      }
      \override #'(baseline-skip . 0 ) \center-column {
         \abs-fontsize #11.9 \with-color #grey \bold {
            \char ##x01C0 \char ##x01C0
         }
      }
      \override #'(baseline-skip . 0 ) \column {
         \abs-fontsize #8 \sans \concat {
            " Typeset using " \with-url #"http://www.lilypond.org" "LilyPond software " \char ##x00A9 " " \currentYear " by " \composer " " \char ##x2014 " " \footer
         }
         \concat {
            \concat {
               \abs-fontsize #8 \sans {
                  " " \copyType \char ##x2014 \copyTag
               }
            }
            \abs-fontsize #13 \with-color #white \char ##x01C0
         }
      }
   }
   tagline = ##f
}

% To change the meter make adjustments in the following section.
% You must also delete the % before \meter everywhere it appears below.
meter = {
%   \time 3/4
   \key f \minor
   \numericTimeSignature
%   \partial 4 
%   \tempo "Andante" 4=90
}

% You can change the MIDI instruments below to anything on logo list:
% (http://lilypond.org/doc/v2.18/documentation/notation/midi-instruments)

brown_rat = {
\meter
gis'2 g'2 c''2 f'2 gis'2 g'2 f'2 e'2 
g'4 gis'2 ais'2 c''2 cis''2 f''2 e''2 f''2 
r4 
}

brown_ratVoice = \new Staff \with {
   \clef "treble"
   instrumentName = "brown_rat"
   shortInstrumentName = "br"
   midiInstrument = "acoustic grand"

} { \clef "treble" \brown_rat }

mole = {
\meter
r4 f''2 e''2 f''2 cis''2 c''2 ais'2 gis'2 
g'4 e'2 f'2 g'2 gis'2 f'2 c''2 g'2 
gis'2  \bar "|."
}

moleVoice = \new Staff \with {
   \clef "treble"
   instrumentName = "mole"
   shortInstrumentName = "ml"
   midiInstrument = "acoustic grand"

} { \clef "treble" \mole }

\score {
   <<
      \brown_ratVoice
      \moleVoice

% GUITAR TAB SECTION
% Delete the %{ and %} below to include guitar tablature output.
%{
      \new TabStaff = "guitar tab" 
      <<
         \clef moderntab
         \context TabVoice = "brown_rat" \brown_rat
         \context TabVoice = "mole" \mole
      >>
%}

   >>
   \layout {}

% MIDI SECTION
% Delete the %{ and %} below to include MIDI output.
%{
\midi {
   \tempo 4=90
}
%}

}

% MUSIC BLOCKS CODE
% Below is the code for the Music Blocks project that generated logo Lilypond file.
%{

[[0,["start",{"collapsed":false,"xcor":0,"ycor":0,"heading":0,"color":10,"shade":50,"pensize":5,"grey":100}],105.75000000000001,105.75000000000001,[null,33,null]],
[1,["newnote",{}],542.2500000000001,366.75,[176,25,24,11]],
[2,["number",{"value":2}],723.9711914062501,398.25,[25]],
[3,["pitch",{}],555.7500000000001,429.75,[24,4,5,null]],
[4,["solfege",{"value":"sol"}],629.2500000000001,429.75,[3]],
[5,["number",{"value":4}],629.2500000000001,461.25,[3]],
[6,["newnote",{}],542.2500000000001,524.25,[11,28,27,12]],
[7,["number",{"value":2}],723.9711914062501,555.75,[28]],
[8,["pitch",{}],555.7500000000001,587.25,[27,9,10,null]],
[9,["solfege",{"value":"do"}],629.2500000000001,587.25,[8]],
[10,["number",{"value":5}],629.2500000000001,618.75,[8]],
[11,["hidden",{}],542.2500000000001,524.25,[1,6]],
[12,["hidden",{}],542.2500000000001,681.75,[6,41]],
[13,["action",{"collapsed":false}],528.7500000000001,105.75000000000001,[null,14,30,null]],
[14,["text",{"value":"part1"}],623.2500000000001,114.75000000000001,[13]],
[15,["action",{"collapsed":false}],740.2500000000001,105.75,[null,16,31,null]],
[16,["text",{"value":"part2"}],834.7500000000001,114.75,[15]],
[17,["nameddo",{"value":"part1"}],119.25000000000001,177.75,[33,18]],
[18,["nameddo",{"value":"part2"}],119.25000000000001,209.25,[17,37]],
[19,["nameddo",{"value":"part1"}],344.25000000000006,209.25,[22,20]],
[20,["nameddo",{"value":"part2"}],344.25000000000006,240.75,[19,null]],
[21,["backward",{}],330.75000000000006,177.75,[35,22,32]],
[22,["hidden",{}],344.25000000000006,209.25,[21,19]],
[23,["start",{"collapsed":false,"xcor":0,"ycor":0,"heading":0,"color":20,"shade":50,"pensize":5,"grey":100}],317.25000000000006,105.75000000000001,[null,35,null]],
[24,["vspace",{}],555.7500000000001,398.25,[1,3]],
[25,["divide",{}],638.4711914062501,366.75,[1,26,2]],
[26,["number",{"value":1}],723.9711914062501,366.75,[25]],
[27,["vspace",{}],555.7500000000001,555.75,[6,8]],
[28,["divide",{}],638.4711914062501,524.25,[6,29,7]],
[29,["number",{"value":1}],723.9711914062501,524.25,[28]],
[30,["hidden",{}],542.2500000000001,146.25,[13,168]],
[31,["hidden",{}],753.7500000000001,146.25,[15,88]],
[32,["hidden",{}],330.75000000000006,303.75,[21,39]],
[33,["right",{}],119.25000000000001,146.25,[0,34,17]],
[34,["number",{"value":180}],192.75,146.25,[33]],
[35,["right",{}],330.75000000000006,146.25,[23,36,21]],
[36,["number",{"value":180}],404.25000000000006,146.25,[35]],
[37,["right",{}],119.25000000000001,240.75,[18,38,null]],
[38,["number",{"value":180}],192.75,240.75,[37]],
[39,["right",{}],330.75000000000006,303.75,[32,40,null]],
[40,["number",{"value":180}],404.25000000000006,303.75,[39]],
[41,["newnote",{}],542.2500000000001,681.75,[12,42,45,49]],
[42,["divide",{}],638.4711914062501,681.75,[41,43,44]],
[43,["number",{"value":1}],723.9711914062501,681.75,[42]],
[44,["number",{"value":2}],723.9711914062501,713.25,[42]],
[45,["vspace",{}],555.7500000000001,713.25,[41,46]],
[46,["pitch",{}],555.7500000000001,744.75,[45,47,48,null]],
[47,["solfege",{"value":"fa"}],629.2500000000001,744.75,[46]],
[48,["number",{"value":4}],629.2500000000001,776.25,[46]],
[49,["hidden",{}],542.2500000000001,839.25,[41,60]],
[50,["newnote",{}],542.2500000000001,1059.7499999999998,[68,51,54,58]],
[51,["divide",{}],638.4711914062501,1059.7499999999998,[50,52,53]],
[52,["number",{"value":1}],723.9711914062501,1059.7499999999998,[51]],
[53,["number",{"value":2}],723.9711914062501,1091.2499999999998,[51]],
[54,["vspace",{}],555.7500000000001,1091.2499999999998,[50,55]],
[55,["pitch",{}],555.7500000000001,1122.7499999999998,[54,56,57,null]],
[56,["solfege",{"value":"sol"}],629.2500000000001,1122.7499999999998,[55]],
[57,["number",{"value":4}],629.2500000000001,1154.2499999999998,[55]],
[58,["hidden",{}],542.2500000000001,1217.2499999999998,[50,70]],
[59,["flat",{}],555.7500000000001,902.25,[64,65,69]],
[60,["newnote",{}],542.2500000000001,839.25,[49,61,64,68]],
[61,["divide",{}],638.4711914062501,839.25,[60,62,63]],
[62,["number",{"value":1}],723.9711914062501,839.25,[61]],
[63,["number",{"value":2}],723.9711914062501,870.75,[61]],
[64,["vspace",{}],555.7500000000001,870.75,[60,59]],
[65,["pitch",{}],569.2500000000001,933.75,[59,66,67,null]],
[66,["solfege",{"value":"la"}],642.7500000000001,933.75,[65]],
[67,["number",{"value":4}],642.7500000000001,965.25,[65]],
[68,["hidden",{}],542.2500000000001,1059.7499999999998,[60,50]],
[69,["hidden",{}],555.7500000000001,1028.2499999999998,[59,null]],
[70,["newnote",{}],542.2500000000001,1217.2499999999998,[58,71,74,78]],
[71,["divide",{}],638.4711914062501,1217.2499999999998,[70,72,73]],
[72,["number",{"value":1}],723.9711914062501,1217.2499999999998,[71]],
[73,["number",{"value":2}],723.9711914062501,1248.7499999999998,[71]],
[74,["vspace",{}],555.7500000000001,1248.7499999999998,[70,75]],
[75,["pitch",{}],555.7500000000001,1280.2499999999998,[74,76,77,null]],
[76,["solfege",{"value":"fa"}],629.2500000000001,1280.2499999999998,[75]],
[77,["number",{"value":4}],629.2500000000001,1311.7499999999998,[75]],
[78,["hidden",{}],542.2500000000001,1374.7499999999998,[70,79]],
[79,["newnote",{}],542.2500000000001,1374.7499999999998,[78,80,83,87]],
[80,["divide",{}],638.4711914062501,1374.7499999999998,[79,81,82]],
[81,["number",{"value":1}],723.9711914062501,1374.7499999999998,[80]],
[82,["number",{"value":2}],723.9711914062501,1406.2499999999998,[80]],
[83,["vspace",{}],555.7500000000001,1406.2499999999998,[79,84]],
[84,["pitch",{}],555.7500000000001,1437.7499999999998,[83,85,86,null]],
[85,["solfege",{"value":"mi"}],629.2500000000001,1437.7499999999998,[84]],
[86,["number",{"value":4}],629.2500000000001,1469.2499999999998,[84]],
[87,["hidden",{}],542.2500000000001,1532.2499999999998,[79,null]],
[88,["newnote",{}],753.7500000000001,146.25,[31,89,92,96]],
[89,["divide",{}],849.9711914062501,146.25,[88,90,91]],
[90,["number",{"value":1}],935.4711914062501,146.25,[89]],
[91,["number",{"value":4}],935.4711914062501,177.75,[89]],
[92,["vspace",{}],767.2500000000001,177.75,[88,93]],
[93,["pitch",{}],767.2500000000001,209.25,[92,94,95,null]],
[94,["solfege",{"value":"sol"}],840.7500000000001,209.25,[93]],
[95,["number",{"value":4}],840.7500000000001,240.75,[93]],
[96,["hidden",{}],753.7500000000001,303.75,[88,107]],
[97,["newnote",{}],753.7500000000001,744.75,[126,98,101,105]],
[98,["divide",{}],849.9711914062501,744.75,[97,99,100]],
[99,["number",{"value":1}],935.4711914062501,744.75,[98]],
[100,["number",{"value":2}],935.4711914062501,776.25,[98]],
[101,["vspace",{}],767.2500000000001,776.25,[97,102]],
[102,["pitch",{}],767.2500000000001,807.7499999999999,[101,103,104,null]],
[103,["solfege",{"value":"do"}],840.7500000000001,807.7499999999999,[102]],
[104,["number",{"value":5}],840.7500000000001,839.2499999999999,[102]],
[105,["hidden",{}],753.7500000000001,902.2499999999999,[97,129]],
[106,["flat",{}],767.2500000000001,366.75,[111,112,116]],
[107,["newnote",{}],753.7500000000001,303.75,[96,108,111,115]],
[108,["divide",{}],849.9711914062501,303.75,[107,109,110]],
[109,["number",{"value":1}],935.4711914062501,303.75,[108]],
[110,["number",{"value":2}],935.4711914062501,335.25,[108]],
[111,["vspace",{}],767.2500000000001,335.25,[107,106]],
[112,["pitch",{}],780.7500000000001,398.25,[106,113,114,null]],
[113,["solfege",{"value":"la"}],854.2500000000001,398.25,[112]],
[114,["number",{"value":4}],854.2500000000001,429.75,[112]],
[115,["hidden",{}],753.7500000000001,524.25,[107,118]],
[116,["hidden",{}],767.2500000000001,492.75,[106,null]],
[117,["flat",{}],767.2500000000001,587.25,[122,123,127]],
[118,["newnote",{}],753.7500000000001,524.25,[115,119,122,126]],
[119,["divide",{}],849.9711914062501,524.25,[118,120,121]],
[120,["number",{"value":1}],935.4711914062501,524.25,[119]],
[121,["number",{"value":2}],935.4711914062501,555.75,[119]],
[122,["vspace",{}],767.2500000000001,555.75,[118,117]],
[123,["pitch",{}],780.7500000000001,618.75,[117,124,125,null]],
[124,["solfege",{"value":"ti"}],854.2500000000001,618.75,[123]],
[125,["number",{"value":4}],854.2500000000001,650.25,[123]],
[126,["hidden",{}],753.7500000000001,744.75,[118,97]],
[127,["hidden",{}],767.2500000000001,713.25,[117,null]],
[128,["flat",{}],767.2500000000001,965.2499999999999,[133,134,138]],
[129,["newnote",{}],753.7500000000001,902.2499999999999,[105,130,133,137]],
[130,["divide",{}],849.9711914062501,902.2499999999999,[129,131,132]],
[131,["number",{"value":1}],935.4711914062501,902.2499999999999,[130]],
[132,["number",{"value":2}],935.4711914062501,933.7499999999999,[130]],
[133,["vspace",{}],767.2500000000001,933.7499999999999,[129,128]],
[134,["pitch",{}],780.7500000000001,996.7499999999999,[128,135,136,null]],
[135,["solfege",{"value":"re"}],854.2500000000001,996.7499999999999,[134]],
[136,["number",{"value":5}],854.2500000000001,1028.25,[134]],
[137,["hidden",{}],753.7500000000001,1122.75,[129,140]],
[138,["hidden",{}],767.2500000000001,1091.25,[128,null]],
[139,["flat",{}],555.7500000000001,209.25,[172,173,149]],
[140,["newnote",{}],753.7500000000001,1122.75,[137,141,144,148]],
[141,["divide",{}],849.9711914062501,1122.75,[140,142,143]],
[142,["number",{"value":1}],935.4711914062501,1122.75,[141]],
[143,["number",{"value":2}],935.4711914062501,1154.25,[141]],
[144,["vspace",{}],767.2500000000001,1154.25,[140,145]],
[145,["pitch",{}],767.2500000000001,1185.75,[144,146,147,null]],
[146,["solfege",{"value":"fa"}],840.7500000000001,1185.75,[145]],
[147,["number",{"value":5}],840.7500000000001,1217.25,[145]],
[148,["hidden",{}],753.7500000000001,1280.25,[140,150]],
[149,["hidden",{}],555.7500000000001,335.25,[139,null]],
[150,["newnote",{}],753.7500000000001,1280.25,[148,151,154,158]],
[151,["divide",{}],849.9711914062501,1280.25,[150,152,153]],
[152,["number",{"value":1}],935.4711914062501,1280.25,[151]],
[153,["number",{"value":2}],935.4711914062501,1311.75,[151]],
[154,["vspace",{}],767.2500000000001,1311.75,[150,155]],
[155,["pitch",{}],767.2500000000001,1343.25,[154,156,157,null]],
[156,["solfege",{"value":"mi"}],840.7500000000001,1343.25,[155]],
[157,["number",{"value":5}],840.7500000000001,1374.75,[155]],
[158,["hidden",{}],753.7500000000001,1437.75,[150,159]],
[159,["newnote",{}],753.7500000000001,1437.75,[158,160,163,167]],
[160,["divide",{}],849.9711914062501,1437.75,[159,161,162]],
[161,["number",{"value":1}],935.4711914062501,1437.75,[160]],
[162,["number",{"value":2}],935.4711914062501,1469.25,[160]],
[163,["vspace",{}],767.2500000000001,1469.25,[159,164]],
[164,["pitch",{}],767.2500000000001,1500.75,[163,165,166,null]],
[165,["solfege",{"value":"fa"}],840.7500000000001,1500.75,[164]],
[166,["number",{"value":5}],840.7500000000001,1532.25,[164]],
[167,["hidden",{}],753.7500000000001,1595.25,[159,177]],
[168,["newnote",{}],542.2500000000001,146.25,[30,169,172,176]],
[169,["divide",{}],638.4711914062501,146.25,[168,170,171]],
[170,["number",{"value":1}],723.9711914062501,146.25,[169]],
[171,["number",{"value":2}],723.9711914062501,177.75,[169]],
[172,["vspace",{}],555.7500000000001,177.75,[168,139]],
[173,["pitch",{}],569.2500000000001,240.75,[139,174,175,null]],
[174,["solfege",{"value":"la"}],642.7500000000001,240.75,[173]],
[175,["number",{"value":4}],642.7500000000001,272.25,[173]],
[176,["hidden",{}],542.2500000000001,366.75,[168,1]],
[177,["newnote",{}],753.7500000000001,1595.25,[167,178,181,183]],
[178,["divide",{}],849.9711914062501,1595.25,[177,179,180]],
[179,["number",{"value":1}],935.4711914062501,1595.25,[178]],
[180,["number",{"value":4}],935.4711914062501,1626.75,[178]],
[181,["vspace",{}],767.2500000000001,1626.75,[177,182]],
[182,["rest2",{}],767.2500000000001,1658.25,[181,null]],
[183,["hidden",{}],753.7500000000001,1721.25,[177,null]],
[184,1,[0,"right",180]],
[185,1,[0,"notes","G#4",1.3333333333333333,"default",null,null]],
[186,1,[1.3333333333333333,"notes","G4",1.3333333333333333,"default",null,null]],
[187,1,[2.6666666666666665,"notes","C5",1.3333333333333333,"default",null,null]],
[188,1,[4,"notes","F4",1.3333333333333333,"default",null,null]],
[189,1,[5.333333333333333,"notes","G#4",1.3333333333333333,"default",null,null]],
[190,1,[6.666666666666666,"notes","G4",1.3333333333333333,"default",null,null]],
[191,1,[7.999999999999999,"notes","F4",1.3333333333333333,"default",null,null]],
[192,1,[9.333333333333332,"notes","E4",1.3333333333333333,"default",null,null]],
[193,1,[10.666666666666666,"notes","G4",0.6666666666666666,"default",null,null]],
[194,1,[11.333333333333332,"notes","G#4",1.3333333333333333,"default",null,null]],
[195,1,[12.666666666666666,"notes","A#4",1.3333333333333333,"default",null,null]],
[196,1,[14,"notes","C5",1.3333333333333333,"default",null,null]],
[197,1,[15.333333333333334,"notes","C#5",1.3333333333333333,"default",null,null]],
[198,1,[16.666666666666668,"notes","F5",1.3333333333333333,"default",null,null]],
[199,1,[18,"notes","E5",1.3333333333333333,"default",null,null]],
[200,1,[19.333333333333332,"notes","F5",1.3333333333333333,"default",null,null]],
[201,1,[20.666666666666664,"right",180]],
[202,2,[0,"right",180]],
[203,2,[0.6666666666666666,"notes","F5",1.3333333333333333,"default",null,null]],
[204,2,[2,"notes","E5",1.3333333333333333,"default",null,null]],
[205,2,[3.333333333333333,"notes","F5",1.3333333333333333,"default",null,null]],
[206,2,[4.666666666666666,"notes","C#5",1.3333333333333333,"default",null,null]],
[207,2,[5.999999999999999,"notes","B4",1.3333333333333333,"default",null,null]],
[208,2,[7.333333333333332,"notes","A4",1.3333333333333333,"default",null,null]],
[209,2,[8.666666666666666,"notes","F#4",1.3333333333333333,"default",null,null]],
[210,2,[10,"notes","E4",0.6666666666666666,"default",null,null]],
[211,2,[10.666666666666666,"notes","C#4",1.3333333333333333,"default",null,null]],
[212,2,[12,"notes","D4",1.3333333333333333,"default",null,null]],
[213,2,[13.333333333333334,"notes","E4",1.3333333333333333,"default",null,null]],
[214,2,[14.666666666666668,"notes","F4",1.3333333333333333,"default",null,null]],
[215,2,[16,"notes","C#4",1.3333333333333333,"default",null,null]],
[216,2,[17.333333333333332,"notes","G#4",1.3333333333333333,"default",null,null]],
[217,2,[18.666666666666664,"notes","D#4",1.3333333333333333,"default",null,null]],
[218,2,[19.999999999999996,"notes","E4",1.3333333333333333,"default",null,null]],
[219,2,[19.999999999999996,"right",180]]]
%}

walterbender commented 7 years ago
  1. I understand that we could use the set key block to make it easier to specify the pitches we chose in a selector, but it is complicated by the fact that when we are modifying the code (as opposed to running the code) we don't know the context of a block. It is possible but probably a major effort.
  2. However, don't you get this for free if you stick to do re mi?
  3. And the step pitch block gives us the ability to navigate mode.
  4. As per #846, if we add a transpose by relative interval block, we get a lot of additional leverage regarding switching keys.
pikurasa commented 7 years ago

I think I misidentified the issue, which may be causing the confusion. I apologize for this.

The Set Key block is useful as is and without any modifications for:

  1. scale degree
  2. step pitch
  3. movable solfege
  4. relative interval
  5. (transpose by relative interval -- as proposed in another issue)

The Set Key block modifies the pitch unnecessarily when a user is writing their music out in fixed solfege. This makes it impossible to identify the key using "set key" without transposing all of the pitches with the unintended effect of transposing all the pitches to a key other than the key "set key" is specifying (Example is mentioned https://github.com/walterbender/musicblocks/issues/832#issuecomment-339145593 where if I try and specify f minor, then all of the pitches would transpose, and the result would not be f minor (and despite the input being f minor.) (I hope this addresses your number 2 question)

Testing Set Key block with note names (A, B, C, D...) I notice that it does not modify the pitches, which is good. However, it should send the key information to lilypond, which it currently does not.

The conclusion to all of this is that we need a way to allow for users to create music in fixed solfege. If we do not, we will be excluding quite a lot of people.

I am open-minded to designs. I propose that we add something to the settings in the toolbar to the right. The user can select from fixed solfege or one of the movable solfege systems (since their are multiple systems). It should also be considered whether we put options for "East Indian Solfege" (as well as all future different solfege types) here instead of by default in the palette.

pikurasa commented 7 years ago

I understand that we could use the set key block to make it easier to specify the pitches we chose in a selector, but it is complicated by the fact that when we are modifying the code (as opposed to running the code) we don't know the context of a block. It is possible but probably a major effort.

Well, perhaps "set key" (or any other block) is not the way to go about this. Perhaps the key for absolute pitches (whether they are musical alphabet or fixed solfege) could be chosen in settings. Then the code would not need to be run. The user chooses the context that they would like to express themselves in.

However, don't you get this for free if you stick to do re mi?

I do not understand what you mean by this.

(perhaps this is related) Sometimes I have heard you say that we "are in C major by default". However, this is not necessarily so (but I suspect Music Blocks assumes it to be so). For example, my hot cross buns examples are in G major, not C major, even though no "set key" block is present in the code. The example I wrote up of Bach's simple Crab Canon is in F minor, but there is no "set key" in the code.

If I were to try and put a G major or F minor "set key" block into the code for the above examples, the result would be music that is not in g major, not in F minor. Music Blocks is assuming that I am starting from C major, when I am really not.

I wrote those examples expressed in fixed solfege. If I rewrote them into movable solfege, then I suppose the "set key" would accurately reflect the key. However, why is it designed such that this is necessary? Furthermore, requiring the user to identify the key they will write in makes more complicated music even less accessible to those who do not know music theory (like the Bach mentioned in https://github.com/walterbender/musicblocks/issues/832#issuecomment-339067831). It would make some types of music impossible to write with any analytical integrity.

And the step pitch block gives us the ability to navigate mode.

In the previous comment (https://github.com/walterbender/musicblocks/issues/832#issuecomment-339358983), I concede that I misstated the fundamental issue. Step pitch with set key is useful when the user is expressing themselves in terms of a particular mode.

As per #846, if we add a transpose by relative interval block, we get a lot of additional leverage regarding switching keys.

Yes. My idea for transposing by key has a slightly different nuance, but let's table that particular idea right now and solve this issue.

walterbender commented 7 years ago

If I were to try and put a G major or F minor "set key" block into the code for the above examples, the result would be music that is not in g major, not in F minor. Music Blocks is assuming that I am starting from C major, when I am really not.

My ignorance of fixed versus movable is again apparent. My understanding is that since we provide the ability to add sharps and/or flats in our solfege notation, you can mimic any key even though the underlying assumption of MB is C major.

pikurasa commented 7 years ago

My ignorance of fixed versus movable is again apparent. My understanding is that since we provide the ability to add sharps and/or flats in our solfege notation, you can mimic any key even though the underlying assumption of MB is C major.

The problem is that MB's assumption of C major creates issues when someone expressing their musical creation in fixed do tries to use "set key" block for a key that has any sharps/flats (non-C major).

I am going to create new issues which break this one into smaller parts.

I would like to solve this problem. Many people use fixed do. It is pretty standard now in conservatories all over the globe. People who use fixed do and who try to mark their scores with keys will run into this issue.

pikurasa commented 7 years ago

I am going to create new issues which break this one into smaller parts.

I decided to make a video instead.

The video is at: http://www.libretools.com/large-file-share/2017-10-25-compare-alphabet-movable-solfege-2-2.ogv

Alphabet works great! 0 seconds - Alphabet -- plays B A G 13 seconds - Alphabet -- plays B A G with "set key" to G major (no modification of pitches -- yes!) 27 seconds - Alphabet -- plays B A G and "step pitch" = -1 with "set key" to G major -- it plays an F# at the end; this is great! 40 seconds - Alphabet -- plays B A G and "step pitch" all with "relative interval" = -3 (down a third) -- it plays F#'s, which is great!

Solfege is misleading if you are expressing the music as fixed solfege 1 min 5 sec - Solfege (movable) -- plays Ti La Sol as B A G -- this is fine

...however...

1 min 11 sec - Solfege (movable) -- plays "Set Key" = G, Ti La Sol, as F# E D -- this is not good as the intention was G major and now it sounds like D major 1 min 20 sec - Solfege (movable) -- plays "Set Key" = C, Ti La Sol, as B A G -- this may be the original pitches, but this is not good as I am indicating/suggesting a key (C major) that differs from the intention of G major. It sounds like G major, but says C major. 1 min 33 sec - Solfege (movable) -- plays "Set Key" = C, Ti La Sol, step pitch = -1, as B A G F -- if the original intention was to play Hot Cross Buns in G major, then this is not correct. 1 min 40 seconds - Solfege (movable) -- plays "Set Key" = G, Ti La Sol, step pitch = -1, as F# E D C -- I do not have scale degrees = 3 2 1 7 in G major; I have 7 6 5 4, which was not my intention. 2 min 5 seconds - Solfege (movable) -- added "relative interval". Same underlying issue.

Basically, the current implementation for musical alphabet is perfect. It is helpful as a fixed system and is even smart enough to choose the correct notes to step to for "step pitch" and intervals for "relative interval". That is all great.

We should have this same functionality--the same as musical alphabet--for a solfege system as well.

I propose putting it in settings as mentioned in https://github.com/walterbender/musicblocks/issues/832#issuecomment-339358983, but open to other ways to solve the fundamental issue.

I do not think it is an acceptable solution to just say that musical alphabet will be the only fixed system for Music Blocks, excluding a fixed do system (a system that avoids the issue outlined above). There are too many people in the world who use fixed do as their primary method.

pikurasa commented 7 years ago

I propose putting it in settings as mentioned in #832 (comment), but open to other ways to solve the fundamental issue.

I changed my mind about putting this in settings. I think that perhaps a 3rd argument to set key solves the issue in a better way.

3-arg-set-key

The choices for the third argument could include the following for now:

** BTW, this system is movable do system is less common than the "Minor La" system. I think it would be wiser to have the "Minor La" system as default if we are to have a movable do system as default.

Other systems could be included later.

walterbender commented 7 years ago

I think what I implemented so far for solfege is movable and for alphabetic if fixed. I am not quite sure how fixed solfege would work or how movable alphabetic would work:

What I have: (C Major -- default) C D E F G A B do re mi fa sol la ti

G Major: G A B C D E F# do re mi fa sol la ti

What would fixed solfege look like for G Major? What would movable alphabet look like for G Major?

I understand where you are going with Minor La, but what do I do if the user selects Minor La on a major mode? Or some other non-minor mode?

pikurasa commented 7 years ago

I think what I implemented so far for solfege is movable and for alphabetic if fixed. I am not quite sure how fixed solfege would work

It should work just the way alphabet works right now.

or how movable alphabetic would work:

I do not think that movable alphabet is necessary.

What I have: (C Major -- default) C D E F G A B do re mi fa sol la ti

G Major: G A B C D E F# do re mi fa sol la ti

Well this is all well and good if the only users we expect are fluent in movable do.

The issue, as outlined in the video and the subsequent notes, is when the user does the following:

(C Major -- default) G A B C D E F# sol la ti do re mi fa#

Students and teachers expecting that they are transcribing their music in a fixed do system are expecting no change to their notes when they do the following:

Set Key = G G A B C D E F# sol la ti do re mi fa#

What would fixed solfege look like for G Major?

Set Key = G G A B C D E F# sol la ti do re mi fa#

What would movable alphabet look like for G Major?

As I mention above, I do not think movable alphabet is necessary. I do not know anyone who uses alphabet in a movable way.

I understand where you are going with Minor La, but what do I do if the user selects Minor La on a major mode? Or some other non-minor mode?

The short answer is that all the modes that are essentially the same set of pitches would have the same result.

Set Key = C Ionian, D Dorian, E Phrygian, F Lydian, G Mixolydian, A Aeolian, or B Locrian Do Mi Sol La Fa Re Ti Do Mi Sol La Fa Re Ti Do Mi Sol La Fa Re Ti Do Mi Sol La Fa Re Ti Do Mi Sol La Fa Re Ti Do Mi Sol La Fa Re Ti Do Mi Sol La Fa Re or Ti Do Mi Sol La Fa Re Ti

...would be all result in the same pitches b/c all the modes in the example are the same set of pitches (0,2,4,5,7,9,11). Just their starting note is different, which does not affect anything in this system as long as the underlying pitch set is the same.

I think there is a more appropriate name than "Minor La", BTW, that better describes the underlying system.

walterbender commented 7 years ago

I think I have an easy way to get fixed solfege working. Still thinking about how best to expose movable to the UI.

pikurasa commented 7 years ago

I think I have an easy way to get fixed solfege working. Still thinking about how best to expose movable to the UI.

What do you have in mind?

walterbender commented 7 years ago

I am thinking of fixed solfege by default and a movable block that takes a boolean input.

pikurasa commented 7 years ago

I am thinking of fixed solfege by default and a movable block that takes a boolean input.

Would you mind making a mockup? It would be helpful for me to see this as I am not sure I am imagining it correctly.

walterbender commented 7 years ago

pushed it to Master there is a movable block you can use in conjunction with the set key block. I kept it separate since I didn't want to over complicate set key when you were not using movable solfege.

walterbender commented 7 years ago

I need to work on the artwork... a but clumsy.

pikurasa commented 7 years ago

pushed it to Master there is a movable block

Well, I just tested and my first impression is that I like it. First impressions are important :p

walterbender commented 7 years ago

Were you able to test fixed solfege? Is it working as you expect?

pikurasa commented 7 years ago

Were you able to test fixed solfege? Is it working as you expect?

Yes, it works as expected in my limited testing. Thanks for sticking with this one!

I will try some other things now (spolier alert: I am going to try different keys for different start blocks; maybe start with some Bartok)

walterbender commented 7 years ago

Can you please test step pitch in light of fixed vs movable solfege?

walterbender commented 7 years ago

Re step pitch, right now it is taking key and mode into consideration. I suppose that it should not if movable === false.

I'm a bit confused about mode. Currently we are ignoring it in our fixed solfege. Correct?

walterbender commented 7 years ago

I took care of step pitch -- it now assumes fixed unless movable === true.

pikurasa commented 7 years ago

I'm a bit confused about mode. Currently we are ignoring it in our fixed solfege. Correct?

I will test it.

The way it was working for alphabet was good (as tested in this comment's video). It was taking mode into consideration within the framework of the fixed system. I would expect fixed solfege to work the same way.

pikurasa commented 7 years ago

The way it was working for alphabet was good (as tested in this comment's video). It was taking mode into consideration within the framework of the fixed system. I would expect fixed solfege to work the same way.

@walterbender does this comment make sense to you?

I will test it.

I tested it. It does not work as I would expect. The above comment is probably the simplest way to think about it. The way "step pitch" and "scale degree" worked in conjunction with alphabet PLUS set key in the video is how I would expect MB to work with fixed solfege PLUS set key.

walterbender commented 6 years ago

Devin, Can you write a simple test case for me? Using Alphabet to get something you expect and then Solfege to express the same thing (as you'd expect it) so I can see exactly where things break down with step pitch?

pikurasa commented 6 years ago

This issue has been fixed (at least the most major part of the design problem). This issue was due to not being able to work with solfege as fixed when using "set key". Now we have a movable block, which has fixed much of the design problems. I will close this. We have other open issues that once resolved will further give clarity to this, and if we need more I will make them.

Thanks for everything!

pikurasa commented 6 years ago

I think that these are two last design issues related to this: https://github.com/walterbender/musicblocks/issues/849 https://github.com/walterbender/musicblocks/issues/889