Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Alexander Graham Bell is alive and well in New York, and still waiting for a dial tone.


devel / comp.lang.forth / ESP32FORTH: music, tones and test

SubjectAuthor
* ESP32FORTH: music, tones and testMarc Petremann
`* Re: ESP32FORTH: music, tones and testZbig
 `* Re: ESP32FORTH: music, tones and testMarc Petremann
  `* Re: ESP32FORTH: music, tones and testZbig
   `* Re: ESP32FORTH: music, tones and testMarc Petremann
    `* Re: ESP32FORTH: music, tones and testZbig
     `- Re: ESP32FORTH: music, tones and testZbig

1
ESP32FORTH: music, tones and test

<97e39685-a9a4-413c-b781-6e3ab2e713b4n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19269&group=comp.lang.forth#19269

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:13cf:b0:6b5:ed16:fc69 with SMTP id g15-20020a05620a13cf00b006b5ed16fc69mr1870607qkl.416.1658482255849;
Fri, 22 Jul 2022 02:30:55 -0700 (PDT)
X-Received: by 2002:a05:6214:2307:b0:46e:5fbc:3c30 with SMTP id
gc7-20020a056214230700b0046e5fbc3c30mr2225701qvb.21.1658482255708; Fri, 22
Jul 2022 02:30:55 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 22 Jul 2022 02:30:55 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=90.37.42.172; posting-account=xbxuywoAAAASFWsQBmiz40gnxDBWDrxx
NNTP-Posting-Host: 90.37.42.172
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <97e39685-a9a4-413c-b781-6e3ab2e713b4n@googlegroups.com>
Subject: ESP32FORTH: music, tones and test
From: mpetrema...@gmail.com (Marc Petremann)
Injection-Date: Fri, 22 Jul 2022 09:30:55 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1080
 by: Marc Petremann - Fri, 22 Jul 2022 09:30 UTC

Hello,
New listing: https://github.com/MPETREMANN11/ESP32forth/blob/main/DAC/tones.txt

Re: ESP32FORTH: music, tones and test

<a0d196d5-42ed-4cde-821f-d3b21f68209bn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19276&group=comp.lang.forth#19276

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:622a:11d6:b0:31f:1251:9c7c with SMTP id n22-20020a05622a11d600b0031f12519c7cmr157653qtk.306.1658492133559;
Fri, 22 Jul 2022 05:15:33 -0700 (PDT)
X-Received: by 2002:a0c:b39d:0:b0:473:9292:d4ec with SMTP id
t29-20020a0cb39d000000b004739292d4ecmr166646qve.66.1658492133371; Fri, 22 Jul
2022 05:15:33 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 22 Jul 2022 05:15:33 -0700 (PDT)
In-Reply-To: <97e39685-a9a4-413c-b781-6e3ab2e713b4n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:a31d:a141:5b00:3176:cc50:14b9:1f4a;
posting-account=cxuXKwoAAABQpPOMD55A9IPz7pPrw6ml
NNTP-Posting-Host: 2a02:a31d:a141:5b00:3176:cc50:14b9:1f4a
References: <97e39685-a9a4-413c-b781-6e3ab2e713b4n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a0d196d5-42ed-4cde-821f-d3b21f68209bn@googlegroups.com>
Subject: Re: ESP32FORTH: music, tones and test
From: zbigniew...@gmail.com (Zbig)
Injection-Date: Fri, 22 Jul 2022 12:15:33 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1931
 by: Zbig - Fri, 22 Jul 2022 12:15 UTC

> 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?

Re: ESP32FORTH: music, tones and test

<e8c14270-a14d-4e84-a6ed-df57ffd79bdan@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19278&group=comp.lang.forth#19278

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:594b:0:b0:31e:c570:d2b5 with SMTP id 11-20020ac8594b000000b0031ec570d2b5mr1204714qtz.96.1658512372553;
Fri, 22 Jul 2022 10:52:52 -0700 (PDT)
X-Received: by 2002:a05:622a:648:b0:31f:e4a:3931 with SMTP id
a8-20020a05622a064800b0031f0e4a3931mr1144220qtb.615.1658512372360; Fri, 22
Jul 2022 10:52:52 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 22 Jul 2022 10:52:52 -0700 (PDT)
In-Reply-To: <a0d196d5-42ed-4cde-821f-d3b21f68209bn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=90.37.42.172; posting-account=xbxuywoAAAASFWsQBmiz40gnxDBWDrxx
NNTP-Posting-Host: 90.37.42.172
References: <97e39685-a9a4-413c-b781-6e3ab2e713b4n@googlegroups.com> <a0d196d5-42ed-4cde-821f-d3b21f68209bn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e8c14270-a14d-4e84-a6ed-df57ffd79bdan@googlegroups.com>
Subject: Re: ESP32FORTH: music, tones and test
From: mpetrema...@gmail.com (Marc Petremann)
Injection-Date: Fri, 22 Jul 2022 17:52:52 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 69
 by: Marc Petremann - Fri, 22 Jul 2022 17:52 UTC

