Note.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. /* ----------------------------------------------------------------- */
  2. /* The HMM-Based Singing Voice Synthesis System "Sinsy" */
  3. /* developed by Sinsy Working Group */
  4. /* http://sinsy.sourceforge.net/ */
  5. /* ----------------------------------------------------------------- */
  6. /* */
  7. /* Copyright (c) 2009-2015 Nagoya Institute of Technology */
  8. /* Department of Computer Science */
  9. /* */
  10. /* All rights reserved. */
  11. /* */
  12. /* Redistribution and use in source and binary forms, with or */
  13. /* without modification, are permitted provided that the following */
  14. /* conditions are met: */
  15. /* */
  16. /* - Redistributions of source code must retain the above copyright */
  17. /* notice, this list of conditions and the following disclaimer. */
  18. /* - Redistributions in binary form must reproduce the above */
  19. /* copyright notice, this list of conditions and the following */
  20. /* disclaimer in the documentation and/or other materials provided */
  21. /* with the distribution. */
  22. /* - Neither the name of the Sinsy working group nor the names of */
  23. /* its contributors may be used to endorse or promote products */
  24. /* derived from this software without specific prior written */
  25. /* permission. */
  26. /* */
  27. /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND */
  28. /* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, */
  29. /* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */
  30. /* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
  31. /* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS */
  32. /* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */
  33. /* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
  34. /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
  35. /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */
  36. /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, */
  37. /* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY */
  38. /* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE */
  39. /* POSSIBILITY OF SUCH DAMAGE. */
  40. /* ----------------------------------------------------------------- */
  41. #ifndef SINSY_NOTE_H_
  42. #define SINSY_NOTE_H_
  43. #include <string>
  44. #include "Pitch.h"
  45. #include "Syllabic.h"
  46. #include "Slur.h"
  47. namespace sinsy
  48. {
  49. class Note
  50. {
  51. public:
  52. //! constructor
  53. Note();
  54. //! copy constructor (donot use)
  55. Note(const Note& obj);
  56. //! destructor
  57. virtual ~Note();
  58. //! set duration
  59. void setDuration(size_t d);
  60. //! get duration
  61. size_t getDuration() const;
  62. //! set pitch
  63. void setPitch(const Pitch& p);
  64. //! get pitch
  65. const Pitch& getPitch() const;
  66. //! set rest
  67. void setRest(bool f);
  68. //! is rest or not
  69. bool isRest() const;
  70. //! set lyric
  71. void setLyric(const std::string& s);
  72. //! get lyric
  73. const std::string& getLyric() const;
  74. //! set syllabic
  75. void setSyllabic(const Syllabic& s);
  76. //! get syllabic
  77. const Syllabic& getSyllabic() const;
  78. //! set breath mark
  79. void setBreathMark(bool f);
  80. //! has breath mark or not
  81. bool hasBreathMark() const;
  82. //! set accent
  83. void setAccent(bool f);
  84. //! has accent or not
  85. bool hasAccent() const;
  86. //! set staccato
  87. void setStaccato(bool f);
  88. //! has staccato or not
  89. bool hasStaccato() const;
  90. //! set tie start
  91. void setTieStart(bool f);
  92. //! is tie start or not
  93. bool isTieStart() const;
  94. //! set tie stop
  95. void setTieStop(bool f);
  96. //! is tie stop or not
  97. bool isTieStop() const;
  98. //! get slur
  99. const Slur& getSlur() const;
  100. //! get slur
  101. Slur& getSlur();
  102. //! set slur start
  103. void setSlurStart(bool f);
  104. //! is slur start or not
  105. bool isSlurStart() const;
  106. //! set slur stop
  107. void setSlurStop(bool f);
  108. //! is slur stop or not
  109. bool isSlurStop() const;
  110. private:
  111. //! assignment operator (donot use)
  112. Note& operator=(const Note&);
  113. //! is rest note or not
  114. bool restNote;
  115. //! duration
  116. size_t duration;
  117. //! has breath mark or not
  118. bool breathMark;
  119. //! has accent or not
  120. bool accent;
  121. //! has staccato or not
  122. bool staccato;
  123. //! is tie start or not
  124. bool tieStart;
  125. //! is tie stop or not
  126. bool tieStop;
  127. //! slur
  128. Slur slur;
  129. //! is slur start or not
  130. bool slurStart;
  131. //! is slur stop or not
  132. bool slurStop;
  133. //! pitch
  134. Pitch pitch;
  135. //! syllabic
  136. Syllabic syllabic;
  137. //! lyric
  138. std::string lyric;
  139. };
  140. //! to stream
  141. std::ostream& operator<<(std::ostream&, const Note&);
  142. };
  143. #endif // SINSY_NOTE_H_