New listing: https://github.com/MPETREMANN11/ESP32forth/blob/main/DAC/tones.txt
New listing: https://github.com/MPETREMANN11/ESP32forth/blob/main/DAC/tones.txt
Yes, I'm aware that „The purpose of the article is not to make "good FORTH code" ” — but
allow me, please, to propose changes at least for its wo... I mean: for its least good place;
(line 125 onwards). What do you think about:
: note ( n -- n+1 )
dup 1- get.note CHANNEL0 swap ledcWriteTone drop sustain.note constant 1+ ;
\ notes in english notation
1 \ starting value
note C
note C#
note D
note D#
note E
note F
note F#
note G
note G#
note A
note A#
note B
drop
Also, please note, most probably „get.note” leaves some value on the stack?
Your code cannot work.
You create a constant.....
Your code cannot work.You mean: your notes are of variable pitch? Must be some very modern music... :) indeed, I meant notes rather in traditional sense.
You create a constant.....
Have you tested my code with ESP32FORTH?Your code cannot work.You mean: your notes are of variable pitch? Must be some very modern music... :) indeed, I meant notes rather in traditional sense.
You create a constant.....
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 52:00:55 |
Calls: | 6,712 |
Calls today: | 5 |
Files: | 12,243 |
Messages: | 5,355,173 |
Posted today: | 1 |