Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop to main #37

Merged
merged 34 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
83f0079
add workflow for appending issues to the RNBO Project
x37v Oct 24, 2023
c4753f7
audio i/o tooltip and displayname from meta and comment
x37v Nov 10, 2023
d25a480
notes about pin naming with comment and metadata
x37v Nov 10, 2023
89770a5
Merge branch 'feature/audio-io-naming' into develop
x37v Nov 10, 2023
17e92e1
use new transportUsed to optionally not include a transport pin
x37v Dec 7, 2023
161aa45
impl initial GlobalTransport, cleanup existing Transport some
x37v Dec 8, 2023
a478162
always set the beat time
x37v Dec 8, 2023
dfcfc8b
simplify
x37v Dec 8, 2023
f479076
always advance time even if transport isn't running
x37v Dec 8, 2023
6586ec6
update transport time with the first watcher
x37v Dec 8, 2023
41cef6b
reorg in prep for control node
x37v Dec 8, 2023
52f1531
add transport control node
x37v Dec 8, 2023
fa3b02e
impl transport seeking
x37v Dec 11, 2023
ae9e5b0
Merge branch 'feature/globaltransport' into develop
x37v Dec 11, 2023
eb1338d
expose enum params as Int32
x37v Dec 13, 2023
3ef1774
fix IsIntParam
x37v Dec 14, 2023
9a4fff9
WIP expose dataref param
x37v Oct 13, 2023
c278fea
add WaveTable as a dep
x37v Oct 13, 2023
81e6ec4
sketchy initial mapping of datarefs
x37v Oct 13, 2023
058184e
WIP not working yet
x37v Nov 10, 2023
f5efaeb
looks like we're loading the data!
x37v Dec 11, 2023
f37cb65
more progress
x37v Dec 12, 2023
7b9a33d
trying to read in audio but takes too long
x37v Dec 13, 2023
89e55eb
sucess reading in wave data!!
x37v Dec 14, 2023
70e284f
keep track of running tasks and clean up
x37v Dec 14, 2023
878b657
add another TODO
x37v Dec 14, 2023
308beeb
Merge branch 'feature/datarefs' into develop
x37v Dec 14, 2023
2f6aa87
cleanup dead code
x37v Dec 15, 2023
e45c866
update param order
x37v Dec 15, 2023
d3636ef
split out some of the non template stuff into cpp file
x37v Dec 15, 2023
4d5c7cf
add mutex around pipe launch
x37v Dec 15, 2023
72a98dd
fix param count
x37v Dec 15, 2023
daab06e
remove unused WaveTable references
x37v Dec 19, 2023
de4f557
adjust MIDI notes in case we have overlaps
x37v Dec 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Add Issues and PRs to RNBO Project

on:
issues:
types:
- opened
pull_request:
types:
- opened

jobs:
add-to-project:
name: Add to RNBO Project
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
project-url: https://github.com/orgs/Cycling74/projects/${{ secrets.RNBO_PROJECT_NUMBER }}
github-token: ${{ secrets.RNBO_PROJECT_PAT }}

81 changes: 81 additions & 0 deletions Source/RNBOMetasound/Private/RNBOMIDI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,23 @@ void FMIDIPacket::Advance(int32 InNumFrames)
mFrame -= InNumFrames;
}

bool FMIDIPacket::IsNoteOff(uint8_t chan, uint8_t num) const
{
return mLength == 3 && mData[0] == (chan | 0x80) && mData[1] == num;
}

bool FMIDIPacket::IsNoteOn(uint8_t chan, uint8_t num) const
{
return mLength == 3 && mData[0] == (chan | 0x90) && mData[1] == num;
}

FMIDIPacket FMIDIPacket::CloneTo(int32 frame) const
{
FMIDIPacket r = *this;
r.mFrame = frame;
return r;
}

FMIDIBuffer::FMIDIBuffer(const Metasound::FOperatorSettings& InSettings)
: NumFramesPerBlock(InSettings.GetNumFramesPerBlock())
{
Expand Down Expand Up @@ -142,6 +159,70 @@ void FMIDIBuffer::Push(FMIDIPacket packet)
}
}

void FMIDIBuffer::PushNote(int32 start, int32 dur, uint8_t chan, uint8_t note, uint8_t onvel, uint8_t offvel)
{
/* situations where we have to move an OFF
* 1. Our new note happens inside another scheduled duration
* * off after our off without an on after our off, move old off right before our new on
* 2. Our new note spans the off of another note
* * off between our on and our off, move old off to right before our new on
* 3. Our new note spans the an entire note
* * on and off come between our new on and off, move old off right before our new on
*
*/
const auto count = Packets.Num();
const auto end = start + dur;
for (auto i = 0; i < count; i++) {
auto& p = Packets[i];
const auto f = p.Frame();
if (f < start) {
continue;
}
// in range
if (p.IsNoteOn(chan, note)) {
// existing note starts before our note ends, we need to shorten our note
if (f < end) {
// insert our Off before the existing On, updated time
Packets.Insert(FMIDIPacket::NoteOff(f, note, offvel, chan), i);
// adjust count
if (f < NumFramesPerBlock) {
CountInBlock++;
}
// push our on after so we don't screw up above index
Push(FMIDIPacket::NoteOn(start, note, onvel, chan));
return;
}
else {
break;
}
}
else if (p.IsNoteOff(chan, note) && f > start) {
// should only hit this case if a note on isn't found either within the new note bounds or after it.
// our new note either spans the off of an existing on note or is contained within an existing note
// move the off just before our on
auto off = p.CloneTo(start);
Packets.RemoveAt(i);

// adjust count
if (f < NumFramesPerBlock) {
CountInBlock--; // will get incremented in the Push below
}
// adjust last frame
if (Packets.Num() > 0) {
LastFrame = Packets.Last(0).Frame();
}
else {
LastFrame = -1;
}
Push(off); // XXX assumes there isn't another matching On at the exact time
break;
}
}

Push(FMIDIPacket::NoteOn(start, note, onvel, chan));
Push(FMIDIPacket::NoteOff(end, note, offvel, chan));
}

void FMIDIBuffer::Reset()
{
Packets.Reset();
Expand Down
7 changes: 2 additions & 5 deletions Source/RNBOMetasound/Private/RNBOMakeNote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,11 @@ class FMakeNoteOperator : public TExecutableOperator<FMakeNoteOperator>
const auto vel = static_cast<uint8_t>(std::clamp(*NoteVel, 1, 127));
const auto offvel = static_cast<uint8_t>(std::clamp(*NoteOffVel, 0, 127));
const auto chan = static_cast<uint8_t>(std::clamp(*NoteChan, 0, 15));
const int32 frames = std::max(static_cast<int32>(ceil(SampleRate.GetSeconds() * NoteDur->GetSeconds())), 1);
const int32 dur = std::max(static_cast<int32>(ceil(SampleRate.GetSeconds() * NoteDur->GetSeconds())), 1);

for (auto i = 0; i < num; i++) {
auto start = (*Trigger)[i];
auto end = start + frames;

MIDIOut->Push(FMIDIPacket::NoteOn(start, note, vel, chan));
MIDIOut->Push(FMIDIPacket::NoteOff(end, note, offvel, chan));
MIDIOut->PushNote(start, dur, chan, note, vel, offvel);
}
}
}
Expand Down
Loading
Loading