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 shell commands to the MIDI File Player #713

Merged
merged 28 commits into from
Jan 15, 2021
Merged

Add shell commands to the MIDI File Player #713

merged 28 commits into from
Jan 15, 2021

Conversation

jjceresa
Copy link
Collaborator

@jjceresa jjceresa commented Dec 6, 2020

Commands are:

  • player_start Start playing from the beginning of current song
  • player_stop Stop playing
  • player_cont Continue playing
  • player_step num Move forward/backward in current song to +/-num ticks
  • player_next Move to next song
  • player_loop num Set loop number to num (-1 = loop forever)
  • player_tempo_bmp num Set tempo to num beats per minute

@jjceresa
Copy link
Collaborator Author

jjceresa commented Dec 7, 2020

Please note that player_tempo_bpm command call actual bugged fluid_player_set_bpm(). Once fix-player-tempo branch (#711) will be merged into master, actual branch (this PR) will require to be updated and completed before merging it to master.

@derselbst
Copy link
Member

We have some issues here:

  • You cannot add additional arguements to the existing public API functions new_fluid_cmd_handler and new_fluid_server. Use recently introduced new_fluid_cmd_handler2 for this purpose and add a new_fluid_server2 function.
  • You've changed the order of processing in fluidsynth.c: You're now executing the command file before having loaded a default soundfont. This will be problematic if the user relies on the default soundfont. If the user has noteon commands in his command file, those commands will now fail because no preset has been assigned yet.

src/midi/fluid_midi.c Outdated Show resolved Hide resolved
jjceresa added 9 commits January 10, 2021 14:43
- keep existant API new_fluid_cmd_handler(), new_fluid_server() unchanged.
- add player parameter to  new_fluid_cmd_handler2() API.
- add new_fluid_server2() API.
Put player tempo commands in fluid_handle_player_tempo_cde() functions.
@sonarcloud
Copy link

sonarcloud bot commented Jan 10, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@derselbst
Copy link
Member

I just gave it a test and it works very well. Thanks!

@derselbst derselbst merged commit 4f2cb37 into master Jan 15, 2021
@derselbst derselbst deleted the player-cmd branch January 15, 2021 18:04
@derselbst derselbst added this to the 2.2 milestone Jan 15, 2021
@jjceresa
Copy link
Collaborator Author

I just gave it a test and it works very well.

Thanks for reviewing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants