Skip to content

Commit

Permalink
Merge branch 'PerformanceUpdates' of github.com:diyelectromusic/MiniD…
Browse files Browse the repository at this point in the history
…exed into PerformanceUpdates
  • Loading branch information
diyelectromusic committed Dec 30, 2023
2 parents d581960 + f10421b commit f06a125
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ MiniDexed is a FM synthesizer closely modeled on the famous DX7 by a well-known
- [x] Menu structure on optional [HD44780 display](https://www.berrybase.de/sensoren-module/displays/alphanumerische-displays/alphanumerisches-lcd-16x2-gr-252-n/gelb) and rotary encoder
- [x] Runs up to 8 Dexed instances simultaneously (like in a TX816) and mixes their output together
- [x] Allows for each Dexed instance to be detuned and stereo shifted
- [x] Allows to configure multiple Dexed instances through `performance.ini` files
- [x] Allows to configure multiple Dexed instances through `performance.ini` files (e.g., [converted](https://github.com/BobanSpasic/MDX_Vault) from DX1, DX5, TX816, DX7II, TX802)
- [x] Compressor effect
- [x] Reverb effect
- [x] Voices can be edited over MIDI, e.g., using the [synthmata](https://synthmata.github.io/volca-fm/) online editor (requires [additional hardware](https://github.com/probonopd/MiniDexed/wiki/Hardware#usb-midi-device))
Expand Down Expand Up @@ -90,5 +90,5 @@ This project stands on the shoulders of giants. Special thanks to:
* [dcoredump](https://github.com/dcoredump) for https://codeberg.org/dcoredump/Synth_Dexed, a port of Dexed for embedded systems
* [rsta2](https://github.com/rsta2) for https://github.com/rsta2/circle, the library to run code on bare metal Raspberry Pi (without a Linux kernel or operating system) and for the bulk of the MiniDexed code
* [smuehlst](https://github.com/smuehlst) for https://github.com/smuehlst/circle-stdlib, a version with Standard C and C++ library support
* [Banana71](https://github.com/Banana71) for the sound design of the performances shipped with MiniDexed
* [BobanSpasic](https://github.com/BobanSpasic) for the [MiniDexedLibrarian](https://github.com/BobanSpasic/MiniDexedLibrarian) software
* [Banana71](https://github.com/Banana71) for the sound design of the [Soundplantage](https://github.com/Banana71/Soundplantage) performances shipped with MiniDexed
* [BobanSpasic](https://github.com/BobanSpasic) for the [MiniDexedLibrarian](https://github.com/BobanSpasic/MiniDexedLibrarian) software, [MiniDexed performance converter](https://github.com/BobanSpasic/MDX_PerfConv) and [collection of performances for MiniDexed](https://github.com/BobanSpasic/MDX_Vault)
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [ "${USB_VID}" ] ; then
OPTIONS="${OPTIONS} -o USB_GADGET_VENDOR_ID=${USB_VID}"
fi
if [ "${USB_DID}" ] ; then
OPTIONS="${OPTIONS} -o USB_GADGET_DEVICE_ID=${USB_DID}"
OPTIONS="${OPTIONS} -o USB_GADGET_DEVICE_ID_BASE=${USB_DID}"
fi

# Build circle-stdlib library
Expand Down
4 changes: 2 additions & 2 deletions src/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <circle/synchronize.h>
#include <assert.h>
#include <circle/usb/usbhcidevice.h>
#include <circle/usb/gadget/usbmidigadget.h>
#include "usbminidexedmidigadget.h"

LOGMODULE ("kernel");

Expand Down Expand Up @@ -69,7 +69,7 @@ bool CKernel::Initialize (void)
if (m_Config.GetUSBGadgetMode())
{
// Run the USB stack in USB Gadget (device) mode
m_pUSB = new CUSBMIDIGadget (&mInterrupt);
m_pUSB = new CUSBMiniDexedMIDIGadget (&mInterrupt);
}
else
{
Expand Down
86 changes: 86 additions & 0 deletions src/usbminidexedmidigadget.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
//
// usbminidexedmidigadget.h
//
// MiniDexed - Dexed FM synthesizer for bare metal Raspberry Pi
// Copyright (C) 2022 The MiniDexed Team
//
// Based on circle/usb/gadget/usbmidigadget.h
//
// 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
// the Free Software Foundation, either version 3 of the License, or
// (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, see <http://www.gnu.org/licenses/>.
//
#ifndef _usbminidexedmidigadget_h
#define _usbminidexedmidigadget_h

#include <circle/usb/gadget/usbmidigadget.h>
#include <circle/usb/gadget/usbmidigadgetendpoint.h>
#include <circle/sysconfig.h>
#include <assert.h>

class CUSBMiniDexedMIDIGadget : public CUSBMIDIGadget
{
private:
#define MDSTRINGDESCRIPTORS 3
const char *const s_MiniDexedStringDescriptor[MDSTRINGDESCRIPTORS] =
{
"\x04\x03\x09\x04", // Language ID
"probonopd",
"MiniDexed"
};

public:
CUSBMiniDexedMIDIGadget (CInterruptSystem *pInterruptSystem)
: CUSBMIDIGadget (pInterruptSystem)
{
}

~CUSBMiniDexedMIDIGadget (void)
{
assert(0);
}

protected:
// Override GetDescriptor frmo CUSBMIDIGadget.
// See CUSBMIDIGadget for details.
// This will only act on the DESCRIPOR_STRING.
// All other descriptors are returned from USBMIDIGadget.
//
const void *GetDescriptor (u16 wValue, u16 wIndex, size_t *pLength) override
{
assert (pLength);

u8 uchDescIndex = wValue & 0xFF;

switch (wValue >> 8)
{
case DESCRIPTOR_STRING:
if (!uchDescIndex)
{
*pLength = (u8) s_MiniDexedStringDescriptor[0][0];
return s_MiniDexedStringDescriptor[0];
}
else if (uchDescIndex < MDSTRINGDESCRIPTORS)
{
return CUSBMIDIGadget::ToStringDescriptor (s_MiniDexedStringDescriptor[uchDescIndex], pLength);
}
break;

default:
break;
}

return CUSBMIDIGadget::GetDescriptor(wValue, wIndex, pLength);
}
};

#endif

0 comments on commit f06a125

Please sign in to comment.