Royalty Free Musics for your Oric Games

Probably the most technical forum around. It does not have to be coding related, or assembly code only. Just talk about how you can use the AY chip to do cool sounding things :)
User avatar
jbperin
Squad Leader
Posts: 542
Joined: Wed Nov 06, 2019 11:00 am
Location: Valence, France

Re: Royalty Free Musics for your Oric Games

Post by jbperin »

jsk wrote: Fri Jan 17, 2025 6:51 pm
Not sure why in tools/gensym.py it prints out the values in a strinage order, doesn't seem to be r0..r13?
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",
So, here is my ignorance, as the code is a bit OO ;-)
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.
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.
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))
jsk wrote: Fri Jan 17, 2025 6:51 pm
b) I'd assume you can also input how long/many samples you want it to generate? How?
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)):
jsk wrote: Fri Jan 17, 2025 6:51 pm c) If I could just see a simple version that outputs r0..r13 and I just need to pump it to the AY just like that every 50Hz clock interrupt, that'd be easy.
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 ?
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!
You're right, Euclide rhythm are only for beat .. It tells us when it is time to play a note.
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
jsk wrote: Fri Jan 17, 2025 6:51 pm Any links to more indepts algos, examples?
Google search "Music Theory Understanding Harmony". Many valuable resources.
jsk wrote: Fri Jan 17, 2025 6:51 pm
e) I just coded MUSIC/SOUND/PLAY for oric raw, TODAY!, without relying on the ROM. More or less works... This would be an excellent usage of it! LOL And incidentally, I did just test to have a C-routine called 50x per/s by interrupt... So this is doable.
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.

jsk wrote: Fri Jan 17, 2025 6:51 pm
d) is this all integer math, or does it rely on more advanced math? I see fractions being mentioned. I'm guessing with your 3D-expericence you use some variant of fix-point math!
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 :D
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.

jsk wrote: Fri Jan 17, 2025 6:51 pm e) I've written various C-implementations of float point math (dec24, dec30) that basically just implements + - * / so far...
Very interesting idea. I remember that ISS was looking for this kind of stuff some times ago.

jsk wrote: Fri Jan 17, 2025 6:51 pm Since I'm not on a PC I rely on ONLY cc65 under Linux/termux(Android) actually, and typically very simple build-procedures. I think it's good enough to prototype and if you push it, using char etc for indexing it generates descent simple code.
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.
User avatar
xahmol
Squad Leader
Posts: 611
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: Royalty Free Musics for your Oric Games

Post by xahmol »

jbperin wrote: Sat Jan 18, 2025 11:51 am Some unix user use Wine to run the OSDK when they have to. ISS is one of them.
Actually do not think Iss is using Wine as he learned me how to compile OSDK for Linux…..
So I think he does the same as me, use the Linux compiled version of the OSDK tools.

See https://forum.defence-force.org/viewtop ... 7&start=30

Only thing is this is an old thread and OSDN is gone by now, never actually tried to compile OSDK from GitHub yet. But assume it should still work.

Myself on my latest projects do not use OSDK anymore. Never used its compiler and assembler anyway as I use CC65. And for programming to the Loci API I now create .tap files directly from CC65 instead of using OSDK tools to create DSK disk images from those TAPs.
Do not even use Oricutron for debugging anymore as Oricutron does not emulate the Loci yet.
But assume my Linux compiled binaries of OSDK still work, not many changes in OSDK either since apart from Oricutron getting some version bumps.

(By the way: interesting topic, but as one of my two Atmosses has a party not working keyboard and on my other the sound is gone, I have to do some fixing first before being able to try this on real hardware. That fixing will probably be combining my two machines by placing the better keyboard on the machine with sound, but first want to finish my present programming projects as there is always a risk in assembling old hardware and do not want to risk not having a working computer altogether with my projects unfinished).
Last edited by xahmol on Sat Jan 18, 2025 12:15 pm, edited 1 time in total.
User avatar
jbperin
Squad Leader
Posts: 542
Joined: Wed Nov 06, 2019 11:00 am
Location: Valence, France

Re: Royalty Free Musics for your Oric Games

Post by jbperin »

xahmol wrote: Sat Jan 18, 2025 11:55 am Actually do not think Iss is using Wine as he learned me how to compile OSDK for Linux…..
Oups sorry for my mistake.

Perhaps he used to use WINE and no longer do because he found a better solution.

