MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / get_pitched_freq_instr

Function get_pitched_freq_instr

src/Engine/Adlib/adlplayer.cpp:368–377  ·  view source on GitHub ↗

returns note frequency with pitch wheel value applied

Source from the content-addressed store, hash-verified

366
367// returns note frequency with pitch wheel value applied
368int get_pitched_freq_instr(int note, int instrument)
369{
370 int pitch = instruments[instrument].cur_pitchbend;
371 if (pitch==0)
372 return adl_gv_freq_table[note];
373 else if (pitch>0)
374 return adl_gv_freq_table[note] + adl_gv_detune_table[note]*pitch;
375 else
376 return adl_gv_freq_table[note] + adl_gv_detune_table[note-1]*pitch;
377}
378
379// sets pitch for particular instrument
380// apply for adlib channels with same instrument

Callers 2

adlib_play_noteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected