View Issue Details

IDProjectCategoryView StatusLast Update
0001622OpenMPTFeature Requestpublic2022-08-14 20:45
Reporterdem1 Assigned ToSaga Musix  
PrioritylowSeverityfeatureReproducibilityN/A
Status resolvedResolutionfixed 
Platformx64OSWindowsOS Version7
Product VersionOpenMPT 1.31.00.* (old testing) 
Target VersionOpenMPT 1.30.06.00 / libopenmpt 0.6.5 (upgrade first)Fixed in VersionOpenMPT 1.30.06.00 / libopenmpt 0.6.5 (upgrade first) 
Summary0001622: PC Notes multi-channel recording
Description

Currently, if multiple parameters change simultaneously, only the parameter with the highest index has its value recorded into the pattern.
There is no multi-channel recording available at the moment for PC events.
It may be possible to add this feature, since there is already multi-channel recording for notes.

Additional Information

From this forum thread:
https://forum.openmpt.org/index.php?topic=6849.0

TagsNo tags attached.
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Activities

dem1

dem1

2022-08-11 21:54

reporter   ~0005264

I forgot to reinstall TortoiseSVN before I started working on this from the GitHub mirror.
Hopefully this diff suffices?

1622.diff (1,550 bytes)   
diff --git mptrack/View_pat.cpp mptrack/View_pat.cpp
index 80b60b14c..1ccbaafdb 100644
--- mptrack/View_pat.cpp
+++ mptrack/View_pat.cpp
@@ -3553,9 +3553,10 @@ LRESULT CViewPattern::OnRecordPlugParamChange(WPARAM plugSlot, LPARAM paramIndex
 		return 0;
 	
 	CSoundFile &sndFile = pModDoc->GetSoundFile();
+	const bool isLiveRecord = IsLiveRecord();
 
 	//Work out where to put the new data
-	const PatternEditPos editPos = GetEditPos(sndFile, IsLiveRecord());
+	const PatternEditPos editPos = GetEditPos(sndFile, isLiveRecord);
 	const CHANNELINDEX chn = editPos.channel;
 	const ROWINDEX row = editPos.row;
 	const PATTERNINDEX pattern = editPos.pattern;
@@ -3574,11 +3575,24 @@ LRESULT CViewPattern::OnRecordPlugParamChange(WPARAM plugSlot, LPARAM paramIndex
 	{
 		// MPTM: Use PC Notes
 
+
 		// only overwrite existing PC Notes
 		if(m.IsEmpty() || m.IsPcNote())
 		{
 			m.Set(NOTE_PCS, static_cast<ModCommand::INSTR>(plugSlot + 1), static_cast<uint16>(paramIndex), static_cast<uint16>(pPlug->GetParameter(static_cast<PlugParamIndex>(paramIndex)) * ModCommand::maxColumnValue));
 		}
+
+		//PC Note multi-channel recording, issue 1622
+		auto recordGroup = pModDoc->GetChannelRecordGroup(chn);
+		if(isLiveRecord && recordGroup != RecordGroup::NoGroup)
+		{
+			auto newChannel = FindGroupRecordChannel(recordGroup, false, chn + 1);
+			if (newChannel != CHANNELINDEX_INVALID)
+			{
+				SetCurrentColumn(newChannel);
+			}
+		}
+
 	} else if(sndFile.GetModSpecifications().HasCommand(CMD_SMOOTHMIDI))
 	{
 		// Other formats: Use MIDI macros
1622.diff (1,550 bytes)   
Saga Musix

Saga Musix

2022-08-12 19:26

administrator   ~0005266

The idea is a good start but I would want this feature to work in a bit more structured way rather than randomly spraying PC events over all the channels. Optimally, if a specific parameter was already recorded on a previous row, the same channel should be tried again.

Saga Musix

Saga Musix

2022-08-14 13:03

administrator   ~0005274

Can you check how r17730 works for you? Like with regular multichannel recording, the edit cursor must already be placed on a recording-enabled channel for this feature to kick in. This version also works with PC events recorded via MIDI Mapping.

dem1

dem1

2022-08-14 19:23

reporter   ~0005281

It's working great! I like this approach.
It will record into both recording groups, unlike regular multichannel recording. I'm not sure if that will be too surprising for other users.
Besides that I didn't notice any wrinkles.
I mostly tested this with PC notes entered through the pattern editor and plugin UIs, I only gave MIDI Mapping a quick sniff test.

Saga Musix

Saga Musix

2022-08-14 19:25

administrator   ~0005282

It's difficult to say because I have no idea if anyone is even using the second record group feature at all. But good point, it should probably respect whatever record group the cursor is currently in for consistency.

Saga Musix

Saga Musix

2022-08-14 20:45

administrator   ~0005284

This change has been applied and everyhing was backported to OpenMPT 1.30.

Issue History

Date Modified Username Field Change
2022-08-11 16:06 dem1 New Issue
2022-08-11 21:54 dem1 Note Added: 0005264
2022-08-11 21:54 dem1 File Added: 1622.diff
2022-08-12 19:26 Saga Musix Note Added: 0005266
2022-08-14 12:58 Saga Musix Assigned To => Saga Musix
2022-08-14 12:58 Saga Musix Status new => assigned
2022-08-14 13:03 Saga Musix Note Added: 0005274
2022-08-14 13:03 Saga Musix Status assigned => feedback
2022-08-14 19:23 dem1 Note Added: 0005281
2022-08-14 19:23 dem1 Status feedback => assigned
2022-08-14 19:25 Saga Musix Note Added: 0005282
2022-08-14 20:45 Saga Musix Note Added: 0005284
2022-08-14 20:45 Saga Musix Status assigned => resolved
2022-08-14 20:45 Saga Musix Resolution open => fixed
2022-08-14 20:45 Saga Musix Fixed in Version => OpenMPT 1.30.06.00 / libopenmpt 0.6.5 (upgrade first)
2022-08-14 20:45 Saga Musix Target Version => OpenMPT 1.30.06.00 / libopenmpt 0.6.5 (upgrade first)