Haha, you don't need to be angry. It turned out that my feelings were wrong. I never deny the fact that I'm genuinely happy with Gigatron's sound (to be honest, Tetronis.gt1's music really needs improvement). So what is currently certain is that each audio channel of Gigatron can freely change the volume, and there is no fake thing.at67 wrote: ↑15 Mar 2022, 15:50 The issue here is that it is way more powerful than you think, experiment more, lament less...
I should be asleep, but I am annoyed, why am I annoyed? Who the F knows, anyway here is a video of code that I wrote in the last 45minutes that conclusively proves what the Gigatron is capable of, if you refuse to accept this proof, then I give up.
https://www.youtube.com/watch?v=-RmvJREUqcU
Here is the entirety of the source code written in gtBASIC, there is no faking of the waveform, the oscilloscope samples address 0x13, (XOUT), as fast as it can to give a representation of the audio being generated.
Good luck :/
P.S. Yes it uses ROMvX0 instructions, but that is completely irrelevant, the same thing works with any ROM, just much less efficiently in terms of vCPU cycles.Code: Select all
_runtimePath_ "../runtime" _runtimeStart_ &hFFFF _arraysStart_ &hFFFF _codeRomType_ ROMvX0 _enable6BitAudioEmu_ ON 'experimental const SMP_A = &h8000 const SMP_N = 64 const SMP_H = 64 const OSC_X = 49 const OSC_Y = (120 - 64)/2 + 4 const OSC_A = &h0800 + OSC_Y*256 + OSC_X const OFFSCREEN=&h78A0 samplesAddr = SMP_A def byte(SMP_A, 0, 1, SMP_N) = 0 'buffer A def byte(SMP_A + &h40, 0, 1, SMP_N) = 0 'buffer B 'alloc offscreen scrolling areas, (<address>, <optional width>, <optional height>, <optional offset>) alloc OFFSCREEN, 96, 8, &h0100 def byte(&h0702, x, 0.0, 360.0, 64, 4) = sin(x)*31.0 + 32.0 v1=0 : v2=v1 : v3=v2 : v4=v3 s1=1 : s2=s1 : s3=s2 : s4=s3 scrollPos=0 : scrollTmp=scrollPos gosub initialise init textScroll sound off f = 0 repeat wait set SOUND_TIMER, 5 gosub sinewave gosub oscilloscope inc f.lo if (f.lo LSR 1) AND 1 then v1 = v1 + s1 if (f.lo LSR 2) AND 1 then v2 = v2 + s2 if (f.lo LSR 4) AND 1 then v3 = v3 + s3 if (f.lo LSR 8) AND 1 then v4 = v4 + s4 if (v1 > 63) OR (v1 < 0) then s1 = -s1 if (v2 > 63) OR (v2 < 0) then s2 = -s2 if (v3 > 63) OR (v3 < 0) then s3 = -s3 if (v4 > 63) OR (v4 < 0) then s4 = -s4 forever sinewave: sound on, 1, 2000, v1, 2 sound on, 2, 2500, v2, 2 sound on, 3, 3000, v3, 2 sound on, 4, 3500, v4, 2 return oscilloscope: addrA = samplesAddr 'erase waveform buffer B set FG_COLOUR, &h10 sAddr = samplesAddr XOR &h40 for i=SMP_N-1 downto 0 asm LD 0x13 'sample waveform POKE+ _addrA 'save to buffer LDWI _OSC_A OSCPX _sAddr, _i endasm 'pixelAddr = (((peek(sAddr + i)) AND &hFC) LSR 2) LSL 8 'poke OSC_A + pixelAddr + i, &h10 next i 'draw waveform buffer A set FG_COLOUR, &h1D for i=SMP_N-1 &downto 0 asm LDWI _OSC_A OSCPX _samplesAddr, _i endasm 'pixelAddr = (((peek(samplesAddr + i)) AND &hFC) LSR 2) LSL 8 'poke OSC_A + pixelAddr + i, &h1D next i 'toggle waveform buffers samplesAddr = samplesAddr XOR &h40 return textScroll: asm PUSH LDWI &h01E1 'bottom banner STW _scrollTmp LDW _scrollPos POKE _scrollTmp INC _scrollPos POP endasm ret initialise: mode 2 set BG_COLOUR, &h30 cls cls OFFSCREEN, 96, 8 set FG_COLOUR, &h20 rectf OSC_X - 3, OSC_Y - 3, OSC_X + SMP_N + 2, OSC_Y + SMP_H + 2 set FG_COLOUR, &h10 rectf OSC_X, OSC_Y, OSC_X + SMP_N - 1, OSC_Y + SMP_H - 1 set FG_COLOUR, &h3F tscroll off tclip off set FG_COLOUR, &h0F at 2, 112 : print "Sinewave Envelopes!.." return
I'll probably use gtbasic soon, as it seems to be a lot more functional than GLCC. A lot of the GLCC programs I've written so far cause the Gigatron to freeze for no apparent reason, especially with certain loops or nested calls to functions.