Skip to content

Commit

Permalink
Cleanup audio program
Browse files Browse the repository at this point in the history
  • Loading branch information
connorslade committed Nov 12, 2023
1 parent 116fedc commit 90f347a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,4 @@ export def cmat {
- [ ] Figure out reusing functions across exported functions
- [x] Comments
- [ ] Anonyms functions
- [ ] Label keyword
22 changes: 18 additions & 4 deletions bin/keyboard.dm42
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
// Lets you use your calculator to compose scores of utmost beauty.

// Lets you use your calculator to compose scores of utmost elegance.
export def key {
GETKEY
GETKEY1
STO 00
if { } >= { 10 } {

// Exit if key 33 is pressed (EXIT)
if { DUP } == { 33 } {
DROP
STOP
}

// Play tone 0 if key 10 is pressed (SIN)
if { DUP } == { 10 } {
DROP
TONE 0
GTO key
}

// Do nothing if other keys are pressed
if { } > { 10 } {
GTO key
}

TONE IND 00
GTO key
}
2 changes: 1 addition & 1 deletion src/tokenize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl Tokenizer {

// Comments
if self.idx + 2 < self.chars.len() && &self.chars[self.idx..self.idx + 2] == &['/', '/'] {
while self.chars[self.idx] != '\n' {
while self.idx < self.chars.len() && self.chars[self.idx] != '\n' {
self.idx += 1;
}
self.skip_whitespace();
Expand Down

0 comments on commit 90f347a

Please sign in to comment.