Commit graph

24 commits

Author SHA1 Message Date
JetSetIlly
314e1d2dd4 reworked audio system
television signal split into video and audio signal. The audio signal is
only sent then a new sample from the TIA is ready

realtime mixer concept change. the mixer can be informed of a change of
TV spec. this allows the realtime mixer to make an informed judgement
about the required sample rate

the sample rate is unlikely to be ideal however unless the number of
scanlines in the TV image is the same as given in the basic TV
specification (ie. 262 lines for NTSC, 312 for PAL). because of that,
the realtime mixer can also indirectly regulate the rate of calls to
SetAudio(). the Regulate() function is called by the television which
then alters the call frequency to SetAudio() depending on the regulate
value. this effectively keeps the audio buffer nicely filled - neither
too long which would be audibly laggy, or too short which would result
in clipped audio

the values that control the regulation in both the sdlaudio package and
television package will need tweaking to find the best values
2025-01-11 16:14:47 +00:00
JetSetIlly
e4dea5c7b9 reverted SignalAttributes to a struct
profiling shows that the performance penalty is no longer that great.
the struct is preferable because the code is clearer
2024-11-23 14:56:37 +00:00
JetSetIlly
3aa5885ebe removed curated pacakge. replaced with wrapped errors
curated package predated the standard errors package introduced in
go1.13

the standard package does a better job of what curated attempted to do

the change of package also gave me a opportunity to clean up the error
messages a little bit
2023-02-13 21:58:39 +00:00
JetSetIlly
4bdc0925e3 wav encoder outputs 16bit values 2022-12-25 09:34:38 +00:00
JetSetIlly
4ce3aecbca readded wavwriter package using go-audio/wav package 2022-05-26 21:10:28 +01:00
JetSetIlly
7e57bbe46c removed unused/unwanted dependencies
go-wav, statsview and memviz all indirectly used gopkg.in/yaml.v3 which
I do not want to depend upon

WAV functionality is no longer available for wav writing or reading
(supercharger tapes). will try to reintroduce functionality in the
future
2022-05-26 12:14:34 +01:00
JetSetIlly
eade7ea7be readded patch, multiload and wav options to the commandline
removed experimental hiscore client (never used)
2021-12-11 09:56:39 +00:00
JetSetIlly
2a6cb49741 audio mixing is now a separate pacakge
TIA now puts both audio channels in the SignalAttributes separately

it is up to television.AudioMixer implementions to mix the two
channels as required
2021-09-15 18:53:48 +01:00
JetSetIlly
9a8019d654 SetAudio() in AudioMixer interface now expects a slice of SignalAttributes
This allows a single call to SetAudio() and for the loop to happen
inside that function - as opposed to looping over the slice and calling
SetAudio() multiple times
2021-09-02 14:59:34 +01:00
JetSetIlly
00fbbeb12b wavwriter now uses youpy/go-wav encoder 2021-08-19 12:33:02 +01:00
JetSetIlly
510c155989 clarified (and corrected) reset procedures 2021-01-14 12:37:38 +00:00
JetSetIlly
1cdb19562e error values checked (golangci-lint -E errcheck)
error checked on Close() of writable file

fixed disassembly sanity check
2020-10-18 10:59:19 +01:00
JetSetIlly
9e159b97d8 added more linters to golangci-lint config
godot --fix has been run to make sure all comments end in a full-stop

specified nolint directive to apply to specific linter
2020-10-16 16:31:07 +01:00
JetSetIlly
81b5a84a0b simplifed code (golangci-lint -E gosimple) 2020-10-15 20:56:48 +01:00
JetSetIlly
7fc48dcd65 renamed errors package to 'curated'
to differentiate with the now existing errors package in the standard
library.
2020-09-28 22:16:59 +01:00
JetSetIlly
2d5cae17f5 reworking of errors package
removed all messages from errors package. the strings are now hard coded
in place. the original reason for extracting the error strings like that
was (a) for redundancy and (b) for localisation possibilities. However,
in reality there is not much redundancy and since the project started
the scope of localisation is much larger (particularly due to the
addition of a GUI)

this is the first step. the next step is to remove the errors package
altogether. recent additions to Go mean that the functionality of the
errors package is no longer required. moreover, the original idea for
the errors package functions turns out not to have been as useful as
first appeared (the Error() functionality which makes sure no repeating
sub-strings occur is probably better achieved with static tooling).

one idea that comes from this which is quite interesting is the idea of
a curated error. that is, any error that has been "wrapped" as some
'generic' type. the IsAny() function in the errors package effectively
serves this purpose. we use that in one place in the input loop of the
debugger. not strictly necessary but nice to have so it would ideal
if we could remove the errors package but keep that idea.
2020-09-28 22:16:59 +01:00
JetSetIlly
298a5d343f updated copyright notice in all files
the note about historical versions also being covered wasn't strictly
needed and was ugly. the LICENCE being in the root file from the very
first commit is sufficient.
2020-07-26 20:18:56 +01:00
JetSetIlly
b039b59017 removed PauseAudio() and FlushAudio() from AudioMixer 2020-03-30 15:17:56 +01:00
Robin Eklind
24cb28843f gopher2600: use fully qualified import path as module path
Fixes #4.
2020-03-21 23:39:56 +01:00
steve
9f17a89259 audio fixes / overscan option
removed fixes previously added to account for Pitfall silences. caused
problems with other ROMs, particularly chiphead demo

added option to PLAY mode that presets window to use overscan area.
prevents excessive window resizing when overscan use is detected.

commentary fixes
2020-01-06 19:24:14 +00:00
steve
16b15fad95 o added licence headers to all files 2020-01-05 18:58:43 +00:00
steve
aba69ec69a o added overview documentation for every package
o recorder
    - fixed recorder after recent changes made to digest/video
    - fdf3f2765c59de4097a01b7fdf736ae38e4398b4
2020-01-05 18:58:41 +00:00
steve
f7b716148d o polycounter
- reworked polycounter to make it easier to generate polycounters of
	different bit lengths

o tia/audio
    - commented code

o wavwriter
    - now saves correctly with correct samplerate
2020-01-05 18:58:41 +00:00
steve
9f50f3c77e o audio
- implemented audio
    - using Ron Fries' method as the basis
    - removed sample playback - performance of Fries' method is good
	enough that we'll never need it again
    - sdl audio routines using QueueAudio() - maybe better if we use
	callbacks?
    - sketched wavwriter AudioMixer - not usable yet
2020-01-05 18:58:40 +00:00