Klasse SID
- Alle implementierten Schnittstellen:
SIDChip
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibungprivate byteLast written valueprivate intTime to live for the last written valueprivate intTime to live for the last written valueprivate floatExternal audio input.private final ExternalFilterExternal filter that provides high-pass and low-pass filtering to adjust sound tone slightly.private FilterCurrently active filterprivate final Filter6581Filter used, if model is set to 6581private final Filter8580Filter used, if model is set to 8580private static final intprivate ChipModelCurrently active chip model.private float6581 nonlinearity term used for all DACsprivate static final floatOutput scaler.private final PotentiometerPaddle X register supportprivate final PotentiometerPaddle Y register supportprivate booleanfinal Voice[]SID voicesVon Schnittstelle geerbte Felder libsidplay.common.SIDChip
DEF_BASE_ADDRESS, FC_MAX, REG_COUNT -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprivate voidageBusValue(int n) private floatclock()SID clocking - 1 cycle.final voidclock(int delta_t, IntConsumer sample) Clock SID forward using chosen output sampling algorithm.protected ChipModelvoidinput(int value) 16-bit input (EXT IN).(Package privat) static floatkinkedDac(int input, float nonLinearity, int maxBit) Estimate DAC nonlinearity.voidmute(int channel, boolean mute) SID voice muting.byteread(int offset) Read registers.voidreset()SID reset.voidset6581VoiceNonlinearity(float nonLinearity) Set DAC nonlinearity for 6581 emulation.voidsetChipModel(ChipModel model) Set chip model.voidsetClockFrequency(double clockFrequency) Setting of clock frequency.voidsetDigiBoost(boolean digiBoost) voidwrite(int offset, byte value) Write registers.
-
Felddetails
-
INPUTDIGIBOOST
private static final int INPUTDIGIBOOST- Siehe auch:
-
OUTPUT_LEVEL
private static final float OUTPUT_LEVELOutput scaler.- Siehe auch:
-
voice
SID voices -
filter
Currently active filter -
filter6581
Filter used, if model is set to 6581 -
filter8580
Filter used, if model is set to 8580 -
externalFilter
External filter that provides high-pass and low-pass filtering to adjust sound tone slightly. -
potX
Paddle X register support -
potY
Paddle Y register support -
busValue
private byte busValueLast written value -
busValueTtl
private int busValueTtlTime to live for the last written value -
databus_ttl
private int databus_ttlTime to live for the last written value -
model
Currently active chip model. -
ext_in
private float ext_inExternal audio input. -
nonLinearity6581
private float nonLinearity65816581 nonlinearity term used for all DACs -
samplesMuted
private boolean samplesMuted
-
-
Konstruktordetails
-
SID
public SID()Constructor.
-
-
Methodendetails
-
set6581VoiceNonlinearity
public void set6581VoiceNonlinearity(float nonLinearity) Set DAC nonlinearity for 6581 emulation.- Parameter:
nonLinearity-- Siehe auch:
-
kinkedDac
static float kinkedDac(int input, float nonLinearity, int maxBit) Estimate DAC nonlinearity. The SID contains R-2R ladder, but the second resistor is not exactly double the first. The parameter nonLinearity models the deviation from the resistor lengths. There appears to be about 4 % error on the 6581, resulting in major kinks on the DAC. The value that the DAC yields tends to be larger than expected. The output of this method is normalized such that DAC errors occur both above and below the ideal value equally.- Parameter:
input- digital value to convert to analognonLinearity- nonlinearity parameter, 1.0 for perfect linearity.maxBit- highest bit that may be set in input.- Gibt zurück:
- the analog value as modeled from the R-2R network.
-
setChipModel
Set chip model.- Angegeben von:
setChipModelin SchnittstelleSIDChip- Parameter:
model- chip model to use
-
getChipModel
-
reset
public void reset()SID reset. -
input
public void input(int value) 16-bit input (EXT IN). Write 16-bit sample to audio input. NB! The caller is responsible for keeping the value within 16 bits. Note that to mix in an external audio signal, the signal should be resampled to 1MHz first to avoid sampling noise. -
read
public byte read(int offset) Read registers.Reading a write only register returns the last byte written to any SID register. The individual bits in this value start to fade down towards zero after a few cycles. All bits reach zero within approximately $2000 - $4000 cycles. It has been claimed that this fading happens in an orderly fashion, however sampling of write only registers reveals that this is not the case. NB! This is not correctly modeled. The actual use of write only registers has largely been made in the belief that all SID registers are readable. To support this belief the read would have to be done immediately after a write to the same register (remember that an intermediate write to another register would yield that value instead). With this in mind we return the last value written to any SID register for $2000 cycles without modeling the bit fading.
-
write
public void write(int offset, byte value) Write registers. -
mute
public void mute(int channel, boolean mute) SID voice muting. -
setClockFrequency
public void setClockFrequency(double clockFrequency) Setting of clock frequency.- Angegeben von:
setClockFrequencyin SchnittstelleSIDChip- Parameter:
clockFrequency- System clock frequency at Hz
-
ageBusValue
private void ageBusValue(int n) -
clock
Clock SID forward using chosen output sampling algorithm. -
clock
private float clock()SID clocking - 1 cycle. -
getFilter6581
-
getFilter8580
-
setDigiBoost
public void setDigiBoost(boolean digiBoost) - Angegeben von:
setDigiBoostin SchnittstelleSIDChip
-