Jump to content
Serguei2

Tome 3 + Noise can't be heard

Recommended Posts

I can't make noise sound to hear.

 

Quote

#include <coleco.h>
#include <getput1.h>

const byte sound1[] = {
 0x40,0xAB,0x01,0x08,0x42,0xAB,0x71,0x08,0x18,0x11,0x50,
};
const byte sound2[] = {
 0x80,0x5A,0x00,0x08,0x82,0x5A,0x70,0x08,0x18,0x11,0x90,
};
const byte sound3[] = {
 0xC0,0x20,0xF0,0x10,0xD0,0x00,0x00,0x03,0x08,0x02,0x73,0x08,0x18,0x11,0x10,
};
const sound_t snd_table[] = {
  {sound1,SOUNDAREA1},
  {sound2,SOUNDAREA2},
  {sound3,SOUNDAREA6},
};

const byte gtsNAME[] = {
  0xFE, 0x20, 0xFE, 0x20, 0xFE, 0x20, 0xFE, 0x20, 0xFE, 0x20, 0xFE, 0x20, 0x85, 0x20, 0xFF};

const byte gtsPATTERN[] = {
  0xFE, 0x00, 0xFE, 0x00, 0x89, 0x00, 0x01, 0x1C, 0x38, 0x82, 0x18, 0x02, 0x00, 0x18, 0x18,
  0x82, 0x66, 0x85, 0x00, 0x21, 0x44, 0xFE, 0x44, 0x44, 0xFE, 0x44, 0x00, 0x18, 0x3E, 0x60, 0x3C,
  0x06, 0x7C, 0x18, 0x00, 0xFF, 0x81, 0xB9, 0xA5, 0xB9, 0xA5, 0x81, 0xFF, 0x3C, 0x66, 0x3C, 0x38,
  0x67, 0x66, 0x3F, 0x00, 0x06, 0x0C, 0x18, 0x84, 0x00, 0x01, 0x0C, 0x18, 0x82, 0x30, 0x04, 0x18,
  0x0C, 0x00, 0x30, 0x18, 0x82, 0x0C, 0x08, 0x18, 0x30, 0x00, 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66,
  0x82, 0x00, 0x81, 0x18, 0x02, 0x7E, 0x18, 0x18, 0x86, 0x00, 0x81, 0x18, 0x00, 0x30, 0x82, 0x00,
  0x00, 0x7E, 0x88, 0x00, 0x81, 0x18, 0x81, 0x00, 0x10, 0x03, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x00,
  0x3C, 0x66, 0xCE, 0xD6, 0xE6, 0xCC, 0x78, 0x00, 0x18, 0x38, 0x83, 0x18, 0x2C, 0x1C, 0x30, 0x0E,
  0x1E, 0x36, 0x06, 0xFC, 0xC0, 0xFE, 0x00, 0x0E, 0x1E, 0x36, 0x06, 0x3C, 0x86, 0xFE, 0x00, 0x0E,
  0x1E, 0x36, 0x66, 0xFE, 0x06, 0x06, 0x00, 0x1E, 0x3E, 0x70, 0xE0, 0xFC, 0x0E, 0xFE, 0x00, 0x0E,
  0x1E, 0x30, 0x60, 0xDE, 0xF2, 0xFE, 0x00, 0x7E, 0xC6, 0x0C, 0x82, 0x18, 0x18, 0x1C, 0x30, 0x1E,
  0x3E, 0x66, 0x66, 0xFC, 0xC6, 0xFE, 0x00, 0x3C, 0x66, 0xCE, 0xFE, 0x06, 0x0C, 0x38, 0x00, 0x00,
  0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x82, 0x00, 0x0C, 0x18, 0x00, 0x00, 0x18, 0x18, 0x30, 0x0E,
  0x18, 0x30, 0x60, 0x30, 0x18, 0x0E, 0x82, 0x00, 0x02, 0x7E, 0x00, 0x7E, 0x82, 0x00, 0x0F, 0x70,
  0x18, 0x0C, 0x06, 0x0C, 0x18, 0x70, 0x00, 0x1E, 0x3E, 0x66, 0x06, 0x18, 0x18, 0x00, 0x18, 0x87,
  0x00, 0x38, 0x0E, 0x1E, 0x36, 0x66, 0xFE, 0xC6, 0xC6, 0x00, 0x0E, 0x1E, 0x26, 0x66, 0xFC, 0xC6,
  0xFE, 0x00, 0x0E, 0x1E, 0x32, 0x60, 0xC0, 0xC2, 0xFE, 0x00, 0xE0, 0xF0, 0xD8, 0xCC, 0xC6, 0xCE,
  0xFC, 0x00, 0x0E, 0x1E, 0x30, 0x60, 0xFC, 0xC0, 0xFE, 0x00, 0x0E, 0x1E, 0x30, 0x60, 0xFC, 0xC0,
  0xC0, 0x00, 0x0E, 0x1E, 0x32, 0x60, 0xCE, 0xC2, 0xFE, 0x00, 0x26, 0x82, 0x66, 0x05, 0xFE, 0xC6,
  0xC6, 0x00, 0x1C, 0x78, 0x83, 0x18, 0x1D, 0x1C, 0x30, 0x0E, 0x1C, 0x0C, 0x0C, 0x4C, 0xCC, 0xFE,
  0x00, 0x26, 0x66, 0x6C, 0x78, 0xFC, 0xCE, 0xC6, 0x00, 0x70, 0xE0, 0x60, 0x60, 0x62, 0x66, 0xFE,
  0x00, 0x46, 0xEE, 0xFE, 0xD6, 0x82, 0xC6, 0x32, 0x00, 0x42, 0xC6, 0xE6, 0xF6, 0xDE, 0xCE, 0xC6,
  0x00, 0x1C, 0x3E, 0x66, 0xC6, 0xC6, 0xCC, 0x78, 0x00, 0x0E, 0x1E, 0x36, 0x66, 0xFC, 0xC0, 0xC0,
  0x00, 0x1C, 0x3E, 0x66, 0xC6, 0xD6, 0xDC, 0x77, 0x00, 0x0E, 0x1E, 0x36, 0x66, 0xF8, 0xCC, 0xC6,
  0x00, 0x0E, 0x1E, 0x32, 0x60, 0xFE, 0x06, 0xFE, 0x00, 0x7E, 0xFC, 0x83, 0x30, 0x02, 0x38, 0x60,
  0x26, 0x82, 0x66, 0x04, 0xE6, 0xC6, 0xFE, 0x00, 0x26, 0x82, 0x66, 0x22, 0xE6, 0x6C, 0x38, 0x00,
  0x62, 0xC6, 0xC6, 0xD6, 0xFE, 0xEE, 0xC4, 0x00, 0x26, 0x66, 0xEC, 0x38, 0x7C, 0xEE, 0xC6, 0x00,
  0x26, 0x66, 0xEC, 0x38, 0x18, 0x18, 0x1C, 0x30, 0x3E, 0x66, 0xCC, 0x18, 0x32, 0x66, 0xFE, 0xFE,
  0x00, 0xFE, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0xFE, 0x00, 0xFE,
  0x00, 0xFE, 0x00, 0xB2, 0x00, 0xFF};

