Click here to Skip to main content
15,887,596 members
Home / Discussions / C#
   

C#

 
QuestionRe: Coding music rhythms Pin
ZurdoDev24-Sep-14 5:53
professionalZurdoDev24-Sep-14 5:53 
AnswerRe: Coding music rhythms Pin
Navid Abyazi25-Sep-14 7:00
professionalNavid Abyazi25-Sep-14 7:00 
QuestionRe: Coding music rhythms Pin
ZurdoDev25-Sep-14 7:17
professionalZurdoDev25-Sep-14 7:17 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult24-Sep-14 6:09
mvePIEBALDconsult24-Sep-14 6:09 
GeneralRe: Coding music rhythms Pin
BillWoodruff24-Sep-14 22:06
professionalBillWoodruff24-Sep-14 22:06 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult25-Sep-14 6:22
mvePIEBALDconsult25-Sep-14 6:22 
GeneralRe: Coding music rhythms Pin
Navid Abyazi25-Sep-14 7:15
professionalNavid Abyazi25-Sep-14 7:15 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult26-Sep-14 8:08
mvePIEBALDconsult26-Sep-14 8:08 
1) What I did was pick the smallest fraction I wanted to use ( 1/4, 1/8, 1/16, etc.) and then keep track of how many I had. The denominator doesn't change; so you only need to keep track of the numerator. The resulting fraction can be reduced later if desired -- that's only a matter of display.

I also found that using 1/32 and 1/64 took a very long time with my technique.

Here are some of my enumerations and results:

  public enum Duration4
  {
    [System.ComponentModel.DescriptionAttribute("1/4")]
    Quarter = 1, 
    [System.ComponentModel.DescriptionAttribute("2/4")]
    Half    = 2, 
    [System.ComponentModel.DescriptionAttribute("4/4")]
    Whole   = 4
  }

{ 4/4 }
{ 2/4 , 2/4 }
{ 2/4 , 1/4 , 1/4 }
{ 1/4 , 2/4 , 1/4 }
{ 1/4 , 1/4 , 2/4 }
{ 1/4 , 1/4 , 1/4 , 1/4 }
6 rhythms found in 00:00:00.0057366


  public enum Duration4d
  {
    Quarter    = 1
  , Half       = 2
  , DottedHalf = 3
  , Whole      = 4
  }

{ Whole }
{ DottedHalf , Quarter }
{ Half , Half }
{ Half , Quarter , Quarter }
{ Quarter , DottedHalf }
{ Quarter , Half , Quarter }
{ Quarter , Quarter , Half }
{ Quarter , Quarter , Quarter , Quarter }
8 rhythms found in 00:00:00.0034388


  public enum Duration8
  {
    [System.ComponentModel.DescriptionAttribute("1/8")]
    Eighth    = 1 , 
    [System.ComponentModel.DescriptionAttribute("1/4")]
    Quarter   = 2, 
    [System.ComponentModel.DescriptionAttribute("1/2")]
    Half      = 4 , 
    [System.ComponentModel.DescriptionAttribute("1")]
    Whole     = 8
  }

{ 1 }
{ 1/2 , 1/2 }
{ 1/2 , 1/4 , 1/4 }
{ 1/2 , 1/4 , 1/8 , 1/8 }
{ 1/2 , 1/8 , 1/4 , 1/8 }
{ 1/2 , 1/8 , 1/8 , 1/4 }
{ 1/2 , 1/8 , 1/8 , 1/8 , 1/8 }
{ 1/4 , 1/2 , 1/4 }
{ 1/4 , 1/2 , 1/8 , 1/8 }
{ 1/4 , 1/4 , 1/2 }
...
{ 1/8 , 1/8 , 1/8 , 1/4 , 1/4 , 1/8 }
{ 1/8 , 1/8 , 1/8 , 1/4 , 1/8 , 1/4 }
{ 1/8 , 1/8 , 1/8 , 1/4 , 1/8 , 1/8 , 1/8 }
{ 1/8 , 1/8 , 1/8 , 1/8 , 1/2 }
{ 1/8 , 1/8 , 1/8 , 1/8 , 1/4 , 1/4 }
{ 1/8 , 1/8 , 1/8 , 1/8 , 1/4 , 1/8 , 1/8 }
{ 1/8 , 1/8 , 1/8 , 1/8 , 1/8 , 1/4 , 1/8 }
{ 1/8 , 1/8 , 1/8 , 1/8 , 1/8 , 1/8 , 1/4 }
{ 1/8 , 1/8 , 1/8 , 1/8 , 1/8 , 1/8 , 1/8 , 1/8 }
56 rhythms found in 00:00:00.0045673

AnswerRe: Coding music rhythms Pin
Pete O'Hanlon24-Sep-14 8:40
mvePete O'Hanlon24-Sep-14 8:40 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult24-Sep-14 8:44
mvePIEBALDconsult24-Sep-14 8:44 
GeneralRe: Coding music rhythms Pin
Bernhard Hiller24-Sep-14 20:49
Bernhard Hiller24-Sep-14 20:49 
GeneralRe: Coding music rhythms Pin
Pete O'Hanlon24-Sep-14 20:58
mvePete O'Hanlon24-Sep-14 20:58 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult25-Sep-14 6:23
mvePIEBALDconsult25-Sep-14 6:23 
GeneralRe: Coding music rhythms Pin
Navid Abyazi25-Sep-14 7:19
professionalNavid Abyazi25-Sep-14 7:19 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult26-Sep-14 2:55
mvePIEBALDconsult26-Sep-14 2:55 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult30-Sep-14 10:52
mvePIEBALDconsult30-Sep-14 10:52 
AnswerRe: Coding music rhythms Pin
Bassam Abdul-Baki3-Oct-14 5:57
professionalBassam Abdul-Baki3-Oct-14 5:57 
AnswerRe: Coding music rhythms Pin
Bassam Abdul-Baki3-Oct-14 7:19
professionalBassam Abdul-Baki3-Oct-14 7:19 
AnswerRe: Coding music rhythms Pin
Bassam Abdul-Baki5-Oct-14 11:42
professionalBassam Abdul-Baki5-Oct-14 11:42 
QuestionHow to prevent a child control to be added in usercontrol Pin
Phil Thomson24-Sep-14 4:43
Phil Thomson24-Sep-14 4:43 
AnswerRe: How to prevent a child control to be added in usercontrol Pin
BillWoodruff24-Sep-14 6:11
professionalBillWoodruff24-Sep-14 6:11 
GeneralRe: How to prevent a child control to be added in usercontrol Pin
Phil Thomson24-Sep-14 6:49
Phil Thomson24-Sep-14 6:49 
AnswerRe: How to prevent a child control to be added in usercontrol Pin
BillWoodruff24-Sep-14 21:41
professionalBillWoodruff24-Sep-14 21:41 
GeneralRe: How to prevent a child control to be added in usercontrol Pin
Phil Thomson25-Sep-14 10:01
Phil Thomson25-Sep-14 10:01 
GeneralRe: How to prevent a child control to be added in usercontrol Pin
BillWoodruff25-Sep-14 20:46
professionalBillWoodruff25-Sep-14 20:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.