Anyway, I read somewhere that someone was using WINE to use OSDK .. but I can't remember where.
xahmol wrote: Sat Jan 18, 2025 11:55 am See https://forum.defence-force.org/viewtop ... 7&start=30
Thank you .. valuable thread .. I had missed it :D
jsk
Officer Cadet
Posts: 45
Joined: Mon Jun 29, 2020 10:11 pm

Re: Royalty Free Musics for your Oric Games

Post by jsk »

jbperin wrote: Sat Jan 18, 2025 11:51 am 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)):
jsk wrote: Fri Jan 17, 2025 6:51 pm c) If I could just see a simple version that outputs r0..r13 and I just need to pump it to the AY just like that every 50Hz clock interrupt, that'd be easy.
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 ?
...
Google search "Music Theory Understanding Harmony". Many valuable resources.
jsk wrote: Fri Jan 17, 2025 6:51 pm
e) I just coded MUSIC/SOUND/PLAY for oric raw, TODAY!, without relying on the ROM. More or less works... This would be an excellent usage of it! LOL And incidentally, I did just test to have a C-routine called 50x per/s by interrupt... So this is doable.
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.
jsk wrote: Fri Jan 17, 2025 6:51 pm
d) is this all integer math, or does it rely on more advanced math? I see fractions being mentioned. I'm guessing with your 3D-expericence you use some variant of fix-point math!
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 :D
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.

jsk wrote: Fri Jan 17, 2025 6:51 pm I've written various C-implementations of float point math (dec24, dec30) that basically just implements + - * / so far...
Very interesting idea. I remember that ISS was looking for this kind of stuff some times ago.

jsk wrote: Fri Jan 17, 2025 6:51 pm Since I'm not on a PC I rely on ONLY cc65 under Linux/termux(Android) actually, and typically very simple build-procedures. I think it's good enough to prototype and if you push it, using char etc for indexing it generates descent simple code.
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.
[/quote]

Yes, thanks!

I done my own simple routines, but I made them in C which for setAYreg(r,v) is only 4 lines of code...


If I didn't want to re-invent the wheel I'd not be doing ORIC stuff ;-)

I prefer to use C as much, My target is a new ROM under Loci so I'm reimplementing so there is no reliance on ORIC BASIC ROM...

Maybe a foolhardy task but... Have hires and conio/keyboard/screen/terminal, all in C, more or less working, sounds functions, etc.

I'm using cc65, too. But I was fooled by the presence of the following files: osdk_build.bat osdk_config.bat osdk_execute.bat osdk_showmap.bat lol

Anyway, it wasn't abvious how to build it so I couldn't:

Maybe a file/config missing?

I typically always have a ./run file that builds and invokes the main program.

Code: Select all

cl65 *.c *.s
compose.c(21): Error: Undefined symbol: 'scales'
compose.c(21): Error: Subscripted value is neither array nor pointer
compose.c(21): Warning: Converting integer to pointer without a cast
compose.c(22): Error: Undefined symbol: 'theCadence'
compose.c(22): Warning: Converting integer to pointer without a cast
compose.c(24): Error: Undefined symbol: 'chords'
compose.c(24): Error: Subscripted value is neither array nor pointer
compose.c(24): Warning: Converting integer to pointer without a cast
compose.c(41): Error: Undefined symbol: 'tmp_kernel_fraction'
compose.c(43): Error: Undefined symbol: 'curr_frame'
compose.c(43): Error: Undefined symbol: 'R10'
compose.c(43): Error: Subscripted value is neither array nor pointer
compose.c(44): Error: Undefined symbol: 'R15'
compose.c(44): Error: Subscripted value is neither array nor pointer
compose.c(44): Fatal: Too many errors
User avatar
iss
Wing Commander
Posts: 1789
Joined: Sat Apr 03, 2010 5:43 pm
Location: Bulgaria
Contact:

Re: Royalty Free Musics for your Oric Games

Post by iss »

OSDK can be build for Linux from sources "as is" (well, with some minor touches), so I never used wine for it.
This programs:

Code: Select all

bas2tap compiler MemMap FloppyBuilder Ym2Mym DskTool TapTool tap2cd
require additional tweaking but nothing special ... and (surprise, surprise) this works for macOS too :D
macOS need fixes for opt65 pictconv tap2dsk which I didn't had time to make.
User avatar
ibisum
Wing Commander
Posts: 1912
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: Royalty Free Musics for your Oric Games

Post by ibisum »

I'm on MacOS and I use Wine to run the OSDK tools directly from a Makefile in vim. Its quite convenient, I have my wine configred to preload and so on, so to me its just another command that can be run.