Le vendredi 22 juillet 2022 à 14:15:34 UTC+2, Zbig a écrit :
> > 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?

Hello,
Your code cannot work.
You create a constant.....
I think you didn't quite grasp the concept of the CREATE cup....DOES>
The CREATE part defines the way we build the word, here we store a constant..
But, at runtime, the DOES> part is executed by the word that is defined:

: create-note
\ compile position in octave
create ( position -- )
,
\ get note frequency in current octave
does>
@ 1- get.note
CHANNEL0 swap ledcWriteTone drop
sustain.note
;

The word create-note creates a structure which appears to be equivalent to a constant.
But when the word created by create-note is executed, it is the part of code located after DOES> which will be executed, but not during the creation of the word.
Example:

8 create-note G

creates the word G in the music vocabulary.

Then, you have to call the music vocabulary:

forth also music also
4 set.octave
G D C# C# C G

And there the notes are played.

Re: ESP32FORTH: music, tones and test

<4b44bbe0-01e2-4bc8-bed9-29f5ba6f0babn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19279&group=comp.lang.forth#19279

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a0c:f0c4:0:b0:474:210a:69fd with SMTP id d4-20020a0cf0c4000000b00474210a69fdmr992197qvl.4.1658516611068;
Fri, 22 Jul 2022 12:03:31 -0700 (PDT)
X-Received: by 2002:a0c:e2cd:0:b0:474:1a2d:9e04 with SMTP id
t13-20020a0ce2cd000000b004741a2d9e04mr944209qvl.117.1658516610766; Fri, 22
Jul 2022 12:03:30 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 22 Jul 2022 12:03:30 -0700 (PDT)
In-Reply-To: <e8c14270-a14d-4e84-a6ed-df57ffd79bdan@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:a31d:a141:5b00:3176:cc50:14b9:1f4a;
posting-account=cxuXKwoAAABQpPOMD55A9IPz7pPrw6ml
NNTP-Posting-Host: 2a02:a31d:a141:5b00:3176:cc50:14b9:1f4a
References: <97e39685-a9a4-413c-b781-6e3ab2e713b4n@googlegroups.com>
<a0d196d5-42ed-4cde-821f-d3b21f68209bn@googlegroups.com> <e8c14270-a14d-4e84-a6ed-df57ffd79bdan@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <4b44bbe0-01e2-4bc8-bed9-29f5ba6f0babn@googlegroups.com>
Subject: Re: ESP32FORTH: music, tones and test
From: zbigniew...@gmail.com (Zbig)
Injection-Date: Fri, 22 Jul 2022 19:03:31 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1481
 by: Zbig - Fri, 22 Jul 2022 19:03 UTC

> Your code cannot work.
> You create a constant.....

You mean: your notes are of variable pitch? Must be some very modern
music... :) indeed, I meant notes rather in traditional sense.

Re: ESP32FORTH: music, tones and test

<5ee4ae0b-9037-480f-9507-5605ee1ce253n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19281&group=comp.lang.forth#19281

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:13cf:b0:6b5:ed16:fc69 with SMTP id g15-20020a05620a13cf00b006b5ed16fc69mr1507667qkl.416.1658523979452;
Fri, 22 Jul 2022 14:06:19 -0700 (PDT)
X-Received: by 2002:a05:620a:2901:b0:6b5:dfe8:2ea3 with SMTP id
m1-20020a05620a290100b006b5dfe82ea3mr1443189qkp.328.1658523979275; Fri, 22
Jul 2022 14:06:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Fri, 22 Jul 2022 14:06:19 -0700 (PDT)
In-Reply-To: <4b44bbe0-01e2-4bc8-bed9-29f5ba6f0babn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=92.184.112.178; posting-account=xbxuywoAAAASFWsQBmiz40gnxDBWDrxx
NNTP-Posting-Host: 92.184.112.178
References: <97e39685-a9a4-413c-b781-6e3ab2e713b4n@googlegroups.com>
<a0d196d5-42ed-4cde-821f-d3b21f68209bn@googlegroups.com> <e8c14270-a14d-4e84-a6ed-df57ffd79bdan@googlegroups.com>
<4b44bbe0-01e2-4bc8-bed9-29f5ba6f0babn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5ee4ae0b-9037-480f-9507-5605ee1ce253n@googlegroups.com>
Subject: Re: ESP32FORTH: music, tones and test
From: mpetrema...@gmail.com (Marc Petremann)
Injection-Date: Fri, 22 Jul 2022 21:06:19 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 1685
 by: Marc Petremann - Fri, 22 Jul 2022 21:06 UTC

Le vendredi 22 juillet 2022 à 21:03:32 UTC+2, Zbig a écrit :
> > Your code cannot work.
> > You create a constant.....
> You mean: your notes are of variable pitch? Must be some very modern
> music... :) indeed, I meant notes rather in traditional sense.

Have you tested my code with ESP32FORTH?

Re: ESP32FORTH: music, tones and test

