View Issue Details

IDProjectCategoryView StatusLast Update
0003867ardourfeaturespublic2020-04-19 20:15
ReporterJoskar Assigned Tocth103  
PrioritynormalSeveritytrivialReproducibilityN/A
Status closedResolutionfixed 
Summary0003867: Use scientific pitch notation for MIDI note names (e.g. middle C = C4 and A4 = 440Hz)
DescriptionArdour currently uses "c5" as the representation for "middle C", whereas in standard pitch notation it is notated as "C4" (note the capital letter). This may lead to confusion. The confusion probably exists because the MIDI specification doesn't specify an octave numbering scheme, so my proposal is to use the numbering scheme which "traditional musicians" may already be accustomed to (where the lowest audible octave is the zeroth octave).
Additional InformationI've added a patch which changes the notation to scientific pitch notation (it corrects the octave number and also uses capital letters for the note names)

Some information about scientific pitch notation:
http://en.wikipedia.org/wiki/Scientific_pitch_notation
TagsNo tags attached.

Activities

2011-03-22 00:19

 

scientific-pitch-notation.diff (723 bytes)   
Index: libs/evoral/src/midi_util.cpp
===================================================================
--- libs/evoral/src/midi_util.cpp	(revision 9184)
+++ libs/evoral/src/midi_util.cpp	(working copy)
@@ -29,24 +29,25 @@
 	}
 
 	static const char* notes[] = {
-		"c",
-		"c#",
-		"d",
-		"d#",
-		"e",
-		"f",
-		"f#",
-		"g",
-		"g#",
-		"a",
-		"a#",
-		"b"
+		"C",
+		"C#",
+		"D",
+		"D#",
+		"E",
+		"F",
+		"F#",
+		"G",
+		"G#",
+		"A",
+		"A#",
+		"B"
 	};
 
-	int octave = val/12;
+	/* MIDI note 0 is in octave -1 (in scientific pitch notation) */
+	int octave = val/12-1;
 	static char buf[8];
 
-	val -= octave*12;
+	val = val % 12;
 
 	snprintf (buf, sizeof (buf), "%s%d", notes[val], octave);
 	return buf;

cth103

2011-03-23 13:19

administrator   ~0010383

Patch applied to SVN 9188. Thanks!

system

2020-04-19 20:15

developer   ~0022460

Issue has been closed automatically, by Trigger Close Plugin.
Feel free to re-open with additional information if you think the issue is not resolved.

Issue History

Date Modified Username Field Change
2011-03-22 00:19 Joskar New Issue
2011-03-22 00:19 Joskar File Added: scientific-pitch-notation.diff
2011-03-23 13:19 cth103 cost => 0.00
2011-03-23 13:19 cth103 Note Added: 0010383
2011-03-23 13:19 cth103 Status new => resolved
2011-03-23 13:19 cth103 Resolution open => fixed
2011-03-23 13:19 cth103 Assigned To => cth103
2020-04-19 20:15 system Note Added: 0022460
2020-04-19 20:15 system Status resolved => closed