I also have a locally built version of the OSDK toolchain but I prefer to just use the "official .exe's" and Wine is smooth and easy to use.

OSDK also runs in a FreeDOS-based QEMU VM, which, if you get networking set up, is a super-fast way of doing OSDK-based builds .. I have one of these somewhere, but .. I'm okay with Wine for now. ;)
User avatar
jbperin
Squad Leader
Posts: 542
Joined: Wed Nov 06, 2019 11:00 am
Location: Valence, France

Re: Royalty Free Musics for your Oric Games

Post by jbperin »

Sorry for my late reply.
jsk wrote: Sat Jan 18, 2025 1:34 pm I done my own simple routines, but I made them in C which for setAYreg(r,v) is only 4 lines of code...
It's ok for me but you have to bear in mind that it is very unlikely that a C routine can be used in a 50Hz IT handler.
Writings to AY chip are usually done in an IT handler and an IT handler is usually written in ASM because it has to be ultra mega fast.
I really don't think you can call your setAYreg(r,v) from an IT handler.

jsk wrote: Sat Jan 18, 2025 1:34 pm
Anyway, it wasn't abvious how to build it so I couldn't:

Maybe a file/config missing?
I don't use the ca65 chain, I work with OSDK so I can't help you with your chain.
Personally, here's the way I build and run the little program:

Code: Select all

git clone --single-branch --depth 1 --branch simplify-score https://github.com/jbperin/OSME.git
cd OSME
osdk_build.bat && osdk_execute.bat
This little program is basically composed of two things:
- A main task, written in C and interruptabl,e that spends all its time to "compose" music .. (which means to prepare registers R0 to R13 and store them into a big buffer)
- An IT handler written in ASM that is used as a prioritary 50 Hz task and that pops register stacked by the main task and write them to the AY chip.

Samples are generated by the procedure prepare_1s_music
this procedure fills the _ay_score defined in score_s.s

Each time the IT handlers executes,
it runs the stepReadScore procedure
which just retreives a set of register value (for R0 to R13) from the _ay_score and send them to the AY chip.

But the ultimate target for me is to get rid of the C part and the intermediary buffer and have the composition done right into the IT handler.

It is designed to be possible because the composition part is spread into three different moments:
- the 50 Hz handler myIt50Hz
- the beat fraction (1/12 of a beat) handler
- the beat handler

Once I will have convert these routines in ASM I will put them in the corresponding, and already existing, IT handler section:

- IT handler in osmePulse
- Beat fraction in task_fraction
- Beat in task_beat

And then the main task will no longer have something to do because all the music generation will be done in the IT handler.
Infinite music with almost no data to store.
My plan is that it will make me rich and famous.

jsk wrote: Sat Jan 18, 2025 1:34 pm
I typically always have a ./run file that builds and invokes the main program.

Code: Select all

cl65 *.c *.s
compose.c(21): Error: Undefined symbol: 'scales'
compose.c(21): Error: Subscripted value is neither array nor pointer
compose.c(21): Warning: Converting integer to pointer without a cast
compose.c(22): Error: Undefined symbol: 'theCadence'
compose.c(22): Warning: Converting integer to pointer without a cast
compose.c(24): Error: Undefined symbol: 'chords'
compose.c(24): Error: Subscripted value is neither array nor pointer
compose.c(24): Warning: Converting integer to pointer without a cast
compose.c(41): Error: Undefined symbol: 'tmp_kernel_fraction'
compose.c(43): Error: Undefined symbol: 'curr_frame'
compose.c(43): Error: Undefined symbol: 'R10'
compose.c(43): Error: Subscripted value is neither array nor pointer
compose.c(44): Error: Undefined symbol: 'R15'
compose.c(44): Error: Subscripted value is neither array nor pointer
compose.c(44): Fatal: Too many errors
As I mentionned erarlierk I don't much about the ca65 chain. So I can't really help.
But what I can say regarding the error message is that:
'scales', 'theCadence', 'chords' are all defined in music.c

I prebuilt a version of this little program that auto-generate the music it plays.
Here it is:
automusic.tap
(15.68 KiB) Downloaded 17 times
This program realtime compose the music that it plays.
By paying attention to the screen refresh, you will notice that the main task spend all its time composing and barely manage to feed enough record for the IT handler not to run out of sample to play.
User avatar
Dbug
Site Admin
Posts: 4935
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Royalty Free Musics for your Oric Games

