Cubic Bezier Curves

ZX80, ZX 81, ZX Spectrum, TS2068 and other clones
Post Reply
andydansby
Member
Posts: 51
Joined: Fri May 27, 2016 8:58 pm

Cubic Bezier Curves

Post by andydansby »

I don't know how many will find this interesting, but I've released a new Z88dk mini project to calculate Bezier Curves.

https://github.com/andydansby/ZX_bezier_curves

This does not have any fancy interfaces, you manually enter your P0 - P3 points and then press Q - W - E - R or T to draw the Cubic Bezier curve.

Perhaps someone might find use for it, but enjoy if you like to play with this sort of thing.

Enjoy
Andy Dansby
andydansby
Member
Posts: 51
Joined: Fri May 27, 2016 8:58 pm

Re: Cubic Bezier Curves

Post by andydansby »

Just added Forward Differencing Bezier. It's zippy fast
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: Cubic Bezier Curves

Post by stefano »

it's an interesting project definitely, but, duh.. why are you plotting in that way?
andydansby
Member
Posts: 51
Joined: Fri May 27, 2016 8:58 pm

Re: Cubic Bezier Curves

Post by andydansby »

I am certainly open to suggestions, I don't know any other way. Since the technique that I'm using works I have stuck with it for several test projects.
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: Cubic Bezier Curves

Post by cborn »

Can you make a voice on AY with it? it would be a different type off "enveloppe".
andydansby
Member
Posts: 51
Joined: Fri May 27, 2016 8:58 pm

Re: Cubic Bezier Curves

Post by andydansby »

cborn wrote: Fri Jun 18, 2021 11:03 pm Can you make a voice on AY with it? it would be a different type off "enveloppe".
I would normally say no to that question, but anytime I do, somebody proves me wrong.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Re: Cubic Bezier Curves

Post by stefano »

Andy, I thought the (portable) classic graphics library was accessible from the "new" lib but I was wrong. Sorry for the misleading comment.
andydansby
Member
Posts: 51
Joined: Fri May 27, 2016 8:58 pm

Re: Cubic Bezier Curves

Post by andydansby »

stefano wrote: Mon Jun 21, 2021 4:38 pm Andy, I thought the (portable) classic graphics library was accessible from the "new" lib but I was wrong. Sorry for the misleading comment.
The classic graphics library would certainly be nice to use with the new library. At one point Allen told me the reason of why that is but for the life of me I can't find that conversation. That particular plot was given to me by Allen because I couldn't figure it out.

Andy
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: Cubic Bezier Curves

Post by cborn »

andydansby wrote: Sat Jun 19, 2021 11:15 am
cborn wrote: Fri Jun 18, 2021 11:03 pm Can you make a voice on AY with it? it would be a different type off "enveloppe".
I would normally say no to that question, but anytime I do, somebody proves me wrong.
Hi, not to be anoying but this link seems to be proving it
https://www.youtube.com/watch?v=zXeLTE2WnEw

actualy it could be usefull for the 50hz speech from AA, at least i hope so.
but he wrote a standalone and sells it. i dont know the langage. it reminds me a bit to PUREdata which is intreting to,
but this is all off topic since you are drawing pictures, and not making sound with it.
cheers
chris
andydansby
Member
Posts: 51
Joined: Fri May 27, 2016 8:58 pm

Re: Cubic Bezier Curves

Post by andydansby »

I am not entirely quite sure what I just saw, as the video had no real context, so I had to google to find it.

https://dinisnoise.org/?what=about

Looks interesting, but I this is a modern PC application, but the noises it makes is really interesting. I don't this that this could be a native Z80 program as it would be too slow. But, I'm wondering now if there's a way to create the effects on a windows PC and be able to use them for the AY. This would be far above my knowledge base. Cborn, you're going to have to find someone smarter than me on this.
Timmy
Well known member
Posts: 392
Joined: Sat Mar 10, 2012 4:18 pm

Re: Cubic Bezier Curves

Post by Timmy »

Of course you can create regular envelopes using bezier curves or any other mathematical function. But now you will have to send this data to the AY every millisecond. That means all you get are simple envelopes while there is no CPU time left for games.

Therefore it's not really much more efficient, and it would make worse sound than just using samples or a tracker.
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: Cubic Bezier Curves

Post by cborn »

@andydansby yes, thats the source.
@timmy Actualy i am pointing to a 50hz effect
https://worldofspectrum.org/forums/disc ... ent_882779
https://worldofspectrum.org/forums/disc ... ent_882854
but i am not a c programmer yet, so for me its a 10year mountain climb. but techncly there are possibilities that it might work, even on zx with ay
""can be found in z_play.asm"" so, in asm i do have a chance, but that aint a bezier library in c.
andydansby
Member
Posts: 51
Joined: Fri May 27, 2016 8:58 pm

Re: Cubic Bezier Curves

Post by andydansby »

@cborn
If interesting and customizable sound effects is what you are interested in, you may want to check out the Arkos 2 tracker.https://www.julien-nevo.com/arkostracker/ . It has quite a bit of flexibility in the software, and the ability to create interesting effects.
Timmy
Well known member
Posts: 392
Joined: Sat Mar 10, 2012 4:18 pm

Re: Cubic Bezier Curves

Post by Timmy »

I agree. If you just want a 50hz effect, just use a tracker. It can play good music already, and 90% of all existing Spectrum AY music is already 50hz.
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: Cubic Bezier Curves

Post by cborn »

I have arkos tracker installed and actualy i did not check it for speech on ay.
becouse thats what AA made and from where i think bezier might have use. for a better sound of the voice.

"But I also tried the 50Hz speech synthesis. Here is the result:
https://drive.google.com/file/d/0B6XhJJ ... sp=sharing\
"
pitty a password is needed. i dont think that used to be like that. google changed something...
my simplistic thoughts were only to make the voice curves smoother with bezier calculations.
andydansby
Member
Posts: 51
Joined: Fri May 27, 2016 8:58 pm

Re: Cubic Bezier Curves

Post by andydansby »

I downloaded those files and started playing around. Interesting examples. My opinion is that the WAV files are a bit complex to be playing on the Speccy without them sounding really distorted. It appears that to clean up the files and recompile them we need to run voicenc https://sites.google.com/site/voicesynt ... est-files/, which now goes into the world of MATLAB. That's a whole different realm. I have played with Matlab a little but not enough be be really knowledgeable. I'm going to play with it a little in the future to see if I can get cleaner examples. Who knows what rabbit hole I may encounter but I do not own Matlab and thus will not be able to play with the .m file.

I think that there might have been a Math program out there is somewhat compatible with MATLAB, but can't remember what it is at the time.

andy
cborn
Well known member
Posts: 267
Joined: Tue Oct 06, 2020 7:45 pm

Re: Cubic Bezier Curves

Post by cborn »

I downloaded those files but actualy dont know what to do with them. i have problems reading the faint grey lettertjes.
i found a page about matlab alternatives, but it looks commercial
https://www.educba.com/matlab-alternatives/
yet they link this
https://www.tutorialspoint.com/matlab/m ... erview.htm
reading wont hurt, not much anyway. i hope to get the picture...
my only experience with 'voice' on zx is porting an MSX pure sample routine and making the dis-assembler of some speech programms.
Post Reply