Clean up and copyright information added.

pull/112/head
Holger Wirtz 3 years ago
parent 213160d30f
commit 9a78c14a76
  1. 1
      MicroDexed.ino
  2. 24
      drumset.h
  3. 114
      effect_auto_pan.cpp
  4. 54
      effect_auto_pan.h
  5. 2
      sampleset.h
  6. 23
      sequencer.cpp
  7. 27
      sequencer.h

@ -5,6 +5,7 @@
Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android
(c)2018-2021 H. Wirtz <wirtz@parasitstudio.de>
M. Koslowski <positionhigh@gmx.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

@ -1,3 +1,27 @@
/*
MicroDexed
MicroDexed is a port of the Dexed sound engine
(https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6/4.x with audio shield.
Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android
(c)2018-2021 M. Koslowski <positionhigh@gmx.de>
H. Wirtz <wirtz@parasitstudio.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _DRUMSET_H
#define _DRUMSET_H

@ -1,114 +0,0 @@
/*
Copyright (c) 2019-2021 H. Wirtz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#include <Arduino.h>
#include <Audio.h>
#include "effect_auto_pan.h"
/*************************************************************************/
// A u d i o E f f e c t A u t o P a n
// Written by Holger Wirtz
// 20191205 - initial version
static const audio_block_t zeroblock = {
0, 0, 0, {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
#if AUDIO_BLOCK_SAMPLES > 16
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
#endif
#if AUDIO_BLOCK_SAMPLES > 32
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
#endif
#if AUDIO_BLOCK_SAMPLES > 48
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
#endif
#if AUDIO_BLOCK_SAMPLES > 64
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
#endif
#if AUDIO_BLOCK_SAMPLES > 80
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
#endif
#if AUDIO_BLOCK_SAMPLES > 96
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
#endif
#if AUDIO_BLOCK_SAMPLES > 112
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
#endif
}
};
void AudioEffectAutoPan::update(void)
{
audio_block_t *in;
audio_block_t *mod;
audio_block_t *out[2];
in = receiveReadOnly(0);
if (!in)
in = (audio_block_t*)&zeroblock;
mod = receiveReadOnly(1);
if (!mod)
mod = (audio_block_t*)&zeroblock;
out[0] = allocate();
out[1] = allocate();
if (in && mod && out[0] && out[1])
{
arm_q15_to_float(in->data, in_f, AUDIO_BLOCK_SAMPLES);
arm_q15_to_float(mod->data, pan_f, AUDIO_BLOCK_SAMPLES);
arm_offset_f32(pan_f, 1.0, pan_f, AUDIO_BLOCK_SAMPLES);
arm_scale_f32(pan_f, PI / 4.0, pan_f, AUDIO_BLOCK_SAMPLES); // PI/4
// right
for (uint8_t n = 0; n < AUDIO_BLOCK_SAMPLES; n++)
out_f[0][n] = in_f[n] * _pseudo_log * arm_sin_f32(pan_f[n]);
arm_float_to_q15 (out_f[0], out[0]->data, AUDIO_BLOCK_SAMPLES);
// left
for (uint8_t n = 0; n < AUDIO_BLOCK_SAMPLES; n++)
out_f[1][n] = in_f[n] * _pseudo_log * arm_cos_f32(pan_f[n]);
arm_float_to_q15 (out_f[1], out[1]->data, AUDIO_BLOCK_SAMPLES);
if (in)
{
release(in);
}
if (in != (audio_block_t*)&zeroblock)
{
release(in);
}
if (mod != (audio_block_t*)&zeroblock)
{
release(mod);
}
for (uint8_t i = 0; i < 2; i++)
{
if (out[i])
{
transmit(out[i], i);
release(out[i]);
}
}
}
}

@ -1,54 +0,0 @@
/*
Copyright (c) 2019-2021 H. Wirtz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef effect_auto_pan_h_
#define effect_auto_pan_h_
#include "Arduino.h"
#include "AudioStream.h"
/*************************************************************************/
// A u d i o E f f e c t A u t o P a n
// Written by Holger Wirtz
// 20191205 - inital version
class AudioEffectAutoPan : public AudioStream
{
public:
AudioEffectAutoPan(void):
AudioStream(2, inputQueueArray)
{
;
}
virtual void update(void);
private:
audio_block_t *inputQueueArray[2];
audio_block_t *out[2];
float in_f[AUDIO_BLOCK_SAMPLES];
float out_f[2][AUDIO_BLOCK_SAMPLES];
float pan_f[AUDIO_BLOCK_SAMPLES];
const float _pseudo_log = 1048575 / (float)(1 << 20);
};
#endif

@ -1,2 +0,0 @@
#pragma once
#include <Arduino.h>

@ -1,3 +1,26 @@
/*
MicroDexed
MicroDexed is a port of the Dexed sound engine
(https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6/4.x with audio shield.
Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android
(c)2018-2021 M. Koslowski <positionhigh@gmx.de>
H. Wirtz <wirtz@parasitstudio.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
#include "sequencer.h"

@ -1,6 +1,29 @@
/*
MicroDexed
#ifndef SEQUENCER_H
#define SEQUENCER_H
MicroDexed is a port of the Dexed sound engine
(https://github.com/asb2m10/dexed) for the Teensy-3.5/3.6/4.x with audio shield.
Dexed ist heavily based on https://github.com/google/music-synthesizer-for-android
(c)2018-2021 M. Koslowski <positionhigh@gmx.de>
H. Wirtz <wirtz@parasitstudio.de>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _SEQUENCER_H
#define _SEQUENCER_H
typedef struct sequencer_s {
float drums_volume;

Loading…
Cancel
Save