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

volume vs velocity #14

Closed
alienbeatpoet opened this issue May 21, 2016 · 1 comment
Closed

volume vs velocity #14

alienbeatpoet opened this issue May 21, 2016 · 1 comment

Comments

@alienbeatpoet
Copy link

i’m trying to affect each particular note’s velocity. i thought maybe you were using ‘volume’ where you meant ‘velocity’, but that appears to not be the case.

i have a loop that is generating new Note() instances, but i can’t seem to affect the velocity or volume. the result is basically the following:

Note(value=A, octave=3, volume=101)
Note(value=B, octave=5, volume=68)
Note(value=E, octave=4, volume=86)
Note(value=C, octave=5, volume=71)
Note(value=E, octave=3, volume=104)
Note(value=B, octave=5, volume=65)
Note(value=C, octave=3, volume=85)
Note(value=A, octave=5, volume=74)

however, when the midi file is written out (see attached) and opened in Logic Pro X all the notes are correct, however they all have a velocity of 120 and no indication of change in volume anywhere.

where is the velocity being set to a value of 120? and where is the volume value being used?

tracks.mid.zip

@kroger
Copy link
Owner

kroger commented May 23, 2016

Hi,

Volume is the proper musical term, whereas velocity is MIDI jargon (since it was developed with keyboard in mind). Setting the volume keyword will affect the MIDI velocity, as you thought.

The volume keyword seems to be working here, on a Mac. I heard some people having problems on Windows.

Could you, please, try to run the following code and see if it works? It will generate one note with the velocity of 68:

#!/usr/bin/env python

from pyknon.genmidi import Midi
from pyknon.music import Note

notes1 = [Note(value=0, octave=3, volume=68)]
midi = Midi(1, tempo=90)
midi.seq_notes(notes1, track=0)
midi.write("demo.mid")

As you can see, it works here:

note

Maybe Logic doesn't like the Midi file pyknon generates?

@kroger kroger closed this as completed Apr 20, 2021
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