Skip to content

add midi, note, and freq unit conversions #36

Description

@ogbabydiesal

Activity

  1. kemkartanya commented on Oct 21, 2024

    @kemkartanya

    @ogbabydiesal I can do this

  2. kemkartanya commented on Oct 21, 2024

    @kemkartanya

    where these to be added @ogbabydiesal

  3. ogbabydiesal commented on Dec 6, 2024

    @ogbabydiesal
    MemberAuthor

    @kemkartanya lets chat about this here - anyone else want to weigh in? i personally think it would be super cool to have this - we want to make sure that we are only adding things which would be useful to have in a beginner friendly library and we aren't adding features which might be unnecessary. part of the redesign process was to trim the excess - but I feel like I thought of some good reasons to have this but can't remember them now haha

  4. moved this to Ready for Work in p5.sound.json Jun 10, 2025
  5. changed the title [-]add midi and freq unit conversions[/-] [+]add midi, note, and freq unit conversions[/+] on Jul 5, 2025
  6. ogbabydiesal commented on Jul 5, 2025

    @ogbabydiesal
    MemberAuthor

    hi @kemkartanya wondering if you would be willing to work on this? was thinking it would be great to be able to do something like this:

    osc = new p5.Oscillator('C#4')

    or

    osc.freq('F3')

    setting pitch with midi might look like this

    osc.freq(midiToFreq(60))

    and

    let coolFrequency = midiToFreq(60)
    osc.freq(coolFreqency)

    with

    frequencyToMidi working in a similar fashion to midiToFreq

  7. pparocza commented on Aug 7, 2025

    @pparocza

    this PR introduces a P5SoundUtils constant that I think would be a good place to put these methods.

    @ogbabydiesal I think this casts another vote in favor a p5.Sound namespace, so that calling midiToFreq for example can be p5.Sound.midiToFreq() instead of P5SoundUtils.midiToFreq().

    Would be curious to hear if @ksen0 or @davepagurek have any thoughts on this?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      Ready for Work

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions