note on and note off into bitfield

This commit is contained in:
Gordon JC Pearce 2024-09-16 21:54:49 +01:00
parent 31c8b46cf4
commit 8ac07f03ae
2 changed files with 16 additions and 15 deletions

View File

@ -18,8 +18,8 @@
#include "chassis.hpp"
#include "patches.hpp"
#include "cpuboard.hpp"
#include "patches.hpp"
Assigner ic1;
@ -67,16 +67,13 @@ void Chassis::noteOn(uint8_t note) {
ic1.ram[0x4e] = 0x90;
ic1.ram[0x3e] = note;
ic1.noteOn();
for (uint8_t i=0x40; i<0x4f; i++) {
for (uint8_t i = 0x40; i < 0x4f; i++) {
printf("%02x ", ic1.ram[i]);
}
printf("\n");
s.keyon = true;
for (i = 0; i < NUM_VOICES; i++) {
vPtr++;
@ -96,6 +93,15 @@ void Chassis::noteOn(uint8_t note) {
}
void Chassis::noteOff(uint8_t note) {
ic1.ram[0x4e] = 0x80;
ic1.ram[0x3e] = note;
ic1.noteOn();
for (uint8_t i = 0x40; i < 0x4f; i++) {
printf("%02x ", ic1.ram[i]);
}
printf("\n");
s.keyon = false;
for (uint32_t i = 0; i < NUM_VOICES; i++) {
if (s.voice[i].note == note && !s.voice[i].isFree()) {
@ -178,13 +184,13 @@ void Chassis::run(const float **, float **outputs, uint32_t frames, const MidiEv
// highpass filter
float tmp = s.hptmp;
float smp, flt=0;
float smp, flt = 0;
float cut_tbl[4] = {0.91245, 0.97097, 1, 0.99088};
float cut = cut_tbl[(s.patchRam.switch2 & 0x18) >> 3];
float gain_tbl[4] = {-1, -1, 0, 4};
float gain = gain_tbl[(s.patchRam.switch2 & 0x18) >> 3];
// printf("hp= %02x\n", (s.patchRam.switch2 & 0x18)>>3);
// printf("hp= %02x\n", (s.patchRam.switch2 & 0x18)>>3);
for (uint32_t i = 0; i < frames; i++) {
smp = outputs[0][i];
@ -195,7 +201,6 @@ void Chassis::run(const float **, float **outputs, uint32_t frames, const MidiEv
}
s.hptmp = flt;
// copy left to right
memmove(outputs[1], outputs[0], sizeof(float) * frames);
// outputs[1][1]=1;

View File

@ -9,8 +9,6 @@ void Assigner::noteOn() {
// note that RAM addresses normally set to 0xff40 are reduced to 0x0040
printf("starting noteon %02x %02x\n", ram[0x4e], ram[0x3e]);
// 06ca
a = ram[0x3e]; // first byte is note value
c = 0x40; // fake velocity
@ -35,7 +33,6 @@ void Assigner::noteOn() {
// otherwise handle note on
// 06e8 lxi hl,$0008; ldax (a+hl) for table of bits
a = 1 << a;
printf("A=%02x\n", a);
c = a;
hl = 0x0040; // note bit flags
a = ram[hl + b]; // byte pointed to by upper part
@ -46,7 +43,6 @@ void Assigner::noteOn() {
return;
h06f9: // note off
printf("went to note off\n");
a = 0xff ^ (1 << a);
c = a;