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: | 502 |
Nodes: | 16 (2 / 14) |
Uptime: | 205:00:37 |
Calls: | 9,875 |
Calls today: | 3 |
Files: | 13,784 |
Messages: | 6,204,466 |