Post by Dbug »

jbperin wrote: Thu Jan 23, 2025 2:23 pm
jsk wrote: Sat Jan 18, 2025 1:34 pm I done my own simple routines, but I made them in C which for setAYreg(r,v) is only 4 lines of code...
It's ok for me but you have to bear in mind that it is very unlikely that a C routine can be used in a 50Hz IT handler.
Writings to AY chip are usually done in an IT handler and an IT handler is usually written in ASM because it has to be ultra mega fast.
I really don't think you can call your setAYreg(r,v) from an IT handler.
The main problem with IRQ handlers in C is that the C compiler needs to be aware it's running in IRQ else there's a risk that the temporary variables (generally in zero page) overwrite whatever is being used by the main program running behind.
User avatar
xahmol
Squad Leader
Posts: 611
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: Royalty Free Musics for your Oric Games

Post by xahmol »

Dbug wrote: Thu Jan 23, 2025 4:19 pm The main problem with IRQ handlers in C is that the C compiler needs to be aware it's running in IRQ else there's a risk that the temporary variables (generally in zero page) overwrite whatever is being used by the main program running behind.
I never use the IRQ handler system made by CC65 itself, always use my own IRQ handler with indeed only machine code being called.

And I always either ensure that the routines called by IRQ have own dedicated zeropage space, or that every zero page address used is temporarily stored on entry and restored on exit of the IRQ.

But again, sorry to be repetitive, Oscar64 as C compiler creates such efficient and fast code that for that compiler on the C64 you could actually use C within the IRQ routines.

Never did much with IRQ on Oric though apart from using the MYM music routines by DBug.
User avatar
ibisum
Wing Commander
Posts: 1912
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: Royalty Free Musics for your Oric Games

Post by ibisum »

But again, sorry to be repetitive, Oscar64 as C compiler creates such efficient and fast code that for that compiler on the C64 you could actually use C within the IRQ routines.
I put in an issue to get a port done, maybe we can see this happening some time soon ..
User avatar
xahmol
Squad Leader
Posts: 611
Joined: Sun Jun 28, 2020 7:32 pm
Location: Utrecht, The Netherlands
Contact:

Re: Royalty Free Musics for your Oric Games

Post by xahmol »

ibisum wrote: Thu Jan 23, 2025 7:49 pm I put in an issue to get a port done, maybe we can see this happening some time soon ..
Haha, spoke extensively to its creator before on many things, but also this.
His answer was then ‘do not have an Oric, but please feel free to add the target yourself’.

So guess it would take one of us. And actually considering it, but not have time any time soon.
User avatar
ibisum
Wing Commander
Posts: 1912
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: Royalty Free Musics for your Oric Games

Post by ibisum »

I started a breadcrumb thread, maybe you have some time for some input - actually doesn't look like it would be too difficult, the most perplexing thing to me is the writeTapFile function, but I'm sure even that could be spec'ed from other OSDK tools ..

https://forum.defence-force.org/viewtopic.php?t=2701
jsk
Officer Cadet
Posts: 45
Joined: Mon Jun 29, 2020 10:11 pm

Re: Royalty Free Musics for your Oric Games

Post by jsk »

Dbug wrote: Thu Jan 23, 2025 4:19 pm
jbperin wrote: Thu Jan 23, 2025 2:23 pm
jsk wrote: Sat Jan 18, 2025 1:34 pm I done my own simple routines, but I made them in C which for setAYreg(r,v) is only 4 lines of code...
It's ok for me but you have to bear in mind that it is very unlikely that a C routine can be used in a 50Hz IT handler.
Writings to AY chip are usually done in an IT handler and an IT handler is usually written in ASM because it has to be ultra mega fast.
I really don't think you can call your setAYreg(r,v) from an IT handler.
The main problem with IRQ handlers in C is that the C compiler needs to be aware it's running in IRQ else there's a risk that the temporary variables (generally in zero page) overwrite whatever is being used by the main program running behind.
'

cc65 has nice "hook-me-up" routines for using interupts from C. Of course there is overhead, as it saves (few) temporary zero-page variables. But, generally, cc65 doesn't assume too much about registers containing specific values after "other" function-calls. Thus,
it's more correct most of the time (which is another way of saying - not too super-duper-optimizations)., However, this is one of it's benefits, it generally does what it should do, and has "relative compact code".

I like to push C, and occasionally look at the generate .s code files to see what construct will be faster/save bytes. Eventually, one may move to ASM, but it makes the whole building more complicated.
jsk
Officer Cadet
Posts: 45
Joined: Mon Jun 29, 2020 10:11 pm