<080eb1b5-0f2a-4118-8f61-8fd5a100ff88n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=19290&group=comp.lang.forth#19290

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:ac8:57d2:0:b0:31f:1f3:b3ec with SMTP id w18-20020ac857d2000000b0031f01f3b3ecmr3663712qta.214.1658578397838;
Sat, 23 Jul 2022 05:13:17 -0700 (PDT)
X-Received: by 2002:ad4:5de4:0:b0:474:2384:a0e9 with SMTP id
jn4-20020ad45de4000000b004742384a0e9mr3746648qvb.79.1658578397631; Sat, 23
Jul 2022 05:13:17 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Sat, 23 Jul 2022 05:13:17 -0700 (PDT)
In-Reply-To: <5ee4ae0b-9037-480f-9507-5605ee1ce253n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:a31d:a141:5b00:3176:cc50:14b9:1f4a;
posting-account=cxuXKwoAAABQpPOMD55A9IPz7pPrw6ml
NNTP-Posting-Host: 2a02:a31d:a141:5b00:3176:cc50:14b9:1f4a
References: <97e39685-a9a4-413c-b781-6e3ab2e713b4n@googlegroups.com>
<a0d196d5-42ed-4cde-821f-d3b21f68209bn@googlegroups.com> <e8c14270-a14d-4e84-a6ed-df57ffd79bdan@googlegroups.com>
<4b44bbe0-01e2-4bc8-bed9-29f5ba6f0babn@googlegroups.com> <5ee4ae0b-9037-480f-9507-5605ee1ce253n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <080eb1b5-0f2a-4118-8f61-8fd5a100ff88n@googlegroups.com>
Subject: Re: ESP32FORTH: music, tones and test
From: zbigniew...@gmail.com (Zbig)
Injection-Date: Sat, 23 Jul 2022 12:13:17 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1706
 by: Zbig - Sat, 23 Jul 2022 12:13 UTC

> > > Your code cannot work.
> > > You create a constant.....
> > You mean: your notes are of variable pitch? Must be some very modern
> > music... :) indeed, I meant notes rather in traditional sense.
> Have you tested my code with ESP32FORTH?

And have you tested my code with ESP32FORTH?

Re: ESP32FORTH: music, tones and test

<2c5e1596-1aa5-41f8-ba4f-02c8b348f074n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=23568&group=comp.lang.forth#23568

  copy link   Newsgroups: comp.lang.forth
X-Received: by 2002:a05:620a:458f:b0:759:2ac4:af2c with SMTP id bp15-20020a05620a458f00b007592ac4af2cmr3456302qkb.7.1684182315550;
Mon, 15 May 2023 13:25:15 -0700 (PDT)
X-Received: by 2002:ad4:55c7:0:b0:61a:ef78:d7f6 with SMTP id
bt7-20020ad455c7000000b0061aef78d7f6mr5777022qvb.2.1684182315315; Mon, 15 May
2023 13:25:15 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!feeder1.feed.usenet.farm!feed.usenet.farm!peer01.ams4!peer.am4.highwinds-media.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.forth
Date: Mon, 15 May 2023 13:25:15 -0700 (PDT)
In-Reply-To: <080eb1b5-0f2a-4118-8f61-8fd5a100ff88n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=83.22.136.2; posting-account=cxuXKwoAAABQpPOMD55A9IPz7pPrw6ml
NNTP-Posting-Host: 83.22.136.2
References: <97e39685-a9a4-413c-b781-6e3ab2e713b4n@googlegroups.com>
<a0d196d5-42ed-4cde-821f-d3b21f68209bn@googlegroups.com> <e8c14270-a14d-4e84-a6ed-df57ffd79bdan@googlegroups.com>
<4b44bbe0-01e2-4bc8-bed9-29f5ba6f0babn@googlegroups.com> <5ee4ae0b-9037-480f-9507-5605ee1ce253n@googlegroups.com>
<080eb1b5-0f2a-4118-8f61-8fd5a100ff88n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2c5e1596-1aa5-41f8-ba4f-02c8b348f074n@googlegroups.com>
Subject: Re: ESP32FORTH: music, tones and test
From: zbigniew...@gmail.com (Zbig)
Injection-Date: Mon, 15 May 2023 20:25:15 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2418
 by: Zbig - Mon, 15 May 2023 20:25 UTC

OK, having ESP32 board working I can fix — months later — that code.
Obviously I missed the fact, that the created note in fact doesn't
calculate a value and then leave it on the stack — for that purpose
the constant would do — but it does action instead: it plays the tone.
That keeps CREATE .. DOES> here, still not denying my basic idea
to make the code within 133-170 line range simpler and nicer:

: note
create dup 1+ swap ,
does> @ 1- get.note CHANNEL0 swap ledcWriteTone drop sustain.note ;

\ notes in english notation
1 \ initial 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

\ notes in french notation
1 \ initial value
note DO
note DO#
note RE
note RE#
note MI
note FA
note FA#
note SOL
note SOL#
note LA
note LA#
note SI
drop

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor