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

Inaudible pitch change #27

Open
agourlay opened this issue Dec 22, 2024 · 2 comments
Open

Inaudible pitch change #27

agourlay opened this issue Dec 22, 2024 · 2 comments

Comments

@agourlay
Copy link

I am using Rustysynth 1.3.2 to play guitar sound and I facing some difficulties with set the pitch bend.

The context is similar to my previous issue where you helped me split the values for the synthesizer 🙏

I was too fast to declare victory after being able to hear any pitch changes 😆

The pitch change is not always audible in my application.

I have a specific sequence of events corresponding to a down bend on a single guitar string.

The sequence is the following:

Note on: channel=4, key=69, velocity=127
Midi message: channel=4, command=224, data1=0, data2=80
Midi message: channel=4, command=224, data1=0, data2=80
Midi message: channel=4, command=224, data1=0, data2=79
Midi message: channel=4, command=224, data1=0, data2=78
Midi message: channel=4, command=224, data1=0, data2=77
Midi message: channel=4, command=224, data1=0, data2=76
Midi message: channel=4, command=224, data1=0, data2=75
Midi message: channel=4, command=224, data1=0, data2=74
Midi message: channel=4, command=224, data1=0, data2=73
Midi message: channel=4, command=224, data1=0, data2=72
Midi message: channel=4, command=224, data1=0, data2=71
Midi message: channel=4, command=224, data1=0, data2=70
Midi message: channel=4, command=224, data1=0, data2=69
Midi message: channel=4, command=224, data1=0, data2=68
Midi message: channel=4, command=224, data1=0, data2=67
Midi message: channel=4, command=224, data1=0, data2=66
Midi message: channel=4, command=224, data1=0, data2=65
Midi message: channel=4, command=224, data1=0, data2=64
Midi message: channel=4, command=224, data1=0, data2=64
Midi message: channel=4, command=224, data1=0, data2=64
Midi message: channel=4, command=224, data1=0, data2=64
Note off: channel=4, key=69

I would expect to hear the pitch going down.

Those events are played over a realistic period of time but I can not hear any change of pitch between the two NoteOn/NoteOff instructions.

Is there anything specific to configure to get the change of pitch working?

For reference, this is how I build my synthesizer https://github.com/agourlay/ruxguitar/blob/master/src/audio/midi_player.rs#L82

Thanks again for this awesome project!

@sinshu
Copy link
Owner

sinshu commented Dec 23, 2024

I attempted to reproduce the issue.

The following code uses the TinyAudio crate to play a single guitar note and apply pitch bending. As in your MIDI message sequence, data2 oscillates between 64 and 80.
https://github.com/sinshu/rustysynth-bend-test/blob/main/src/main.rs

This bend range is quite subtle, as it represents half of a semitone, which might make it less noticeable. However, in my environment, it sounds like the pitch bends as expected. Does this minimal code reproduce the issue in your environment?

@agourlay
Copy link
Author

Thank you very much for taking the time to build a reproducer!

I do hear the subtle change of pitch in your example, I will investigate further on my side and keep you posted.

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

No branches or pull requests

2 participants