This is because I found it was a bit more understandable to group register by functionnality.
r0 r1 and r10 are all related to channel A (freq an amplitude)
r2 r3 and r11 are all related to channel B
r4 r5 and r11 are all related to channel C
r13 and r14 both relates to Envelope period
etc .. etc ..
It is just a display log
Code: Select all
'r0' : 0 , # "ToneAFine",
'r1' : 0 , # "ToneACoarse",
'r2' : 0 , # "ToneBFine",
'r3' : 0 , # "ToneBCoarse",
'r4' : 0 , # "ToneCFine",
'r5' : 0 , # "ToneCCoarse",
'r6' : 0 , # "NoiseGenerator",
'r7' : 0x3F, # "Mixer",
'r10' : 0 , # "AmplitudeA",
'r11' : 0 , # "AmplitudeB",
'r12' : 0 , # "AmplitudeC",
'r13' : 0 , # "EnvelopeFine",
'r14' : 0 , # "EnvelopeCoarse",
'r15' : 0 , # "EnvelopeShapeCycle",
'r16' : 0 , # "IOA",
'r17' : 0 # "IOB",

I agree with you. There should be a seed. I presume the python module random auto generates a seed to initialize random generator because it generates different number sequence even without using a seed.jsk wrote: ↑Fri Jan 17, 2025 6:51 pm a) I'd assume to generate a music, you initialize the random number generator with a seed, and with this seed, and same random number generator (your own is better for predicatablility) it generates exactly the same music every time you run wherever? Don't see the seed.
But it the C program, at line 255, I use a seed to initialize my random generator
https://github.com/jbperin/OSME/blob/si ... ain.c#L255
Code: Select all
initRand(deek(0x276))
It is located at line 196 of genym.py
I want the music generator to generate 8 bars of music with 4 beat per bars at 60 beat per minute based on the 100 Hz interrupt.
Code: Select all
#8 bars * 4 beat/bar * 60/TEMPO(bpm) * 100 pulse/sec
for i in range(int(8*4*(60/Tempo)*100)):
I thought you had just to clone the repository, go into the directory tools and then run python genym.py (after replacing ugly hard coded path at line 280.
What's the matter with that ?
You're right, Euclide rhythm are only for beat .. It tells us when it is time to play a note.jsk wrote: ↑Fri Jan 17, 2025 6:51 pm
d) I looked at the Euclide webpage and it all seems simple, except, then somehow it's mapped to music! There seems to be some really clever stuff going on interpreting the "beats" soming out as single tune + chords + drum beats? Not sure how it gets there and what the theory is about it. Need to read some more!
As for the choice of the note, I use a random generator to select a note amongst the "proper" ones.
The "proper" ones are the one that do not violate harmony and music theory rules.
These rules are implemented in music.py
cadences are some basic chord progression that we can find in 95% of popular tunes.
chords are note numbers for every possible chord in a major scale.
scales are possible notes for each 7 unaltered scale
notefrequency is used to make the correspondance between note and register value in the AY
Google search "Music Theory Understanding Harmony". Many valuable resources.
Don't reinvent the wheel. ISS has published a clickable version of the ROM disassembly where all this routine are available. No need to code them.
Only simple 8 bits interger arithmetic (except the tempo counter which is 16 bits). No fix-point math here.
The fraction I'm referring here is a beat fraction to decompose the beat into 12 fractions.
Why 12 ? Because it the smallest multiple of 3 and 4.
Thus, with 12 fractions, I can adress both binary and ternary beat decomposition

12 is a very good number.
It's a pity that men had 10 fingers and then based the arithmetic on 10.. a 12 based numerical system would have been far better for mankind.
12 is also good to deal with angle and many other things. But it is an other debate.
Very interesting idea. I remember that ISS was looking for this kind of stuff some times ago.
Some unix user use Wine to run the OSDK when they have to. ISS is one of them.
Thank you for your interest in euclidian rhythms and my code. I hope I could answer some of your questions.