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

Add MIDI portamento #183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add MIDI portamento #183

wants to merge 1 commit into from

Conversation

jpcima
Copy link
Contributor

@jpcima jpcima commented Jun 11, 2019

I saw the TODO item on portamento, and I implemented something.

It has a formula based on measurements I did quite long ago on Yamaha SY77 portamento delays.
DX7 may or may not have used identical values. I don't know DX7, this should be checked.

It's the kind of operation obtained when portamento is configured in poly mode.
It implements the CC 5 and 65.

@asb2m10
Copy link
Owner

asb2m10 commented Jun 14, 2019

I've just build it my self and I have the same error reported by travis:

dx7note.cc:266: undefined reference to `Porta::rates'

@jpcima
Copy link
Contributor Author

jpcima commented Jun 14, 2019

You're correct, msfa/porta* files have to be added to the project.
I haven't done this myself because I don't manage to find the version of Projucer which generates the identical project files. It needs to add these 2 files, and then it works.

@dronus
Copy link

dronus commented Nov 17, 2019

Actually it would be cool if this would implement the original DX7 controls for MONO and POLY mode portamento. Eg. Sysex Group 2 'Function Parameters', 64, 67-69 as is already mentioned by Documentation/sysex-format.txt.

The missing MONO / POLY implementation is the largest difference between Dexed and the DX7 for me, so I like to see this fixed, and this pull request is the first attempt I see. Cool!

@jpcima
Copy link
Contributor Author

jpcima commented Nov 17, 2019

Having just checked sysex-format.txt, I note the following values to be of interest.

64 MONO/POLY MODE CHANGE 0-1 O=POLY
67 PORTAMENTO MODE 0-1 0=RETAIN 1=FOLLOW
68 " GLISS 0-1
69 " TIME 0-99

I observe parameter 64 is unused in Dexed source, there exists however a "Mono" control which exists in the editor only. I guess I can work with this.

For the portamento case in mono mode, I guess it means to resume from the newest note's current pitch, as opposed to poly which resume from the newest note key value.

67/69 no problem, being identical to MIDI CC.
68 not implemented (I guess chromatic slide), but shouldn't be difficult; just round intermediate pitch to whole semitones.

Please correct if I'm wrong, as I don't have DX7.

@dcoredump
Copy link

dcoredump commented Nov 20, 2019

Hi @jpcima,

great work that the portamento is now also implemented! I have taken the pull request and added it to MicroDexed - an implementation of Dexed which works on the Teensy Microprocessor (see https://codeberg.org/dcoredump/MicroDexed) and it works nicely. I have a "real" DX7(II) and can try to compare - just have to take it out of the case (perhaps at weekend). I will also try to check the glissando-mode. Manual says: "... Observe how the pitch moves to the most recent note(s) in 1/2 step increments..."

The DX7 has two (four) different modes for portamento:

  • poly-mode: "retain" and "follow"
  • modo-mode: "fingered" and "fulltime"

Both are explained in the manual on page 14. From the text explanation I have no real idea what the modes are doing. Will try this on the original DX7.

Thanks for your work!

Holger

@jpcima
Copy link
Contributor Author

jpcima commented Nov 24, 2019

Hello @dcoredump.

Please examine some work I had done in a WIP branch, which I just pushed.
In it, the glissando mode was added based on system-exclusive data chunk.
https://github.com/jpcima/dexed/commits/portamento-wip

A thing: I am confused about interpretation of this sysex data.
eg. how to interpret Glissando parameter (0-1) which receives value 92 from a patch the dexed factory bank?
(I have coerced into boolean, but not sure if I should mask the high bits rather)

I believe to have figured out mony/poly from the manual, but I remain somewhat confused at parameters.

Also my friend @farvardin has accepted recently to do some quick testing on a DX7 (thanks), he has seemed to reach a preliminary conclusions that portamento settings operate as global on the synth.

About portamento times, I measured these myself on Yamaha synth other than DX7.
For fidelity, it will be interesting that a DX7 owner replicates the measurement of delay times.
(eg., time it takes to travel a span of 4 octaves for various Time settings in range 0-99)
this was a previous experiment: Wohlstand/libADLMIDI#102 (comment)

@dronus
Copy link

dronus commented Nov 24, 2019

@dcoredump modo-mode: "fingered" and "fulltime":

"fingered": Only apply portamento if one key is already down while a new key is pressed. Play fresh note otherwise.
"fulltime": Always slide pitch from the last note played, even if all keys where released inbetween.

Note for the original DX7, there is no such thing as "note playing", as all voices are always computed, even if the envelope has reached L4 and all carriers are at level zero. The implementation is all about keys pressed or not.

@dronus
Copy link

dronus commented Nov 24, 2019

@dcoredump poly-mode: "retain" and "follow":
This seems to be just about the sustain pedal effect:
"retain": Notes hold by the sustain pedal (but keys already released) will not do portamento.
"follow": Notes hold by the sustain pedal will behave like the keys are still down, will do portamento.

@dcoredump
Copy link

dcoredump commented Nov 25, 2019

Hi @jpcima,

Please examine some work I had done in a WIP branch, which I just pushed.
In it, the glissando mode was added based on system-exclusive data chunk.
https://github.com/jpcima/dexed/commits/portamento-wip

Many thnaks! I have added the changes to my code and will test later (currently no keyboard available).

A thing: I am confused about interpretation of this sysex data.
eg. how to interpret Glissando parameter (0-1) which receives value 92 from a patch the dexed factory bank?
(I have coerced into boolean, but not sure if I should mask the high bits rather)

Hm, strange: my reference for the SYSEX parameters is currently https://homepages.abdn.ac.uk/d.j.benson/pages/dx7/sysex-format.txt:

...
68              "     GLISS       0-1
...

So this must be a garbled SYSEX file or perhaps you used the wrong offset and it's another parameter.

I believe to have figured out mony/poly from the manual, but I remain somewhat confused at parameters.

The Dexed implementation seems to work, since in mono-mode I can clearly glide from one note to another (with portamento) and only the pitch changes - not the envelopes.

Also my friend @farvardin has accepted recently to do some quick testing on a DX7 (thanks), he has seemed to reach a preliminary conclusions that portamento settings operate as global on the synth.

Right. Also pitchbend and the other controllers (modwheel, footswitch, aftertouch, breathcontoller). That's why I am implementing a "per sound" configuration of those parameters (for MicroDexed).

About portamento times, I measured these myself on Yamaha synth other than DX7.
For fidelity, it will be interesting that a DX7 owner replicates the measurement of delay times.
(eg., time it takes to travel a span of 4 octaves for various Time settings in range 0-99)
this was a previous experiment: Wohlstand/libADLMIDI#102 (comment)

I set up my DX7II yesterday, but unfortunately my mixer has some problems, so I couldn't test anything yet.

@dcoredump
Copy link

dcoredump commented Nov 25, 2019

@dcoredump poly-mode: "retain" and "follow":
This seems to be just about the sustain pedal effect:
"retain": Notes hold by the sustain pedal (but keys already released) will not do portamento.
"follow": Notes hold by the sustain pedal will behave like the keys are still down, will do portamento.

What happens in "retain" mode when releasing the keys and holding the sustain pedal, when the tones haven't reached their target pitch? Do they "freeze" at the actual pitch they had when releasing?

@farvardin
Copy link

farvardin commented Nov 25, 2019 via email

@jpcima
Copy link
Contributor Author

jpcima commented Nov 25, 2019

Thanks to you both!
@farvardin I have actually completed analyzing the sample you have sent me, juste recently.

I posted the file sound.dat, it's analysis of peak frequency over time, where variation of pitch can be observed. It's a 3 column data file, having: time position, frequency (Hz), midi note (semitone)

sound.dat.gz
peakfrequency.cc.gz

It's the range of portamento in steps of 5, as 0,5,10,...,90,95,99.
Capture du 2019-11-25 13-43-41

When it's zoomed into each part, it doesn't appear linear in the semitones domain.
It looks much more like linear in the frequencies, but not exactly, it looks like a very slight "S" curve.

@dcoredump
Copy link

dcoredump commented Nov 26, 2019

Hi @jpcima,

I have a question about your glissando code:
What does porta_gliss_ = patch[68]; in dx7note.cc mean? This seems to be a var inside the OP4, I think EG_L1... The data for partamento is not located inside the patch[] array. It is stored outside (in MicroDexed I have a bigger struct which holds information for controllers and portamento). So I think it has to be stored inside class Controllers? Perhaps controllers.portamento_enable_cc is the same?

Regards, Holger

@jpcima
Copy link
Contributor Author

jpcima commented Nov 26, 2019

Oh yeah, I interpreted it wrong (part of wrong kind of message).
Originally, I took it from this item, found in sysex documentation.

68 " GLISS 0-1

@jpcima
Copy link
Contributor Author

jpcima commented Nov 26, 2019

@dcoredump

So I think it has to be stored inside class Controllers? Perhaps controllers.portamento_enable_cc is the same?

No, this is different from portamento_enable, which is just a On/Off based on standard MIDI.

Gliss=1 changes the way supposedly how portamento is traveling through notes (chromatic).
If I understand, I think it goes over only the whole semitones.

@mkruselj
Copy link
Contributor

mkruselj commented Apr 27, 2020

@jpcima Yes, that is correct. Glissando mode rounds the glide to semitones. Also I think the curvature of the glide is probably exponential rather than linear. Linear glide isn't particularly useful for live playing, it's more useful for sequencers, I find.

@dcoredump
Copy link

@jpcima

After a long time I am coming back to this. I manually added your PR to dexed.lv2 and MicroDexed. Portamento without glissando works as excepcted (I havn't tested the mono version yet). But enabling glissando does sound a little bit wired. It sounds disharmonic when portamento stops. I uploaded a recorded demo to soundcloud: https://soundcloud.com/codemanrhodes/dexed_lv2-portamento

I played a C4, aG4 and again a C4.

I hope you have an idea what is going wrong?

TIA, Holger

edwardgeorge pushed a commit to edwardgeorge/audio-resources that referenced this pull request Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants