Skip to content

Commit

Permalink
Split the exerices
Browse files Browse the repository at this point in the history
  • Loading branch information
veminovici committed Mar 17, 2024
1 parent 4847990 commit 20328b3
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 122 deletions.
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,38 +44,34 @@ The create allows you to build the following chords:

You can find all the chords in the [chords][chords_folder] folder.

## Piano Exercises
You can find all piano exercises implemented in the [practices][practices_file] file. You can see the practices by running:
```bsh
cargo run --example practices
```

### Exercise 1 (| C - Am | F - G |)
```rust
use musika_rs::*;
use musika_rs::*

let cmaj = C.major();
println!("{:X}", cmaj);

let amin = A.minor();
println!("{:X}", amin);

let cmaj7 = C.major7();
println!("{:X}", cmaj7);

println!("Exercise 1: (| C - Am | F - G |)");
println!("{:X}", C.major()); // C [C, E, G]
println!("{:X}", A.minor()); // Am [A, C, E]
println!("{:X}", F.major()); // F [F, A, C]
println!("{:X}", G.major()); // G [G, B, D]
```

### Exercise 2 (| C - G | Am - F | C - G | F - Em - Dm - C |)
```rust
println!("Exercise 2: (| C - G | Am - F | C - G | F - Em - Dm - C |)");
println!("{:X}", C.major()); // C [C, E, G]
println!("{:X}", G.major()); // G [G, B, D]
println!("{:X}", A.minor()); // Am [A, C, E]
println!("{:X}", F.major()); // F [F, A, C]
println!("{:X}", C.major()); // C [C, E, G]
println!("{:X}", G.major()); // G [G, B, D]
println!("{:X}", F.major()); // F [F, A, C]
println!("{:X}", E.minor()); // Em [E, G, B]
println!("{:X}", D.minor()); // Dm [D, F, A]
println!("{:X}", C.major()); // C [C, E, G]
## Piano Exercises
You can find all piano exercises implemented in the exercises examples. You can see the practices by running:
```bsh
cargo run --example exercise1
cargo run --example exercise2
cargo run --example exercise3
cargo run --example exercise4
```

- [Exercise 1][exercise1_file] | C - Am | F - G |
- [Exercise 2][exercise2_file] | C - G | Am - F | C - G | F - Em - Dm - C |
- [Exercise 3][exercise3_file] | Cx4 | Gx4 | Gx4 | Cx4 | Fx4 | Cx4 | Gx4 | Cx4 |
- [Exercise 4][exercise4_file] | C | F | Bdim | Em | Am | Dm | G | C |

## Resources
- [Piano Chords][piano_chords_url]

Expand All @@ -102,4 +98,8 @@ println!("{:X}", C.major()); // C [C, E, G]
[minor7b5_chord_url]: https://www.pianochord.org/cm7b5.html
[dim_chord_url]: https://www.pianochord.org/c-dim.html
[dim7_chord_url]: https://www.pianochord.org/c-dim7.html
[dom7_chord_url]: https://www.pianochord.org/c7.html
[dom7_chord_url]: https://www.pianochord.org/c7.html
[exercise1_file]: ./examples/exercise1.rs
[exercise2_file]: ./examples/exercise2.rs
[exercise3_file]: ./examples/exercise3.rs
[exercise4_file]: ./examples/exercise4.rs
10 changes: 10 additions & 0 deletions examples/exercise1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use musika_rs::*;

fn main() {
println!();
println!("Exercise 1: | C - Am | F - G |");
println!("{:X}", C.major()); // C [C, E, G]
println!("{:X}", A.minor()); // Am [A, C, E]
println!("{:X}", F.major()); // F [F, A, C]
println!("{:X}", G.major()); // G [G, B, D]
}
16 changes: 16 additions & 0 deletions examples/exercise2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use musika_rs::*;

fn main() {
println!();
println!("Exercise 2: | C - G | Am - F | C - G | F - Em - Dm - C |");
println!("{:X}", C.major()); // C [C, E, G]
println!("{:X}", G.major()); // G [G, B, D]
println!("{:X}", A.minor()); // Am [A, C, E]
println!("{:X}", F.major()); // F [F, A, C]
println!("{:X}", C.major()); // C [C, E, G]
println!("{:X}", G.major()); // G [G, B, D]
println!("{:X}", F.major()); // F [F, A, C]
println!("{:X}", E.minor()); // Em [E, G, B]
println!("{:X}", D.minor()); // Dm [D, F, A]
println!("{:X}", C.major()); // C [C, E, G]
}
50 changes: 50 additions & 0 deletions examples/exercise3.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
use musika_rs::*;

fn main() {
println!();
println!("Exercise 3: | Cx4 | Gx4 | Gx4 | Cx4 | Fx4 | Cx4 | Gx4 | Cx4 |");

let cmaj = C.major();
let gmaj = G.major();
let fmaj = F.major();

// bar 1
for _ in 0..4 {
println!("{:X}", cmaj); // C [C, E, G]
}

// bar 2
for _ in 0..4 {
println!("{:X}", gmaj); // C [C, E, G]
}

// bar 3
for _ in 0..4 {
println!("{:X}", gmaj); // C [C, E, G]
}

// bar 4
for _ in 0..4 {
println!("{:X}", cmaj); // C [C, E, G]
}

// bar 5
for _ in 0..4 {
println!("{:X}", fmaj); // C [C, E, G]
}

// bar 6
for _ in 0..4 {
println!("{:X}", cmaj); // C [C, E, G]
}

// bar 7
for _ in 0..4 {
println!("{:X}", gmaj); // C [C, E, G]
}

// bar 8
for _ in 0..4 {
println!("{:X}", cmaj); // C [C, E, G]
}
}
15 changes: 15 additions & 0 deletions examples/exercise4.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use musika_rs::*;

fn main() {
println!();
println!("Exercise 4: | C | F | Bdim | Em | Am | Dm | G | C |");

println!("{:X}", C.major());
println!("{:X}", F.major());
println!("{:X}", B.diminished());
println!("{:X}", E.minor());
println!("{:X}", A.minor());
println!("{:X}", D.minor());
println!("{:X}", G.major());
println!("{:X}", C.major());
}
95 changes: 0 additions & 95 deletions examples/exercises.rs

This file was deleted.

0 comments on commit 20328b3

Please sign in to comment.