monome / monome/teletype

First PN.RND after P.SEED isn't random

Open
#337 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
222
Forks
94
PR merge metrics
No merged PRs in 30d

Description

Please describe the bug.

The first call to PN.RND always returns the same value, after seeding the randomization via P.SEED with any seed. Subsequent calls of PN.RND are random.

I'm happy to look into this, but please let me if you have any pointers or I'm misunderstanding the feature.

Please include the hash displayed at startup and the release of the software (e.g. "Teletype v2.0.1 5f838c9")

Teletype v5.0.0 00FDFD2

What steps are required to reproduce the bug?

fill pattern 0 with values
P.SEED x
PN.RND 0
will always return the same value, regardless of x

Alternatively, filling 0 with values, and pattern 1 with seeds, then create a script like:

P.SEED PN.NEXT1
PN.NEXT 2 PN.RND 0

then trigger the script repeatedly to fill pattern 2 with the same value

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with P.SEED and PN.RND, then locate the implementations of those commands in the Teletype C source. Compare the first PN.RND result with later calls and with different seeds. Done means the first result varies appropriately with the seed and repeated script execution no longer produces the same value.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.