omz:forum

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

    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 2
    • Posts 3
    • Best 1
    • Controversial 0
    • Groups 0

    dodo

    @dodo

    1
    Reputation
    408
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    dodo Unfollow Follow

    Best posts made by dodo

    • Published Pythonista Music

      For your amusement, there is this article published which contains a url with Python music, only playable for we Pythonistas.

      https://www.thespoof.com/spoof-news/us/144172/song-celebrates-streets-of-san-francisco

      The appropriate music for it..

      posted in Pythonista
      dodo
      dodo

    Latest posts made by dodo

    • RE: The dodo song for San Francisco sidewalking

      @dodo said:

      '''Especially fio San Francisco and NYC, or any cuiy with too much dodo, this generates a MIDI file with random black keys, using the midiutil module. The instrument is dodo. The result is then played with the sound.MIDIPlayer class.
      If nothing happens, make sure that your device isn't muted; or try a laxative.
      '''
      from midiutil.MidiFile import MIDIFile
      from random import choice, randint
      import sound

      Configure a MIDI file with one track:

      midi = MIDIFile(1, adjust_origin=True)
      midi.addTempo(0, 0, 1000)

      Select a random instrument:

      #program = randint(21,22)
      program = 53 #dodo
      midi.addProgramChange(0, 0, 0, program)

      Generate some random notes:

      duration = randint(1,10)
      c_major = [30,30,30,30,30,32,34,37,39,42,42,42,42,42,44,46,49,51,54,54,54,54,54,54,56,58,61, 63, 66, 68, 70, 73, 75,78,78,78,78,78]
      for t in range(1000):
      duration=randint(1,10)
      pitch = choice(c_major)

      track, channel, pitch, time, duration, volume

      midi.addNote(0, 0, pitch, t *randint(1,4),duration, randint(20,100))

      Write output file:

      with open('output.mid', 'wb') as f:
      midi.writeFile(f)

      Play the result:

      player = sound.MIDIPlayer('output.mid')
      player.play()

      posted in Pythonista
      dodo
      dodo
    • The dodo song for San Francisco sidewalking

      '''Especially fio San Francisco and NYC, or any cuiy with too much dodo, this generates a MIDI file with random black keys, using the midiutil module. The instrument is dodo. The result is then played with the sound.MIDIPlayer class.
      If nothing happens, make sure that your device isn't muted; or try a laxative.

      from midiutil.MidiFile import MIDIFile
      from random import choice, randint
      import sound
      
      # Configure a MIDI file with one track:
      midi = MIDIFile(1, adjust_origin=True)
      midi.addTempo(0, 0, 1000)
      
      # Select a random instrument:
      #program = randint(21,22)
      program = 53 #dodo
      midi.addProgramChange(0, 0, 0, program)
      
      # Generate some random notes:
      duration = randint(1,10)
      c_major = [30,30,30,30,30,32,34,37,39,42,42,42,42,42,44,46,49,51,54,54,54,54,54,54,56,58,61, 63, 66, 68, 70, 73, 75,78,78,78,78,78]
      for t in range(1000):
      	duration=randint(1,10)
      	pitch = choice(c_major)
      	# track, channel, pitch, time, duration, volume
      	midi.addNote(0, 0, pitch, t *randint(1,4),duration, randint(20,100))
      	
      # Write output file:
      with open('output.mid', 'wb') as f:
      	midi.writeFile(f)
      
      # Play the result:
      player = sound.MIDIPlayer('output.mid')
      player.play()
      
      posted in Pythonista
      dodo
      dodo
    • Published Pythonista Music

      For your amusement, there is this article published which contains a url with Python music, only playable for we Pythonistas.

      https://www.thespoof.com/spoof-news/us/144172/song-celebrates-streets-of-san-francisco

      The appropriate music for it..

      posted in Pythonista
      dodo
      dodo