omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. Cherubjk

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 4
    • Best 0
    • Controversial 0
    • Groups 0

    Cherubjk

    @Cherubjk

    0
    Reputation
    521
    Profile views
    4
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Cherubjk Unfollow Follow

    Latest posts made by Cherubjk

    • RE: pitch logic of sound.play_effect

      @cogs

      ´pitch´ seems to be a factor that is applied to the frequencies of the ´note´ parameter. E.g. factor 2.0 moves the tone one octave up, or 2.0**(1.0/12.0) moves it a tempered halftone up. See the following example.
      Duration of tones in the example must be limited, since there is only 30 fold polyphony and the duration of every tone would be 1.3 seconds.

      Cheers

      <pre>
      import sound
      import time

      notePitch_C3 = ('C3', 1.0) # use C3 as base, since it is lowest available C
      notePitch_C0 = ('C3', notePitch_C3[1]/(2**3)) # pitch factor = 1/8

      htf = 2.0**(1.0/12.0) # half tone frequency step, tempered

      store pairs of note and pitch. note is always 'C3':

      notesPitch = [notePitch_C0] # start with C0, 3 octaves below C3
      for i in xrange(72):
      notesPitch.append((notePitch_C0[0], notesPitch[-1][1]*htf)) # next halftone

      reverse = notesPitch[:]
      reverse.reverse()

      play upstairs and downstairs

      for note, pitch in notesPitch + reverse: # note is always C3
      id = sound.play_effect('Piano_' + note, 1, pitch)
      time.sleep(0.2)
      sound.stop_effect(id)
      </pre>

      posted in Pythonista
      Cherubjk
      Cherubjk
    • RE: Where am I getting the silent note from?

      @Dann

      Replace note 'G#3' by 'G3#' ;)

      Cheers

      posted in Pythonista
      Cherubjk
      Cherubjk
    • RE: Notification cancel bug?

      I made a couple more tests.

      I have put your code, JonB, into a loop except the initialization. Then I checked under what conditions the cancellation fails. Comparison of the fire date in the return value of notification.schedule with the corresponding value in the last element returned by notification.get_scheduled showed a tiny difference in every case of failure, and no difference in all cases of success.

      Managing the results of notification.schedule in an own list and using these elements for cancellation always works.

      I guess this cannot be circumvented in a script.

      @omz: Fantastic app though!

      Chears

      posted in Pythonista
      Cherubjk
      Cherubjk
    • RE: Notification cancel bug?

      A delay after cancel helps, e.g. time.sleep(1) works on my iPad version 3.

      Good luck!

      Cherubjk

      posted in Pythonista
      Cherubjk
      Cherubjk