From 667cb2e1abb01050ba5ea15aa5816d50746440dd Mon Sep 17 00:00:00 2001 From: djdiskmachine <110535302+djdiskmachine@users.noreply.github.com> Date: Mon, 1 Jul 2024 22:04:20 +0200 Subject: [PATCH] MVEL cmd (#82) * MVEL cmd Set step velocity for MIDI instruments https://github.com/democloid/picoTracker/pull/163 Co-authored-by: djdiskmachine --- docs/wiki/What-is-LittleGPTracker.md | 7 ++++++- projects/resources/packaging/README.txt | 15 ++++++++++++++- sources/Application/Instruments/CommandList.cpp | 1 + sources/Application/Instruments/CommandList.h | 1 + .../Application/Instruments/MidiInstrument.cpp | 17 ++++++++++++----- .../Application/Instruments/MidiInstrument.h | 1 + sources/Application/Utils/HelpLegend.h | 5 +++++ 7 files changed, 40 insertions(+), 7 deletions(-) diff --git a/docs/wiki/What-is-LittleGPTracker.md b/docs/wiki/What-is-LittleGPTracker.md index e06b6b29..347ac520 100644 --- a/docs/wiki/What-is-LittleGPTracker.md +++ b/docs/wiki/What-is-LittleGPTracker.md @@ -1,5 +1,5 @@ # What is LittleGPTracker? -[*LittleGPTracker*](http://www.10pm.org/nostromo/lgpt/) *(a.k.a piggy tracker) is a sample based tracker originally programed for the gamepark handhelds and PSP but now also available for Microsoft Windows and ~~Mac OSX~~. It implements a user interface similar to the refined track-by-joypad software* [*littlesounddj*](http://www.littlesounddj.com/)*. Piggy currently supports 8 monophonic 8Bit/16Bit/44.1Khz stereo channels as well as 16 channel midi output. Piggy is currently under development and the latest versions of the program (along with beta builds) can be found at* [*https://github.com/djdiskmachine/LittleGPTracker/releases/*](https://github.com/djdiskmachine/LittleGPTracker/releases/)*.* +[*LittleGPTracker*](https://www.littlegptracker.com/) *(a.k.a piggy tracker) is a sample based tracker originally programed for the gamepark handhelds and PSP but now also available for Microsoft Windows, ~~Mac OSX~~ and an assortment of more modern handheld devices. It implements a user interface similar to the refined track-by-joypad software* [*littlesounddj*](http://www.littlesounddj.com/)*. Piggy currently supports 8 monophonic 8Bit/16Bit/44.1Khz stereo channels as well as 16 channel midi output. Piggy is currently under development and the latest versions of the program (along with beta builds) can be found at* [*https://github.com/djdiskmachine/LittleGPTracker/releases/*](https://github.com/djdiskmachine/LittleGPTracker/releases/)*.* You are reading a reference manual for those who are comfortable with LSDj or trackers in general. An alternative introduction to LittleGPTracker is our very own [quick_start_guide](https://web.archive.org/web/20170310001122/wiki.littlegptracker.com/doku.php?id=lgpt:quick_start_guide). If you have a question this manual does not answer, please join the [Discord](https://discord.com/invite/NMQVbrFgr3) or in #hexawe on efnet. Don't forget to check out the advanced [tips_tricks](https://web.archive.org/web/20170310001122/wiki.littlegptracker.com/doku.php?id=lgpt:tips_tricks) If you want to grab some sounds to get off the ground quickly, or want to hear and see what other people have been doing with piggy tracker, download some of the .zip archives from [http://hexawe.net](http://hexawe.net/)! @@ -104,6 +104,7 @@ Note: CTRL Key mappings of RT and LT are inverted. Since the keyboard's Arrow Ke - A: Insert Chain/Phrase/Note. - A,A: Insert next unused Chain/Phrase/Instrument. - LT+(B,A): Clone. This will overwrite the current Highlighted Item with a copy of itself using the next unused Item available. +(in song view) while keeping LT pressed, press A again without moving to Deep Clone (clone the phrases within the chain) - B+A: Cuts the current Highlighted Item . - A+ARROWS: Updates Highlighted Item value. - A+UP/DOWN: +/- 0x10. @@ -500,6 +501,10 @@ don't forget trying to combine it with complex hop structure ! sends a program change command on the current channel. 0000 is program change 1 +## MVEL --bb + +Sets MIDI note velocity + ## PAN aabb **PAN aabb: where bb is the pan destination and aa is the speed to get there** diff --git a/projects/resources/packaging/README.txt b/projects/resources/packaging/README.txt index 481cc9e3..0b567625 100644 --- a/projects/resources/packaging/README.txt +++ b/projects/resources/packaging/README.txt @@ -15,7 +15,20 @@ projects but make sure to backup your old cherished work just to be safe <3 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -Changelog Jan 23 2024 +Changelog Feb 1 2024 +1.3o_2 + Adds: + Alt row count colors, shoutout to https://github.com/edne ! + 00 and FE song screen colors, shoutout to https://github.com/koi-ikeno ! + RG35XX build, thanks to https://github.com/jpma29 for help with testing! + Fixes: + Root folder detection causing issues with importing samples on some systems (thank you jpma29) + Name generator causing issues with importing samples on some systems (thanks Dosly) + Actually random names (fixed random seed, thx Eldsvåda:) + Save as fixed on MIYOO systems (thx Pret4t) + Other: + Refactor help legend + 1.3o-1 First stable release! Fixed errors when random naming projects (shoutouts to 256k!) diff --git a/sources/Application/Instruments/CommandList.cpp b/sources/Application/Instruments/CommandList.cpp index 6681a573..574d12cb 100644 --- a/sources/Application/Instruments/CommandList.cpp +++ b/sources/Application/Instruments/CommandList.cpp @@ -19,6 +19,7 @@ static FourCC _all[]= { I_CMD_LPOF, I_CMD_MDCC, I_CMD_MDPG, + I_CMD_MVEL, I_CMD_PAN_, I_CMD_PFIN, I_CMD_PLOF, diff --git a/sources/Application/Instruments/CommandList.h b/sources/Application/Instruments/CommandList.h index db277d09..44bd1129 100644 --- a/sources/Application/Instruments/CommandList.h +++ b/sources/Application/Instruments/CommandList.h @@ -16,6 +16,7 @@ #define I_CMD_TMPO MAKE_FOURCC('T','M','P','O') #define I_CMD_MDCC MAKE_FOURCC('M','D','C','C') #define I_CMD_MDPG MAKE_FOURCC('M','D','P','G') +#define I_CMD_MVEL MAKE_FOURCC('M','V','E','L') #define I_CMD_PLOF MAKE_FOURCC('P','L','O','F') #define I_CMD_FLTR MAKE_FOURCC('F','L','T','R') #define I_CMD_TABL MAKE_FOURCC('T','A','B','L') diff --git a/sources/Application/Instruments/MidiInstrument.cpp b/sources/Application/Instruments/MidiInstrument.cpp index 9021335b..dfdc2372 100644 --- a/sources/Application/Instruments/MidiInstrument.cpp +++ b/sources/Application/Instruments/MidiInstrument.cpp @@ -2,6 +2,7 @@ #include "CommandList.h" #include "System/Console/Trace.h" #include +#include MidiService *MidiInstrument::svc_=0 ; @@ -23,6 +24,7 @@ MidiInstrument::MidiInstrument() { Insert(v) ; v=new Variable("table automation",MIP_TABLEAUTO,false) ; Insert(v) ; + velocity_ = 127; } MidiInstrument::~MidiInstrument() { @@ -53,15 +55,17 @@ bool MidiInstrument::Start(int c,unsigned char note,bool retrigger) { MidiMessage msg ; - // send volume + // send initial volume for this midi channel v=FindVariable(MIP_VOLUME) ; msg.status_=MIDI_CC+channel ; msg.data1_=7 ; - msg.data2_=int((v->GetInt()+0.99)/2) ; + msg.data2_ = floor(static_cast(v->GetInt()+0.99)/2) ; svc_->QueueMessage(msg) ; + // store initial velocity + velocity_ = msg.data2_; playing_=true ; retrig_=false ; @@ -101,7 +105,7 @@ bool MidiInstrument::Render(int channel,fixed *buffer,int size,bool updateTick) msg.status_=MIDI_NOTE_ON+mchannel ; msg.data1_=lastNote_[channel] ; - msg.data2_=0x7F ; + msg.data2_ = velocity_; svc_->QueueMessage(msg) ; first_[channel]=false ; @@ -151,13 +155,16 @@ void MidiInstrument::ProcessCommand(int channel,FourCC cc,ushort value) { } } break ; + case I_CMD_MVEL: { + velocity_ = floor(static_cast(value / 2)); + }; break; case I_CMD_VOLM: { MidiMessage msg ; msg.status_=MIDI_CC+mchannel ; - msg.data1_=7 ; - msg.data2_=int((value+0.99)/2) ; + msg.data1_= 7; + msg.data2_ = floor(static_cast(value / 2)); svc_->QueueMessage(msg) ; } ; break ; diff --git a/sources/Application/Instruments/MidiInstrument.h b/sources/Application/Instruments/MidiInstrument.h index 67f49b36..4490d621 100644 --- a/sources/Application/Instruments/MidiInstrument.h +++ b/sources/Application/Instruments/MidiInstrument.h @@ -62,6 +62,7 @@ class MidiInstrument:public I_Instrument { bool playing_ ; bool retrig_ ; int retrigLoop_ ; + char velocity_; TableSaveState tableState_ ; bool first_[SONG_CHANNEL_COUNT] ; diff --git a/sources/Application/Utils/HelpLegend.h b/sources/Application/Utils/HelpLegend.h index edb1a9ec..6551f692 100644 --- a/sources/Application/Utils/HelpLegend.h +++ b/sources/Application/Utils/HelpLegend.h @@ -61,6 +61,11 @@ static inline std::string* getHelpLegend(FourCC command) { result[1].assign("send program change bb"); result[2].assign("to current channel"); break; + case I_CMD_MVEL: + result[0].assign("MidiVELocity:--bb"); + result[1].assign("Set velocity bb for step"); + result[2].assign(""); + break; case I_CMD_PLOF: result[0].assign("PLay OFfset:aabb"); result[1].assign("jump abs to aa or");