MCPcopy Create free account
hub / github.com/doldecomp/mkdd / noteOnOsc

Method noteOnOsc

libs/JSystem/JAudio/System/JASBank.cpp:78–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76 return channel;
77}
78JASChannel *JASBank::noteOnOsc(u32 wavePtr, u8 p2, u8 p3, u16 p4, JASChannel::Callback cb, void *ptr) {
79 static JASOscillator::Point const OSC_RELEASE_TABLE[2] = {
80 {0x0001, 0x000A, 0x0000},
81 {0x000F, 0x0000, 0x0000},
82 };
83 static const JASOscillator::Data OSC_ENV = {0, 1.0f, NULL, OSC_RELEASE_TABLE, 1.0f, 0.0f};
84 JASChannel *channel = new JASChannel(cb, ptr);
85 if (!channel) {
86 return NULL;
87 }
88 channel->setPriority(p4);
89 channel->mWaveData.mPtr = wavePtr;
90 channel->mWaveData._0 = 2;
91 channel->setInitPitch(16736.016f / JASDriver::getDacRate());
92 channel->setKey(p2 - channel->mWaveData.mInfo._01);
93 channel->setVelocity(p3);
94 channel->setOscInit(0, &OSC_ENV);
95 if (!channel->play()) {
96 return NULL;
97 }
98 return channel;
99}

Callers

nothing calls this directly

Calls 7

getDacRateFunction · 0.85
setInitPitchMethod · 0.80
setKeyMethod · 0.80
setVelocityMethod · 0.80
setOscInitMethod · 0.80
setPriorityMethod · 0.45
playMethod · 0.45

Tested by

no test coverage detected