Skip to content

Commit

Permalink
fix #271723: implement filters in Zerberus
Browse files Browse the repository at this point in the history
Test for parsing new opcodes added
Actualized Zerberus readme file
Add reading bpf and brf filters.
  • Loading branch information
anatoly-os committed Jun 8, 2018
1 parent 171d42b commit 964c301
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 23 deletions.
6 changes: 6 additions & 0 deletions mtest/zerberus/opcodeparse/opcodeTest.sfz
Expand Up @@ -6,3 +6,9 @@ sample=../sample.wav
<region> trigger=attack loop_mode=loop_continuous
<region> trigger=first
<region> trigger=legato
<region> fil_type=lpf_1p cutoff=200 fil_veltrack=4000
<region> fil_type=hpf_1p fil_keycenter=60 fil_keytrack=400
<region> fil_type=hpf_2p pan=100 offset=16178
<region> fil_type=lpf_2p delay=2
<region> fil_type=bpf_2p
<region> fil_type=brf_2p
22 changes: 21 additions & 1 deletion mtest/zerberus/opcodeparse/tst_sfzopcodes.cpp
Expand Up @@ -55,7 +55,7 @@ void TestOpcodes::testOpcodes()

std::list<Zone *>::iterator curZone = synth->instrument(0)->zones().begin();

QCOMPARE(synth->instrument(0)->zones().size(), (unsigned long) 6);
QCOMPARE(synth->instrument(0)->zones().size(), (unsigned long) 12);
QCOMPARE((*curZone)->keyLo, (char) 60);
QCOMPARE((*curZone)->keyHi, (char) 70);
QCOMPARE((*curZone)->keyBase, (char) 40);
Expand Down Expand Up @@ -110,6 +110,26 @@ void TestOpcodes::testOpcodes()
QCOMPARE((*curZone)->trigger, Trigger::FIRST);
curZone++;
QCOMPARE((*curZone)->trigger, Trigger::LEGATO);
curZone++;
QCOMPARE((*curZone)->fil_type, FilterType::lpf_1p);
QCOMPARE((*curZone)->isCutoffDefined, true);
QCOMPARE((*curZone)->cutoff, 200.f);
QCOMPARE((*curZone)->fil_veltrack, 4000);
curZone++;
QCOMPARE((*curZone)->fil_type, FilterType::hpf_1p);
QCOMPARE((*curZone)->fil_keycenter, 60);
QCOMPARE((*curZone)->fil_keytrack, 400);
curZone++;
QCOMPARE((*curZone)->fil_type, FilterType::hpf_2p);
QCOMPARE((*curZone)->pan, 100);
QCOMPARE((*curZone)->offset, 16178ll);
curZone++;
QCOMPARE((*curZone)->fil_type, FilterType::lpf_2p);
QCOMPARE((*curZone)->delay, 2000.f); //ms
curZone++;
QCOMPARE((*curZone)->fil_type, FilterType::bpf_2p);
curZone++;
QCOMPARE((*curZone)->fil_type, FilterType::brf_2p);
delete synth;
}

Expand Down
44 changes: 22 additions & 22 deletions zerberus/README
Expand Up @@ -16,6 +16,8 @@ Instrument definition
Sample Definition
sample
Input controls
loccN
hiccN
lochan
hichan
key
Expand All @@ -41,11 +43,15 @@ Input controls
on_loccN
on_hiccN
Sample Player
delay
offset
loop_mode
no_loop
one_shot
loop_continuous
loop_sustain
loop_start
loop_end
Performance Parameters
Pitch
transpose
Expand All @@ -55,13 +61,29 @@ Pitch
Pitch EG
Pitch LFO
Filter
fil_type
cutoff
fil_veltrack
Filter EG
Filter LFO
Amplifier
pan
volume
amp_veltrack
rt_decay
Amplifier EG
ampeg_delay
ampeg_start
ampeg_attack
ampeg_hold
ampeg_decay
ampeg_sustain
ampeg_vel2delay
ampeg_vel2attack
ampeg_vel2hold
ampeg_vel2decay
ampeg_vel2sustain
ampeg_vel2release
ampeg_release
Amplifier LFO
Equalizer
Expand All @@ -75,8 +97,6 @@ Unsupported
--

Input Controls
loccN
hiccN
lobend
hibend
lochanaft
Expand All @@ -94,16 +114,12 @@ Input Controls
sw_vel
Performance Parameters
Sample Player
delay
delay_random
delay_ccN
offset
offset_random
offset_ccN
end
count
loop_start
loop_end
sync_beats
sync_offset
Pitch
Expand Down Expand Up @@ -139,15 +155,12 @@ Pitch LFO
pitchlfo_freqccN
pitchlfo_freqpolyaft
Filter
fil_type
cutoff
cutoff_ccN
cutoff_chanaft
cutoff_polyaft
resonance
fil_keytrack
fil_keycenter
fil_veltrack
fil_random
Filter EG
fileg_delay
Expand Down Expand Up @@ -177,7 +190,6 @@ Filter LFO
fillfo_freqchanaft
fillfo_freqpolyaft
Amplifier
pan
width
position
amp_keytrack
Expand All @@ -203,18 +215,6 @@ Amplifier
xfout_hiccN
xf)cccurve
Amplifier EG
ampeg_delay
ampeg_start
ampeg_attack
ampeg_hold
ampeg_decay
ampeg_sustain
ampeg_vel2delay
ampeg_vel2attack
ampeg_vel2hold
ampeg_vel2decay
ampeg_vel2sustain
ampeg_vel2release
ampeg_delayccN
ampeg_startccN
ampeg_attackccN
Expand Down
4 changes: 4 additions & 0 deletions zerberus/sfz.cpp
Expand Up @@ -355,6 +355,10 @@ static void readFilterType(const QString& data, FilterType& filType)
filType = FilterType::hpf_1p;
else if (data == "hpf_2p")
filType = FilterType::hpf_2p;
else if (data == "bpf_2p")
filType = FilterType::bpf_2p;
else if (data == "brf_2p")
filType = FilterType::brf_2p;
else
qDebug("SfzRegion: not supported fil_type value: %s", qPrintable(data));
}
Expand Down

0 comments on commit 964c301

Please sign in to comment.