const byte gtsCOLOR[] = {
  0xFE, 0x41, 0xFE, 0x41, 0xFE, 0x41, 0xFE, 0x41, 0xFE, 0x41, 0xFE, 0x41, 0xFE, 0x41, 0xFE,
  0x41, 0xFE, 0x41, 0xFE, 0x41, 0xFE, 0x41, 0xFE, 0x41, 0xFE, 0x41, 0xFE, 0x41, 0xFE, 0x41, 0xFE,
  0x41, 0x8F, 0x41, 0xFF};

void main(void)
{
 set_snd_table(snd_table);
 screen_mode_2_text();
 paper(0xc);
 rle2vram (gtsPATTERN,0x0000);
 rle2vram (gtsCOLOR,0x2000);
 rle2vram (gtsNAME,0x1800);
 duplicate_pattern();
 cls();
 screen_on();
 print_at(1,1,"PRESS 1, 2 OR 3");
 enable_nmi();
 loop:
  if(keypad_1==1){
   disable_nmi();
   print_at(1,2,"BOUTON 1");
   play_sound(1);
   enable_nmi();
  }
  if(keypad_1==2){
   disable_nmi();
   print_at(1,2,"BOUTON 2");
   play_sound(2);
   enable_nmi();
  }
  if(keypad_1==3){
   disable_nmi();
   print_at(1,2,"BOUTON 3");
   play_sound(3);
   enable_nmi();
  }
 delay(1);
 goto loop;
}
void nmi(void) {}

button 1 = tome 1

button 2 = tome 2

button 3 = tome 3/noise can't hear it.

Share this post


Link to post
Share on other sites