Re: Royalty Free Musics for your Oric Games

Post by jsk »

jbperin wrote: Thu Jan 23, 2025 2:23 pm Sorry for my late reply.
jsk wrote: Sat Jan 18, 2025 1:34 pm I done my own simple routines, but I made them in C which for setAYreg(r,v) is only 4 lines of code...
It's ok for me but you have to bear in mind that it is very unlikely that a C routine can be used in a 50Hz IT handler.
Writings to AY chip are usually done in an IT handler and an IT handler is usually written in ASM because it has to be ultra mega fast.
I really don't think you can call your setAYreg(r,v) from an IT handler.

jsk wrote: Sat Jan 18, 2025 1:34 pm
Anyway, it wasn't abvious how to build it so I couldn't:

Maybe a file/config missing?
I don't use the ca65 chain, I work with OSDK so I can't help you with your chain.
Personally, here's the way I build and run the little program:

Code: Select all

git clone --single-branch --depth 1 --branch simplify-score https://github.com/jbperin/OSME.git
cd OSME
osdk_build.bat && osdk_execute.bat
This little program is basically composed of two things:
- A main task, written in C and interruptabl,e that spends all its time to "compose" music .. (which means to prepare registers R0 to R13 and store them into a big buffer)
- An IT handler written in ASM that is used as a prioritary 50 Hz task and that pops register stacked by the main task and write them to the AY chip.

Samples are generated by the procedure prepare_1s_music
this procedure fills the _ay_score defined in score_s.s

Each time the IT handlers executes,
it runs the stepReadScore procedure
which just retreives a set of register value (for R0 to R13) from the _ay_score and send them to the AY chip.

But the ultimate target for me is to get rid of the C part and the intermediary buffer and have the composition done right into the IT handler.

It is designed to be possible because the composition part is spread into three different moments:
- the 50 Hz handler myIt50Hz
- the beat fraction (1/12 of a beat) handler
- the beat handler

Once I will have convert these routines in ASM I will put them in the corresponding, and already existing, IT handler section:

- IT handler in osmePulse
- Beat fraction in task_fraction
- Beat in task_beat

And then the main task will no longer have something to do because all the music generation will be done in the IT handler.
Infinite music with almost no data to store.
My plan is that it will make me rich and famous.

jsk wrote: Sat Jan 18, 2025 1:34 pm
I typically always have a ./run file that builds and invokes the main program.

Code: Select all

cl65 *.c *.s
compose.c(21): Error: Undefined symbol: 'scales'
compose.c(21): Error: Subscripted value is neither array nor pointer
compose.c(21): Warning: Converting integer to pointer without a cast
compose.c(22): Error: Undefined symbol: 'theCadence'
compose.c(22): Warning: Converting integer to pointer without a cast
compose.c(24): Error: Undefined symbol: 'chords'
compose.c(24): Error: Subscripted value is neither array nor pointer
compose.c(24): Warning: Converting integer to pointer without a cast
compose.c(41): Error: Undefined symbol: 'tmp_kernel_fraction'
compose.c(43): Error: Undefined symbol: 'curr_frame'
compose.c(43): Error: Undefined symbol: 'R10'
compose.c(43): Error: Subscripted value is neither array nor pointer
compose.c(44): Error: Undefined symbol: 'R15'
compose.c(44): Error: Subscripted value is neither array nor pointer
compose.c(44): Fatal: Too many errors
As I mentionned erarlierk I don't much about the ca65 chain. So I can't really help.
But what I can say regarding the error message is that:
'scales', 'theCadence', 'chords' are all defined in music.c

I prebuilt a version of this little program that auto-generate the music it plays.
Here it is:
automusic.tap

This program realtime compose the music that it plays.
By paying attention to the screen refresh, you will notice that the main task spend all its time composing and barely manage to feed enough record for the IT handler not to run out of sample to play.
'
ok, thanks for the verification comparable tap file. It seems the switching of the "chords" (3 tones extra?) is causing a little bit of "noise", not sure if this is only emulator related or not(?).

This is what I get with my "straight C-player", not yet interrupt-driven, it uses a waitms(17); between each sample. Of course timing is a little bit off, but closer.

I like to push the limits of pure-C.

Not sure about the quality of the sound? Do you have real-oric to compare it on?
Attachments
ymplay.tap
(17.61 KiB) Downloaded 8 times
Post Reply