View Javadoc

1   package com.jamesbryangraves.bob.music;
2   
3   
4   public class MusicContext {
5   	
6   	private String key;
7   	private int meterNumerator;
8   	private int meterDenominator;
9   	private float bpm;
10  	private Scale scale;
11  	private int resolution;
12  	private boolean compound;
13  	private int phraseSize;
14  	
15  	public long getTicksPerBeat() {
16  		return getResolution() / meterDenominator;
17  	}
18  	
19  	public long getTicksPerBar() {
20  		return getTicksPerBeat() * meterNumerator;
21  	}
22  	
23  	public float getBpm() {
24  		return bpm;
25  	}
26  	
27  	public void setBpm(float bpm) {
28  		this.bpm = bpm;
29  	}
30  	
31  	public String getKey() {
32  		return key;
33  	}
34  	
35  	public void setKey(String key) {
36  		this.key = key;
37  	}
38  	
39  	public int getMeterDenominator() {
40  		return meterDenominator;
41  	}
42  	
43  	public void setMeterDenominator(int meterDenominator) {
44  		this.meterDenominator = meterDenominator;
45  	}
46  	
47  	public int getMeterNumerator() {
48  		return meterNumerator;
49  	}
50  	
51  	public void setMeterNumerator(int meterNumerator) {
52  		this.meterNumerator = meterNumerator;
53  	}
54  	
55  	public Scale getScale() {
56  		return scale;
57  	}
58  	
59  	public void setScale(Scale scale) {
60  		this.scale = scale;
61  	}
62  
63  	public int getResolution() {
64  		return resolution;
65  	}
66  
67  	public void setResolution(int resolution) {
68  		this.resolution = resolution;
69  	}
70  
71  	public boolean isCompound() {
72  		return compound;
73  	}
74  
75  	public void setCompound(boolean compound) {
76  		this.compound = compound;
77  	}
78  
79  	public int getPhraseSize() {
80  		return phraseSize;
81  	}
82  
83  	public void setPhraseSize(int phraseSize) {
84  		this.phraseSize = phraseSize;
85  	}
86  	
87  }