need to combine tone 3 with noise in order to hear. you can't just play noise separately. so you end up with 2 tone channels + 1 noise   or 3 tone channels. I added it below so it adds new noise sound0 and then you play it the same time as channel 3

 

 

const byte sound1[] = {
 0x40,0xAB,0x01,0x08,0x42,0xAB,0x71,0x08,0x18,0x11,0x50,
};
const byte sound2[] = {
 0x80,0x5A,0x00,0x08,0x82,0x5A,0x70,0x08,0x18,0x11,0x90,
};
const byte sound3[] = {
 0xc0,0x2B,0xf0,0x0c,
0xd0
};

 

const byte sound0[]={
0x02,0x33,0x0c,0x1c,0x11,
0x10
};

 

const sound_t snd_table[] = {
  {sound1,SOUNDAREA1},
  {sound2,SOUNDAREA2},
  {sound3,SOUNDAREA6},
  {sound0,SOUNDAREA4},
};


  }
  if(keypad_1==3){
   disable_nmi();
   print_at(1,2,"BOUTON 3");
   play_sound(3);
   play_sound(4);
   enable_nmi();
  }
 

Edited by digress
  • Like 1

Share this post


Link to post
Share on other sites
16 hours ago, digress said:

need to combine tone 3 with noise in order to hear. you can't just play noise separately. so you end up with 2 tone channels + 1 noise   or 3 tone channels.

Is this a Colecovision software limitation?  Because the datasheet for the sound chip doesn't mention any interaction between channel 3 and noise.

 

Well, I'm finally in the process of writing diags for the sound chip, so I guess I'll find out soon enough.

Share this post


Link to post
Share on other sites

Ok.

 

If I want to use white noise I would write this?

Quote

const byte sound0[]={
0x00,0x33,0x0c,0x1c,0x11,
0x10
};

 

 

 

Share this post


Link to post
Share on other sites

that seemed to work:

 

this works too:

 

//Simple Bass
ch0:
0x00,0x00,0x06,0x08,0x24
,0x10
ch3:
0xc0,0x40,0xf0,0x0c
,0xd0

Share this post


Link to post
Share on other sites
On 1/18/2020 at 3:26 PM, ChildOfCv said:

Is this a Colecovision software limitation?  Because the datasheet for the sound chip doesn't mention any interaction between channel 3 and noise.

 

Well, I'm finally in the process of writing diags for the sound chip, so I guess I'll find out soon enough.

It's a hardware thing. The sound chip specifications are telling us that we can use the "frequency" data from the channel tone 3 as an input for the noise channel if this one is set for it. I do use this "peculiar chemistry" in all my ColecoVision musics. The mode 3 on the noise channel is called PERIODIC NOISE tuned with the TONE 3 (sort of) to produce a BASS instrument sound. The mode 7 on the noise channel is called WHITE NOISE tuned with the TONE 3 channel, allowing for cool explosions sound effects without being limited to only 3 presets of white noises.

Share this post


Link to post
Share on other sites
3 hours ago, newcoleco said:

It's a hardware thing. The sound chip specifications are telling us that we can use the "frequency" data from the channel tone 3 as an input for the noise channel if this one is set for it. I do use this "peculiar chemistry" in all my ColecoVision musics. The mode 3 on the noise channel is called PERIODIC NOISE tuned with the TONE 3 (sort of) to produce a BASS instrument sound. The mode 7 on the noise channel is called WHITE NOISE tuned with the TONE 3 channel, allowing for cool explosions sound effects without being limited to only 3 presets of white noises.

Interesting.  In my tests, I can run all 4 channels at once, but didn't notice that it used channel 3 as the base freq for channel 4.  I see that 4 lets you program in a frequency divider, though the data sheet didn't make it obvious what frequency was being divided.

 

Okay, it's finally clear in the block diagram (figure 4).  So you CAN run them separately or all at once, but the noise is still based on channel 3.

 

Edit:  Or maybe what the sheet says is that the noise clock divider has 4 settings:  N/2048, N/1024, N/512 (all where N is the reference clock), or N=tone #3.  If that's the case, it has one mode where it depends on tone 3, and 3 where it doesn't.

Edited by ChildOfCv

Share this post


Link to post
Share on other sites

Looks like you got it in your edit... both white noise and periodic noise have four modes each - three modes are pre-defined shift rates, and the fourth takes the shift rate from channel 3.

 

You can always run channel 3, audibly, at the same time -- even when it's clocking the noise channel. The volume settings are independent. But it's a little less useful if you're trying to play tuned sounds on the noise channel. ;)

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...