Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : CMM2 PLAY command
Author | Message | ||||
cletus3x Newbie Joined: 31/07/2020 Location: United StatesPosts: 17 |
Hi Shed crew, I am a N00b but had a few questions about the PLAY command and the FM output. So I really love how the CMM2 can output FLAC, MP3, MOD and WAV files right out of the box. As soon as I unboxed mine from Circuit Gizmo's I threw some MOD's on a time-warped right back to the early 90's. I have read the user manual and the programming manual and there did not seem to be a lot of detail on playing of these files and I was hoping the forum here could help me out with the following: - Some of the MOD files I try and play seem to lockup the CMM2, it does appear to be larger files. Is there a way to enable debug output and see what is going on? - The programming manual notes: "The PLAY command can also be instructed to play all files in a directory back-to-back and only signal an interrupt when the last file has completed playing. " - I could not find and example how does one do this? - How is the built-in player handling DAC output? I noticed the DAC in the processor is 2 x 12 bit, is this running a dac for each channel? What is the output? What is the highest quality the CMM2 can play? - Are we able to connect a I2S dac up to the unit like a Raspberry pi? I see the processor does have I2S in the data sheet. I wanted to look at trying to build a more full featured player for files as I thought it would be very cool. Thanks, -George CMM2 Demos: Kit Cat Clock BCD Clock Video |
||||
TweakerRay Senior Member Joined: 01/08/2020 Location: GermanyPosts: 138 |
Hi ! I also find the documentation for sound very lacking... I thought it would be much easier to programm sound on this machine or that it has a few channels which you can use... right now I have found out that you can't play mp3 files while the speak synth command is running... so the soundoptions to work with this machine are very limited... which I find very strange since I already saw a youtubevideo with a player which played chiptune... I don't know if that was made differently but I would love to know how you can a) use channels and how to do something like that: https://www.youtube.com/watch?v=wQ3vrV61PuY That is emulating a NES Soundchip... http://tweakerray.bandcamp.com |
||||
cletus3x Newbie Joined: 31/07/2020 Location: United StatesPosts: 17 |
TweakerRay, Thanks for the link! I'm glad I'm not the only one who thought sound documentation was lacking. Mauro is a wizard! I did see some of his demo's before. Awesome we can get his code off GitHub. -George CMM2 Demos: Kit Cat Clock BCD Clock Video |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8809 |
Manual page 76 One 12-bit DAC per channel each giving an output of 0-3.3V centred at 1.65V (c 1V RMS) From the manual No: not supported by the firmware The firmware uses an open-source mod file codec which seems pretty robust but may not cater for all variants. It has been tested using a 284Kbyte mod file which works fine. You will have to test mod files for compatibility before use in a program |
||||
capsikin Guru Joined: 30/06/2020 Location: AustraliaPosts: 341 |
The manual calls it "soundno" instead of channel but it's the same thing (except it uses "channel" for left vs right channel) (message update: it's only in the PLAY SOUND command, not PLAY TTS, PLAY MP3, or any others) Example: print "start hum" play sound 1,B,q,100 pause 500 print "zap sound, smooth" print "playing as sound number 2 while sound number 1 continues" for k=1 to 2 ' multiples of 50 cycles per second for n=800 to 100 step -50 play sound 2,B,q,n ' 20ms is a 50th of a second pause 20 next n next play sound 2,B,O,300 pause 500 play sound 1,B,O,300 end Edited 2020-08-09 11:05 by capsikin |
||||
berighteous Senior Member Joined: 18/07/2020 Location: United StatesPosts: 110 |
I have short 6 second wav files that I need to loop during the menus of my game. How do I do that? can someone show me a code snippet to load a wav and keep it looping until I choose to quit it? Here's the wav: OZ4.zip |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 8809 |
Two ways: Play it with an interrupt routine specified and play it again in the interrupt. Use PLAY STOP when you have had enough Use the code I posted in another thread to load it into an array and use the DAC command to play it in the background - you will have to search for the thread. |
||||
cletus3x Newbie Joined: 31/07/2020 Location: United StatesPosts: 17 |
matherp, I apologize I missed this on page 76 Duh, have to use empty string "" Any idea on how the DAC is handling 16 bit sources at only 12 bits? Anyway to debug output? Thanks, Edited 2020-08-13 00:48 by cletus3x CMM2 Demos: Kit Cat Clock BCD Clock Video |
||||
Print this page |