Skip to content

Commit

Permalink
rc
Browse files Browse the repository at this point in the history
  • Loading branch information
marchingband committed Dec 27, 2023
1 parent 7ecd0cf commit 65fdf53
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 28 deletions.
25 changes: 25 additions & 0 deletions notes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
rst:0xc (SW_CPU_RESET),boot:0x3f (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1420
ho 0 tail 12 room 4
load:0x40078000,len:13540
load:0x40080400,len:3604
entry 0x400805f0
E (367) esp_core_dump_fla␞␆�: No core dump partition found!
E (367) esp_core_dump_flash: No core dump partition found!
[ 4][D][esp32-hal-cpu.c:244] setCpuFrequencyMhz(): PLL: 480 / 2 = 240 Mhz, APB: 80000000 Hz
E (257) psram: PSRAM ID read error: 0x7aa9ae06
[ 14][W][esp32-hal-psram.c:71] psramInit(): PSRAM init failed!
Total heap: 312908
Free heap: 285172
Total PSRAM: 0
Free PSRAM: 0
CPU freq: 240
[ 39][I][wvr_0.3.cpp:86] wvr_init(): arduino setup running on core 1
[ 40][I][wvr_0.3.cpp:87] wvr_init(): cpu speed 240
[ 45][I][wvr_0.3.cpp:88] wvr_init(): Flash Speed = 80000000 Flash mode = 0
[ 52][I][wvr_0.3.cpp:89] wvr_init(): wvr starting up

*** VERSION 3.8.4 ***
4 changes: 2 additions & 2 deletions src/bundle.h

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions src/gpio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ extern "C" {
QueueHandle_t wav_player_queue;
}

bool cacheUseFTDI = 1;
bool cacheUseUsbMidi = 1;
static bool useFTDI = 1;
static bool useUsbMidi = 1;

void on_release_per_config(int pin_num)
{
Expand Down Expand Up @@ -139,14 +139,14 @@ void wvr_gpio_clear(void){
void wvr_gpio_start()
{
wvr_gpio_clear();
log_i("useFTDI is %d",cacheUseFTDI);
log_i("useUsbMidi is %d",cacheUseUsbMidi);
log_i("useFTDI is %d",useFTDI);
log_i("useUsbMidi is %d",useUsbMidi);
for(int i=0;i<14;i++)
{
if(
((i == 0) && cacheUseFTDI) ||
((i == 1) && cacheUseFTDI) ||
((i == 2) && cacheUseUsbMidi)
((i == 0) && useFTDI) ||
((i == 1) && useFTDI) ||
((i == 2) && useUsbMidi)
)
{
continue;
Expand Down Expand Up @@ -213,8 +213,8 @@ void wvr_gpio_start()
if(buttons[13] != NULL) buttons[13]->onRelease([](){on_release_per_config(13);});
}

void wvr_gpio_init(bool useFTDI, bool useUsbMidi){
cacheUseFTDI = useFTDI;
cacheUseUsbMidi = useUsbMidi;
void wvr_gpio_init(bool _useFTDI, bool _useUsbMidi){
useFTDI = _useFTDI;
useUsbMidi = _useUsbMidi;
wvr_gpio_start();
}
18 changes: 2 additions & 16 deletions src/wav_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ struct buf_t {
struct wav_player_event_t wav_player_event;
struct wav_player_event_t next_wav_player_event;
struct asr_t asr;
// enum response_curve response_curve;
struct vol_t stereo_volume;
struct vol_t target_stereo_volume;
int16_t *buffer_a;
Expand Down Expand Up @@ -189,9 +188,6 @@ void init_buffs(void)
bufs[i].buffer_a = (int16_t *)malloc(BYTES_PER_READ);
bufs[i].buffer_b = (int16_t *)malloc(BYTES_PER_READ);
bufs[i].buffer_head = (int16_t *)ps_malloc(BYTES_PER_READ);
// bufs[i].buffer_a = (int16_t *)malloc(BYTES_PER_READ_PLUS);
// bufs[i].buffer_b = (int16_t *)malloc(BYTES_PER_READ_PLUS);
// bufs[i].buffer_head = (int16_t *)ps_malloc(BYTES_PER_READ_PLUS);
if(bufs[i].buffer_a==NULL || bufs[i].buffer_b == NULL || bufs[i].buffer_head == NULL)
{
log_e("failed to alloc buffers at %d",i);
Expand Down Expand Up @@ -240,14 +236,6 @@ void update_pitch_bends(void)
{
for(int i=0; i<16; i++)
{
// float pitch_bend = (float)channel_pitch_bend[i];
// float bend = (pitch_bend / 8192.0) - 1.0;
// float semitones = bend >= 0.0 ? 2.0 * bend : 2.0 * bend;
// float exponent = semitones / 12.0;
// float pitch_factor = pow(2, exponent);
// s15p16 pitch_factor_fp = pitch_factor * 0x10000;
// channel_pitch_bend_factor[i] = pitch_factor_fp;

uint16_t pitch_bend = channel_pitch_bend[i]; // 14 bit
s15p16 bend = (pitch_bend << 16) / 8192.0 - ( 1 << 16);
// s15p16 semitones = bend >= 0 ? 12 * bend : 12 * bend;
Expand Down Expand Up @@ -1065,8 +1053,7 @@ void IRAM_ATTR wav_player_task(void* pvParameters)
output_buf[i] += (sample_right >> DAMPEN_BITS);
i++;

// (bufs[buf].wav_data.note_off_meaning == HALT) &&
// if((bufs[buf].fade != FADE_NORMAL) && (i % fade_factor < 2) && bufs[buf].wav_data.note_off_meaning == HALT) // were fading and its time to decrement volumes
// fading in/out
if(
(bufs[buf].fade != FADE_NORMAL) &&
(i % fade_factor < 2) &&
Expand All @@ -1075,7 +1062,7 @@ void IRAM_ATTR wav_player_task(void* pvParameters)
(bufs[buf].wav_data.play_back_mode != ASR_LOOP) ||
(bufs[buf].wav_data.note_off_meaning != IGNORE)
)
)// were fading and its time to decrement volumes
)
{
if(bufs[buf].fade == FADE_OUT )
{
Expand Down Expand Up @@ -1113,7 +1100,6 @@ void IRAM_ATTR wav_player_task(void* pvParameters)
break;
}
// bufs[buf].fade_counter += 2;

}

if(idx >= remaining) // finished the section
Expand Down

0 comments on commit 65fdf53

Please sign in to comment.