Omnimaga

Calculator Community => Casio Calculators => Topic started by: Eiyeron on February 04, 2012, 05:42:21 pm

Title: [FXes and PRzim] MAking sound
Post by: Eiyeron on February 04, 2012, 05:42:21 pm
Hello there!
I makin' the post to work with the maximum of people who can help to working on making sound on Casios.
I know there is already Music players, but I really don't know how this is supposed to be and to work. That's why I wanted to make a unique post for the boh categories.
Prizms and FX are almost the same calcs.
With a friend, we could only get crackling noises, and awful result. I wonder if any goos result would be done, and maybe a tracker system, like TI real soundchip system, or Famitracker.
So here, we could work together to commit the maximum on infos on serials ports.
Could be this possible?
Title: Re: [FXes and PRzim] MAking sound
Post by: TIfanx1999 on February 05, 2012, 09:46:51 am
I'm sure it could be possible. It's something I'd love to see. I can't help myself, but hopefully some others will be interested. :)
Title: Re: [FXes and PRzim] MAking sound
Post by: Eiyeron on February 05, 2012, 09:57:21 am
I putted this post here, becasue This is a cross-project :-°
I jave two models: G35+ and Prizm
Title: Re: [FXes and PRzim] MAking sound
Post by: Juju on February 05, 2012, 02:02:28 pm
That would be pretty cool. I have a Prizm, if it could help.
Title: Re: [FXes and PRzim] MAking sound
Post by: DJ Omnimaga on February 05, 2012, 02:26:16 pm
I cannot help due to lack of ASM/C knowledge, but I guess I could test stuff.
Title: Re: [FXes and PRzim] MAking sound
Post by: MPoupe on February 06, 2012, 12:18:36 pm
Hello,
I have written the fxPlayer - multimedia player for 9860G calculators.
It can play wav sound through COM port.
Sources are on my page (http://martin.poupe.org/casio).
How can I help you ?

Martin


Title: Re: [FXes and PRzim] MAking sound
Post by: Eiyeron on February 06, 2012, 12:47:56 pm
If we can send a certain frequency a a certain time withouts problems, we'll reached the first milestone.

Next the project could have IMO two forks:
-Chiptune
-Music

I think the calcs could be goods for one-two chans

For music, MPoupe already did something is great, we could use his system to make that more flexible (maybe With timers, background music...)

Anyway, with the projects seen on TI, that is impossible to not get sound on Casio!
Title: Re: [FXes and PRzim] MAking sound
Post by: MPoupe on February 07, 2012, 04:20:44 am
If we can send a certain frequency a a certain time withouts problems, we'll reached the first milestone.
This should be easy on both calculators.
Just open the COM port on 9600 bps, no parity, 8 bits and output byte 0x55 in a loop.
This would produce square sound on 4800 Hz, time is driven by the loop (it sounds until you loop :-) ).
Use syscalls for opening port and sending data. For prizm see Simon's Mini SDK and for 9860G see (for example)
revolution-fx at http://revolution-fx.sourceforge.net/

You can produce only some frequencies this way. But I think you mentioned that this is enough for the first step.
Title: Re: [FXes and PRzim] MAking sound
Post by: Eiyeron on February 07, 2012, 02:20:10 pm
Yup, And we could use bits sensed like PWM, couldn't we?
Title: Re: [FXes and PRzim] MAking sound
Post by: MPoupe on February 08, 2012, 05:16:43 am
Yup, And we could use bits sensed like PWM, couldn't we?
Yes, but will have to increase the communication speed. I use ~ 1.8 Mbps
Title: Re: [FXes and PRzim] MAking sound
Post by: Eiyeron on February 08, 2012, 10:57:52 am
How? With over locking?
Title: Re: [FXes and PRzim] MAking sound
Post by: MPoupe on February 08, 2012, 11:18:50 am
How? With over locking?
Yes, I overclocked CPU to 2x, but I also set nonstandard speed by CPU registers. You will have to study the SH 7705 CPU datasheet.
(http://documentation.renesas.com/doc/products/mpumcu/rej09b0082_sh7705.pdf)
There was a nice collection of information at http://www.casiocalc.org/, but I cannot find it now :-(
Title: Re: [FXes and PRzim] MAking sound
Post by: Eiyeron on February 08, 2012, 11:39:41 am
How? With over locking?
Title: Re: [FXes and PRzim] MAking sound
Post by: KermMartian on February 08, 2012, 11:53:27 am
AHelper has been doing a ton of work on learning to make the link port on the Prizm do more nifty tricks, and I'll soon be trying some stuff of my own.  I believe AHelper has been documenting his work over at Cemetech, so you're welcome to double-check his topic.  I'll try to remember to return to this topic as well.
Title: Re: [FXes and PRzim] MAking sound
Post by: MPoupe on February 08, 2012, 12:14:31 pm
How? With over locking?
Look at the source code of the fxPlayer. There is everything. (It must be :-) )

AHelper has been doing a ton of work on learning to make the link port on the Prizm do more nifty tricks, and I'll soon be trying some stuff of my own.  I believe AHelper has been documenting his work over at Cemetech, so you're welcome to double-check his topic.  I'll try to remember to return to this topic as well.
Please post a link.
Title: Re: [FXes and PRzim] MAking sound
Post by: DJ Omnimaga on February 08, 2012, 02:49:21 pm
Given the Prizm and FX-9860G series got much faster CPUs than the 84+, I wonder if better sound than the 8 bit chiptunes from some 83+/84+ programs could be produced, such as Sega Genesis, Turbografx-16/PCEngine or PC88?



Now if only there was also a way to make volume higher...
Title: Re: [FXes and PRzim] MAking sound
Post by: Eiyeron on February 08, 2012, 03:04:02 pm
Genesis is 16-bit sampled music, sorry! :p
EDITED:
Yeah, I think there is Sample system like SNES: It uses PCm, and 2minutes loop of plain music would be a little big for a cartrige, no?
Okay, I'm tired, I seem to be trolling, but I don't want to be hurting...
Title: Re: [FXes and PRzim] MAking sound
Post by: DJ Omnimaga on February 08, 2012, 03:06:44 pm
Uhm sorry? I thought Genesis music was generated by the z80 CPU in the console? I do not recall Sega Genesis music using MIDI-like format like on the SNES (songs made of plenty of instrument samples) and it's nowhere close to WAV format (else quality would probably be terrible due to the ridiculous compression needed anyway).
Title: Re: [FXes and PRzim] MAking sound
Post by: Eiyeron on February 08, 2012, 03:15:39 pm
I think I misunderstood myself:
1-I think that MD/genesis uses FM and sample system.
2- longs plain audio files would be a little big for a cart, wouldn't it?
3- Excuse-me for my rudeness, I'm not accostumed with a neutral community (was on forums with an atmosphere more "only with firends")
4- And I think that Prizm... Oh, nevermind, maybe someone will show us a little good project, with beautiful graphics and marvellous music... GO FOR IT!
Title: Re: [FXes and PRzim] MAking sound
Post by: DJ Omnimaga on February 08, 2012, 03:32:44 pm
Well I just thought that if Sega Genesis music in every game used samples that the sound would be like in most SNES music rather than some chiptune-like bass and sounds. But again maybe they do. And yeah both consoles can't definitively support full actual songs, else they would take the entire cartridge even at extremely low compression.
Title: Re: [FXes and PRzim] MAking sound
Post by: MPoupe on February 09, 2012, 09:06:00 am
Given the Prizm and FX-9860G series got much faster CPUs than the 84+, I wonder if better sound than the 8 bit chiptunes from some 83+/84+ programs could be produced, such as Sega Genesis, Turbografx-16/PCEngine or PC88?
What quality do you expect ?
The uart running 1 bit D/A mode (without any HW support) is very expensive.
Assume we want output 8bit samples on 22 KHz mono (the worst quality which may be acceptable).
So we have 8 bit samples => 256 different values, so to send 1 sample we have to transmit 255 bits (round up to 256 bits =>  32 bytes).
This means we need to prepare 704000 bytes each second and overclock uart to 7040000 bps (count 10 bits for byte because of start bit and stop bit). The uart has fifo of 64 bytes, so the interrupt should fire each (less than) 90 us.
This all seems to be OK, but the 9860 is simply not capable of doing this.
My player runs uart on ~ 1.8 Mbps well, I tried double speed when measuring, but simple loop like
Code: [Select]
volatile i;
...
while(i)  //timer will reset after 1 second
{
com_transmit(0);
count++;
}
was not able to push bytes quick enough.
Title: Re: [FXes and PRzim] MAking sound
Post by: Eiyeron on February 09, 2012, 09:23:48 am
and register i?
Title: Re: [FXes and PRzim] MAking sound
Post by: MPoupe on February 09, 2012, 10:05:41 am
and register i?
The delay is in "com_transmit(0);" Communication with hardware is always much slower than memory access.
Title: Re: [FXes and PRzim] MAking sound
Post by: Eiyeron on February 09, 2012, 10:32:52 am
Ah, nevermind! :p
Title: Re: [FXes and PRzim] MAking sound
Post by: PierrotLL on February 13, 2012, 02:35:08 pm
Just open the COM port on 9600 bps, no parity, 8 bits and output byte 0x55 in a loop.

Thanks :)
Title: Re: [FXes and PRzim] MAking sound
Post by: Eiyeron on February 13, 2012, 02:53:25 pm
Interessed, Pierrot? I think you could have enough experience to lead us, nah?
Title: Re: [FXes and PRzim] MAking sound
Post by: flyingfisch on February 17, 2012, 10:28:58 am
Interessed, Pierrot? I think you could have enough experience to lead us, nah?

Hehe :-,
Title: Re: [FXes and PRzim] MAking sound
Post by: Eiyeron on February 17, 2012, 10:32:16 am
One of the best French programmers
Title: Re: [FXes and PRzim] MAking sound
Post by: flyingfisch on February 17, 2012, 10:41:37 am
One of the best French programmers

I know! That's why I said 'hehe' :D Because he does have enough experience (look at gravity duck)
Title: Re: [FXes and PRzim] MAking sound
Post by: Eiyeron on February 17, 2012, 10:49:35 am
I'm think too about KevKevVTT, he has too got good talent..
Title: Re: [FXes and PRzim] MAking sound
Post by: flyingfisch on February 17, 2012, 10:58:18 am
I'm think too about KevKevVTT, he has too got good talent..

Yes, Doodle Jump is quite good :)